Announcement

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

  • Number of observations decrease after running regression.

    Hi everyone,
    I am a college student and I have some questions about my econometrics report:

    1, My professor told me that I have to use 300 obs and that is exactly what I did. However, when I ran the regression command, the obs fell down to only 18 obs. What should I do to fix this?
    2, After I run xtgls to fix autocorrelation, what should I do next? Should I build a new function out of it or just describe the results?

    I have email my professor but she hasn't replied to me yet.

    I hope someone can help me with these

  • #2
    Regarding the first question, you probably have missing values (or error messages that remove some observations, can you show us the code and the output?). Try
    Code:
    misstable sum var1 var2 var3
    Simply enter all the variables in the model to see which have missing values.
    Best wishes

    (Stata 18.0 MP)

    Comment


    • #3
      Claire:
      welcome to this forum.
      Felix has helpfully replied to your first query.
      As an aside, while I do share Felix's opinion that it's likely that the issue you complain about is due to (tons) of missing values, I'd check (and report, as per FAQ) what you typed and what Stata gave you back.
      If you really have a dataset so plagued with missing values any statistical procedure carried out on it is clearly unreliable.
      As far as your second question is concerned, it seems that you're dealing with a T>N panel dataset. It my guess correct? In addition, I'm absolutely unclear with the new function you mentioned. What do you mean?
      Most of the contributors to this forum learnt, at same point of their academic life, that non-replying teachers/professors/mentors are not an exception, but rather a rule, regardless of the educational system. However, most of us turned this frustrating drawback into a rewarding self-learning experience and tried to increase their knowledge about statistics simply studying it and practising with datasets. Stata and Stata community are a wonderful intellectual/techinical gym in these respects.
      Eventually, the bad news: please read https://www.statalist.org/forums/help#adviceextras #4.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #4
        After I code misstable, the out put is:
        Obs<.
        +------------------------------
        | | Unique
        Variable | Obs=. Obs> Obs<. | values Min Max
        -------------+--------------------------------+------------------------------
        lngdp | 12 298 | 298 28.65553 36.83688
        fin | 265 45 | 45 4.00e+12 9.27e+15
        pri | 70 240 | 240 1.20e+11 9.70e+15
        gov | 39 271 | 271 1.24e+12 9.93e+15
        gni | 6 304 | 282 430 90320
        saving | 57 253 | 253 2.85e+12 9.68e+15
        money | 129 181 | 181 1.50e+12 8.88e+15
        -----------------------------------------------------------------------------
        For the second question, I simply mean that what are the next steps after fixing the autocorrelation. And thank you for the heads-up Carlo, I have read the FAQ and I promised this will be the first and the last time.

        Comment


        • #5
          It's over to you really. Why do the missings occur? A fairly good reason might be that some values are given once for a group of observations and need to be spread to other observations. There are many possible bad reasons.

          PS For some variables the values appear to go up to quadrillions. Is that right?
          Last edited by Nick Cox; 07 Oct 2021, 06:16.

          Comment


          • #6
            Claire:
            fixing autocorrelation (and/or heteroskedasticity) does not cover all the possibe drawbacks: I would be much more concerned about model misspecifiction (and endogeneity as a nasty way mispsecification can creep up).
            Again, you do not seem to report what kind of panel dataset you're actually dealing with (and this limits your chances of getting helpful replies).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Not to pile on here, but the column obs = . means how many observations have missing data in the variable. Stata will delete all observations with any missing data. Actually, it’s not just Stata - all software will do that. . means that the variable is numeric and that it has a missing value. obs < . basically means not missing (internally, Stata thinks that . is the largest possible number).

              Before you even decide what regression to run, you need to think if there were any errors in generating the dataset.
              Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

              When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

              Comment

              Working...
              X