Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • wanted to create a regression tables,needed a dependent variable

    I am working on a hedge funds dataset. I wanted to create a regression tables. For creating regression tables I needed a dependent variable which is failure in my case.

    I would like to know if I can create a variable where in following condition satisfies:
    Date 10may2010 fund1 —0 10june2010 fund1 —-0 10july2010 fund1—1
    By this I mean the fund was active for 2 months and failed in 3rd month:

    Is there a possibility that I can create something like this?

    Your help is really appreciated.

    Thank you.

  • #2
    I doubt anybody can help you with this without seeing an example of your data. Please post back, using -dataex- to provide an excerpt of your data that includes the necessary variables and also illustrates cases of both failure and non-failure. If you are running version 16 or a fully updated version 15.1 or 14.2, -dataex- is already part of your official Stata installation. If not, run -ssc install dataex- to get it. Either way, run -help dataex- to read the simple instructions for using it. -dataex- will save you time; it is easier and quicker than typing out tables. It includes complete information about aspects of the data that are often critical to answering your question but cannot be seen from tabular displays or screenshots. It also makes it possible for those who want to help you to create a faithful representation of your example to try out their code, which in turn makes it more likely that their answer will actually work in your data.

    Also be sure to explain how to determine when a failure has taken place from the variables you show.

    Comment


    • #3
      Hi Clyde Schechter thank you so much for your reply. When I entered dataex i am getting error "input statement exceeds linesize limit. Try specifying fewer variables".

      Comment


      • #4
        I would like to determine failure based on the dates, i.e last date on the respective fund is 1 and rest all dates is 0.

        Comment


        • #5
          The error message you are getting from -dataex- means that your data set contains more variables than -dataset- can handle. For the purposes of this thread, you don't need all those variables. You just need the variable that identifies the fund and another variable that identifies the date. Since failure is defined as the last date shown, no other variables are needed. So, for example, if those variables are called fund_num and date, you could just do -dataex fund_num date- and that would produce what is needed. Anyway, thanks for trying.

          I'm going to assume that your data are in long layout: each observation contains the fund number and each date is found in a separate observation. I'm also going to assume that your date variable is a Stata internal format numeric variable--if it is a string then you need to convert it using the -daily()- function. String dates are not useful for computations.

          Code:
          by fund_num (date), sort: gen byte failed = (_n  == _N)

          Comment


          • #6
            Thank you so much, it worked perfectly worked me! the assumptions are correct! thank you for your help.

            Comment

            Working...
            X