Announcement

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

  • why is Panel data shows 'no observations'

    Hi, everyone, I'm trying to use Panel data to find the relationship for my variables. However, it cannot run, shows ​​​​​​'​no observations r(2000)', there are some Screen shots. Please help me. Thanks.
    Click image for larger version

Name:	Screen Shot 2017-09-09 at 6.10.08 pm.png
Views:	1
Size:	28.8 KB
ID:	1409789

    Click image for larger version

Name:	Screen Shot 2017-09-09 at 6.23.03 pm.png
Views:	1
Size:	545.0 KB
ID:	1409796



    Click image for larger version

Name:	Screen Shot 2017-09-09 at 6.14.12 pm.png
Views:	1
Size:	138.9 KB
ID:	1409790







    Also, I have more countries's data, but if I put them all together, they will show:
    Click image for larger version

Name:	Screen Shot 2017-09-09 at 6.17.20 pm.png
Views:	1
Size:	19.7 KB
ID:	1409795



    But there is no problem with the data.
    Click image for larger version

Name:	Screen Shot 2017-09-09 at 6.17.26 pm.png
Views:	1
Size:	101.1 KB
ID:	1409793


    Last edited by julie stuarly; 09 Sep 2017, 11:24.

  • #2
    Julie:
    your problem seems related to missing values.
    Each observation with at least one missing value in any variable (dependent and/or independent) is ruled out by Stata from the sample you're going to analyze (listwise deletion).
    From the screenshots you posted (please note that sharing screenshots is greatly discouraged on this forum. For the future follow the FAQ about how to post what you typed and what Stata gave you back. Thanks), you have several missing values in -FEMT- (and somewhere else, too: see: -MARKET_CAP-; -REER-).
    You can have the exact picture of what's going on with your missing data by simply typing:
    Code:
    misstable summarize
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      k
      Last edited by julie stuarly; 09 Sep 2017, 12:19.

      Comment


      • #4
        Originally posted by Carlo Lazzaro View Post
        Julie:
        your problem seems related to missing values.
        Each observation with at least one missing value in any variable (dependent and/or independent) is ruled out by Stata from the sample you're going to analyze (listwise deletion).
        From the screenshots you posted (please note that sharing screenshots is greatly discouraged on this forum. For the future follow the FAQ about how to post what you typed and what Stata gave you back. Thanks), you have several missing values in -FEMT- (and somewhere else, too: see: -MARKET_CAP-; -REER-).
        You can have the exact picture of what's going on with your missing data by simply typing:
        Code:
        misstable summarize
        Hi, Carlo, thanks for quick reply. I only have two missing varible, even I exculed these two, I still cannot run the panel data.

        Click image for larger version

Name:	Screen Shot 2017-09-09 at 6.52.39 pm.png
Views:	1
Size:	63.0 KB
ID:	1409812

        Comment


        • #5
          Welcome to Statalist, Julie.

          The initial "no observations" message is because, while you have used xtset State Year to declare your data to be panel data, you have observations for only one value of State, and the panel data commands requires at least two panel.

          As to why you are not able to xtset countrynme Year, Stata is telling you that for some value of countryname, the same value of Year appears more than once. I agree that the various summarize reports you show suggest that you have 37 values of Year and 5 values of countryname, but perhaps for one of your countries there is a mistake in your data. The duplicates command can help you find erroneous data. In this case, confirm again that xtset countrynme Year fails, and then try duplicates list countrynme Year to get a list of observations with duplicated values of countryname and Year.

          And as Marco suggested, p
          lease review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post, looking especially at sections 9-12 on how to best pose your question. In particular, please use CODE delimiters when posting to Statalist, rather than screen shots, so for example the following:

          [code]
          . sysuse auto, clear
          (1978 Automobile Data)

          . describe make price

          storage display value
          variable name type format label variable label
          -----------------------------------------------------------------
          make str18 %-18s Make and Model
          price int %8.0gc Price
          [/code]

          will be presented in the post as the following:
          Code:
          . sysuse auto, clear
          (1978 Automobile Data)
          
          . describe make price
          
                        storage   display    value
          variable name   type    format     label      variable label
          -----------------------------------------------------------------
          make            str18   %-18s                 Make and Model
          price           int     %8.0gc                Price

          Comment


          • #6
            Julie:
            you obviously refer to your second screenshot.
            Including -string- variable(s) in your regression equation caused you troubles, as you can see from the following trivial example:
            Code:
            . sysuse auto.dta
            (1978 Automobile Data)
            
            . regress price make
            no observations
            r(2000);
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment


            • #7
              Try to fix the repeated time values within panel first.
              xtset id year
              repeated time values within panel r(451);
              Solution:

              duplicates report id year
              duplicates list id year
              duplicates tag id year, gen(isdup)
              edit if isdup
              drop isdup
              enjoy!
              Last edited by Ammari Aymen; 23 Mar 2020, 14:35.

              Comment

              Working...
              X