Announcement

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

  • OLS issue when running a regression with 2 variables, but not with 1 variable each (Issue: no observations r(2000):

    Hello Statalist users,

    I am currently writting my master thesis within finance. I am now setting up the data to be used for Fixed Effect and Fama McBeth regressions. Before using this more "complex" methods I am working with simpel OLS regression to see how my data works.

    The issue is: I have a dependent variable called: rnf and five independent variables called raw11, raw22, raw33, etc.
    When I regress rnf on raw11 the regression works, but when I am trying to regress rnf on raw11 raw22 I get the error: no observations r(2000).

    Type of variable
    rnf = double
    rawXX = float

    raw11 is found by multiplying raw*R1 etc. R1 is a dummy variable. The same is present for all the other varibles only the number of R2 is changed. After these two are multiplied I set all the observations which has a zero to .(missing value) as they should be not included.

    Hopefully one of you can help

    Best,
    René

  • #2
    Show us the results of

    Code:
    su raw11 if missing(raw22)
    su raw22 if missing(raw11)
    Stata can't use observations in which a variable is missing, so it sounds as if values are always missing on precisely one of those variables. Your setting zeros to missings is the problem, I guess.
    Last edited by Nick Cox; 03 Apr 2014, 03:55.

    Comment


    • #3
      I have uploaded the result of the code.

      I have five raw11 raw22 raw33 raw44 raw55. Off cause including only raw11 and raw22 in the regression some of the observations in the dependent variable will not be taken into the regression.

      I do really not understand exactly what you mean by the setence that you right.

      Anyway thx for the help until now.

      Comment


      • #4
        Sorry; those weren't the best commands to illuminate your problem.

        Code:
         
        count if !missing(raw11, raw22) 
        count if missing(raw11)
        count if missing(raw22)
        may help more.

        Comment


        • #5
          Hi once again

          I have now used the commands, but what exactly should they help with? I still have the issue. Do I not see something obivous?

          Comment


          • #6
            Could the issue be that the data is panel data and in raw11 and raw22 the same observation with unqiue ID is but in different time periods?

            Comment


            • #7
              Using panel data is not the issue. The count result of 0 shows that you have precisely no observations in which both predictors are non-missing, so regress can do nothing. As mentioned earlier, setting your zeros to missings automatically excludes those observations from any model fitting.

              Comment


              • #8
                But have can I then regress the variables raw11 raw22 on rnf in a univariate analysis?

                The issue is that I have to delete the zeros, as these observations then influence the coefficient is there other way to get around this?

                Comment


                • #9
                  Sorry, but this looks like the same question asked again and again and answered in the same way. The first issue is what you want to do and I don't know what that is in terms of precisely what belongs in your regression. I don't work in economics or finance and only know the name Fama-MacBeth.

                  But I understand that Stata will include observations in a regression for a variable raw11 = raw * R1 if that has values of 0 and will not include such observations if raw11 is set to missing instead. That is the only point I am trying to explain.

                  You may be confused on how to implement this method in Stata. I have the impression that it is well documented.

                  If you are still confused, perhaps you should start a new topic on Fama-MacBeth to get attention from people in your field.

                  Comment

                  Working...
                  X