Announcement

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

  • Panel Data - within estimator with year dummies- what is being controlled?

    if you use within estimator and year dummies to control for unobserved entity and time fixed effects, and there are other time-variant variables you are worried about causing omitted variable bias that you have data for, should you include these in your regression, or do you not have to worry about them because you have controlled for entity and time fixed effects? ie. are the year dummies accounting solely for unobserved time-variant effects so that I would need to add other variables into my regression that I have data for if i am worried about them causing omitted variables bias - so that both observable and unobservable time-variant effects are accounted for?

    see when I try to include another independent variable which I believe could be a source of omitted variables bias to my regression that already controls for time and entity fixed effects , stata removes two of my year dummies due to colinearity. I am not sure why this is.
    Last edited by sladmin; 04 Apr 2022, 08:09. Reason: anonymize original poster

  • #2
    Guest:
    two comments about your query:
    1) please share what you typed and what Stata gave you back (as per FAQ). This is much more informative that describing what you came across with tons of words (which are not good proxies for numbers, unfortunately). Thanks.
    2) it's again a collinearity issue (with one of -i-year- or with the -fe-).
    Last edited by sladmin; 04 Apr 2022, 08:09. Reason: anonymize original poster
    Kind regards,
    Carlo
    (StataNow 18.5)

    Comment


    • #3
      Dear expert (stata),

      Empirical Requirement
      :

      Using data set (echp99_00_01_new.dta), EUCHP, three years.....
      • Provide background information of the data (by describing and pointing out all the necessary features of the data)
      • Pooled OLS
      • Fixed and random effect models (test for the appropriate model)
      • Panel IV estimations
      • Dynamic panel models
      I created "assignment dofile"


      I declared panel setup (xtset country year), results (repeated time values within panel)

      I declared panel setup (xtset ) results, panel variable: pid (unbalanced)

      describe (des)....results

      storage display value
      variable name type format label variable label
      --------------------------------------------------------------------------------
      country float %8.0g
      hid long %12.0g
      hg015 str4 %4s
      hd001 byte %8.0g
      year float %tq
      wave byte %8.0g
      pid double %10.0g
      pg001 long %12.0g
      pg002 float %9.0g
      pg003 float %9.0g
      pg004 int %8.0g
      pg005 byte %8.0g
      pg006 byte %8.0g
      pg007 int %8.0g
      pg008 byte %8.0g

      to proceed i guess i must declare a panel setup to get the other requirements fullfiled....

      I leant to use "xtset to declare panel set up. Why am I not abel to in this regard when I tried (xtsetdescribe)?
      results: "command xtsetdescribe is unrecognized".


      Thanks
      Khalid



      Comment


      • #4
        Khalid:
        welcome to this forum.
        Some comments about your queries:
        1) please see the FAQ on how to post mor effectively (and avoid posting questions related to home/class assignements, if that were the case). Thanks.
        2) you provided a list of paneldata regression strategies that hardly live together. Therefore, I'm not clear with what you're after;
        3) yes, you have to -xtset- your dataset before any panel data regression;
        4) -xtsetdescribe- does not exists in Stata realm: that's why Stata complains about your attempt to call it. You were probably interested in -xtdescribe-:
        Code:
        . use "https://www.stata-press.com/data/r17/nlswork.dta"
        (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
        
        . xtdescribe
        
          idcode:  1, 2, ..., 5159                                   n =       4711
            year:  68, 69, ..., 88                                   T =         15
                   Delta(year) = 1 unit
                   Span(year)  = 21 periods
                   (idcode*year uniquely identifies each observation)
        
        Distribution of T_i:   min      5%     25%       50%       75%     95%     max
                                 1       1       3         5         9      13      15
        
             Freq.  Percent    Cum. |  Pattern
         ---------------------------+-----------------------
              136      2.89    2.89 |  1....................
              114      2.42    5.31 |  ....................1
               89      1.89    7.20 |  .................1.11
               87      1.85    9.04 |  ...................11
               86      1.83   10.87 |  111111.1.11.1.11.1.11
               61      1.29   12.16 |  ..............11.1.11
               56      1.19   13.35 |  11...................
               54      1.15   14.50 |  ...............1.1.11
               54      1.15   15.64 |  .......1.11.1.11.1.11
             3974     84.36  100.00 | (other patterns)
         ---------------------------+-----------------------
             4711    100.00         |  XXXXXX.X.XX.X.XX.X.XX
        
        .
        Kind regards,
        Carlo
        (StataNow 18.5)

        Comment


        • #5
          I use stata 16.0

          Comment


          • #6
            Sir, Carlo Lazzaro
            Your queries were spot on all issues.....As to home/Class activity? you re right.. I study on line for this course. Am allowed to research more... And I am grateful I have chanced this platform. You got me on this...Thanks so much...

            Comment


            • #7
              Khalid:
              thanks for clarify.
              While FAQ are clear about home/class assignments policy (please, see https://www.statalist.org/forums/help#adviceextras #4), those who are (really) challenging themselves with Stata codes and statistics related questions can post their doubts/problems here.
              The main reason of the FAQ aimed at descouraging both posting and replying to home/class assignments is based on two pillars:
              1) an ethical statement (along the very same spirit followed by academic institutions; no cheat-sheets or similar);
              2) the trivial consideration that students pay (often really high) academic tuitions. Therefore, it should be teacher's business/job to give them enough knowledge to face with confidence the assignments she/he gives (obviously this second point assumes that students are more interested in learning.than in passing the terms).
              As an aside, please call me Carlo, like all on (and many more off) this forum do. Thanks.
              Kind regards,
              Carlo
              (StataNow 18.5)

              Comment


              • #8
                Dear all,

                Data from a household surveyed in 14 countries. Using stata 16.0. I wish to run a pooled OLS, fe, re, panel IV ........I guess with these i would be using a robust standard on the OLS, since my data is isn't balanced, in the data set on editor shows 2 empty columns. I set the panel data by using xtset vars.....individually, year, country, hid are all unbalnced. Using country and year reports shows below. trying to examine the datas using "xtdescribe" the output isn't friendly either. Please, carlos et al, I need your help.

                Code:
                 xtset country
                       panel variable:  country (unbalanced)
                
                . 
                end of do-file
                
                . do "C:\Users\Ruhia\AppData\Local\Temp\STDf9c_000000.tmp"
                
                . xtset country year
                repeated time values within panel
                r(451);
                
                end of do-file
                
                r(451);
                
                . do "C:\Users\Ruhia\AppData\Local\Temp\STDf9c_000000.tmp"
                
                . xtdescribe
                must specify timevar; use xtset
                details (Dataset):

                Code:
                 des
                
                Contains data from echp99_00_01_new.dta
                  obs:       269,423                          
                 vars:           267                          28 Feb 2013 13:24
                --------------------------------------------------------------------------------
                              storage   display    value
                variable name   type    format     label      variable label
                --------------------------------------------------------------------------------
                country         float   %8.0g                 
                hid             long    %12.0g                
                hg015           str4    %4s                   
                hd001           byte    %8.0g                 
                year            float   %9.0g                 
                wave            byte    %8.0g                 
                pid             double  %10.0g                
                pg001           long    %12.0g                
                pg002           float   %9.0g                 
                pg003           float   %9.0g                 
                pg004           int     %8.0g                 
                pg005           byte    %8.0g                 
                pg006           byte    %8.0g                 
                pg007           int     %8.0g                 
                pg008           byte    %8.0g                 
                pd001           int     %8.0g                 
                pd002           byte    %8.0g                 
                pd003           byte    %8.0g                 
                pd004           byte    %8.0g                 
                pd005           byte    %8.0g                 
                pd006           int     %8.0g                 
                pd007           byte    %8.0g                 
                pd008           byte    %8.0g                 
                pe001           byte    %8.0g                 
                pe001a          byte    %8.0g                 
                pe002           byte    %8.0g                 
                pe002a          byte    %8.0g                 
                pe003           byte    %8.0g                 
                pe004           byte    %8.0g                 
                pe005           byte    %8.0g                 
                pe005a          byte    %8.0g                 
                pe005b          byte    %8.0g                 
                pe005c          byte    %8.0g                 
                pe006a          int     %8.0g                 
                pe006b          int     %8.0g                 
                pe006c          byte    %8.0g                 
                pe007a          str5    %5s                   
                pe007b          str5    %5s                   
                pe007c          byte    %8.0g                 
                pe008           byte    %8.0g                 
                pe009           byte    %8.0g                 
                pe010           byte    %8.0g                 
                pe011           int     %8.0g                 
                pe012           byte    %8.0g                 
                pe013           byte    %8.0g                 
                pe014           byte    %8.0g                 
                pe015           int     %8.0g                 
                pe016           byte    %8.0g                 
                pe017           byte    %8.0g                 
                pe018           byte    %8.0g                 
                pe019           byte    %8.0g                 
                pe020           byte    %8.0g                 
                pe021           byte    %8.0g                 
                pe022           byte    %8.0g                 
                pe023           byte    %8.0g                 
                pe024           byte    %8.0g                 
                pe025           byte    %8.0g                 
                pe026           byte    %8.0g                 
                pe027           byte    %8.0g                 
                pe028           byte    %8.0g                 
                pe029           byte    %8.0g                 
                pe030           byte    %8.0g                 
                pe031           byte    %8.0g                 
                pe032           byte    %8.0g                 
                pe033           byte    %8.0g                 
                pe034           byte    %8.0g                 
                pe035           byte    %8.0g                 
                pe036           byte    %8.0g                 
                pe037           byte    %8.0g                 
                pe038           byte    %8.0g                 
                pe039           byte    %8.0g                 
                pu001           byte    %8.0g                 
                pu002           byte    %8.0g                 
                pu002a          byte    %8.0g                 
                pu003           byte    %8.0g                 
                pu003a          byte    %8.0g                 
                pu004           byte    %8.0g                 
                pu004a          byte    %8.0g                 
                ps001           byte    %8.0g                 
                ps001a          byte    %8.0g                 
                ps002           byte    %8.0g                 
                ps003           byte    %8.0g                 
                ps004           byte    %8.0g                 
                ps005           byte    %8.0g                 
                ps006           byte    %8.0g                 
                ps007           long    %12.0g                
                ps008           byte    %8.0g                 
                ps009           byte    %8.0g                 
                ps010           byte    %8.0g                 
                ps011           byte    %8.0g                 
                ps012           byte    %8.0g                 
                ps013           byte    %8.0g                 
                ps014           byte    %8.0g                 
                ps015           byte    %8.0g                 
                pj001           byte    %8.0g                 
                pj002           int     %8.0g                 
                pj003           byte    %8.0g                 
                pj004           byte    %8.0g                 
                pj005           byte    %8.0g                 
                pj006           byte    %8.0g                 
                pj007a          int     %8.0g                 
                pj007b          int     %8.0g                 
                pj007c          byte    %8.0g                 
                pj008a          str5    %5s                   
                pj008b          str5    %5s                   
                pj008c          byte    %8.0g                 
                pj009           byte    %8.0g                 
                pj010           byte    %8.0g                 
                pj011           byte    %8.0g                 
                pj012           byte    %8.0g                 
                pc001           byte    %8.0g                 
                pc002           byte    %8.0g                 
                pc003           byte    %8.0g                 
                pc004           byte    %8.0g                 
                pc005           byte    %8.0g                 
                pc006           byte    %8.0g                 
                pc007           byte    %8.0g                 
                pc008           byte    %8.0g                 
                pc009           byte    %8.0g                 
                pc010           byte    %8.0g                 
                pc011           byte    %8.0g                 
                pc012           byte    %8.0g                 
                pc013           byte    %8.0g                 
                pi001           byte    %8.0g                 
                pi100           long    %12.0g                
                pi110           long    %12.0g                
                pi111           long    %12.0g                
                pi1111          long    %12.0g                
                pi1112          long    %12.0g                
                pi112           long    %12.0g                
                pi120           long    %12.0g                
                pi121           long    %12.0g                
                pi122a          long    %12.0g                
                pi123           long    %12.0g                
                pi130           long    %12.0g                
                pi131           long    %12.0g                
                pi132           long    %12.0g                
                pi1321          long    %12.0g                
                pi1322          long    %12.0g                
                pi133           long    %12.0g                
                pi134           long    %12.0g                
                pi135           long    %12.0g                
                pi136           long    %12.0g                
                pi137a          long    %12.0g                
                pi138a          long    %12.0g                
                pi211m          long    %12.0g                
                pi211mg         long    %12.0g                
                pt001           byte    %8.0g                 
                pt002           byte    %8.0g                 
                pt003           int     %8.0g                 
                pt004           byte    %8.0g                 
                pt005           int     %8.0g                 
                pt006           byte    %8.0g                 
                pt007           byte    %8.0g                 
                pt007a          byte    %8.0g                 
                pt008           int     %8.0g                 
                pt009           byte    %8.0g                 
                pt010           int     %8.0g                 
                pt011           byte    %8.0g                 
                pt012           byte    %8.0g                 
                pt013           byte    %8.0g                 
                pt014           byte    %8.0g                 
                pt015           byte    %8.0g                 
                pt016           byte    %8.0g                 
                pt017           byte    %8.0g                 
                pt018           byte    %8.0g                 
                pt019           byte    %8.0g                 
                pt020           byte    %8.0g                 
                pt021           byte    %8.0g                 
                pt022           byte    %8.0g                 
                pt023           byte    %8.0g                 
                pt024           byte    %8.0g                 
                pt025           byte    %8.0g                 
                pt026           byte    %8.0g                 
                pt027           byte    %8.0g                 
                pt028           byte    %8.0g                 
                pt029           byte    %8.0g                 
                pt030           byte    %8.0g                 
                pt031           byte    %8.0g                 
                ph001           byte    %8.0g                 
                ph002           byte    %8.0g                 
                ph003           byte    %8.0g                 
                ph003a          byte    %8.0g                 
                ph004           byte    %8.0g                 
                ph005           byte    %8.0g                 
                ph006           byte    %8.0g                 
                ph007           int     %8.0g                 
                ph008           byte    %8.0g                 
                ph009           byte    %8.0g                 
                ph010           byte    %8.0g                 
                ph011           byte    %8.0g                 
                ph012           byte    %8.0g                 
                ph013           byte    %8.0g                 
                ph014           byte    %8.0g                 
                ph015           long    %12.0g                
                ph016           byte    %8.0g                 
                ph017           byte    %8.0g                 
                ph018           byte    %8.0g                 
                ph019           byte    %8.0g                 
                ph020           int     %8.0g                 
                ph021           int     %8.0g                 
                ph022           float   %8.0g                 
                pr001           byte    %8.0g                 
                pr002           byte    %8.0g                 
                pr003           byte    %8.0g                 
                pr004           byte    %8.0g                 
                pr005           byte    %8.0g                 
                pr006           byte    %8.0g                 
                pr007           byte    %8.0g                 
                pr007a          byte    %8.0g                 
                pr008           byte    %8.0g                 
                pr008a          byte    %8.0g                 
                pr009           byte    %8.0g                 
                pr010           byte    %8.0g                 
                pm001           byte    %8.0g                 
                pm003           int     %8.0g                 
                pm005a          int     %8.0g                 
                pm005b          int     %8.0g                 
                pm005c          byte    %8.0g                 
                pm006           int     %8.0g                 
                pm007a          int     %8.0g                 
                pm007b          int     %8.0g                 
                pm007c          byte    %8.0g                 
                pm008           byte    %8.0g                 
                pm010           byte    %8.0g                 
                pm011           byte    %8.0g                 
                pk001           byte    %8.0g                 
                pk002           byte    %8.0g                 
                pk003           byte    %8.0g                 
                pk004           byte    %8.0g                 
                nchild0_2       float   %9.0g                 (mean) nchild0_2
                nchild3_5       float   %9.0g                 (mean) nchild3_5
                nchild6_8       float   %9.0g                 (mean) nchild6_8
                nchild9_11      float   %9.0g                 (mean) nchild9_11
                nchild12_14     float   %9.0g                 (mean) nchild12_14
                nchild15_17     float   %9.0g                 (mean) nchild15_17
                _merge          byte    %8.0g                 
                age             float   %9.0g                 
                age2            float   %9.0g                 
                female          float   %9.0g                 
                school          float   %21.0g     livello    highest educ degree
                tertiary        float   %9.0g                 tertiary
                high_sec        float   %9.0g                 high secondary
                low_sec         float   %9.0g                 low secondary or less
                partime         float   %9.0g                 
                weekhours       float   %9.0g                 weekly hours
                blue_serv       float   %9.0g                 blue&serv work
                clerk           float   %9.0g                 clerks
                prof_teach      float   %9.0g                 teach&profess
                manag           float   %9.0g                 managers
                occup           float   %14.0g     occ        occupation
                sect            float   %9.0g      pippo      sector
                industry        float   %9.0g                 
                service         float   %9.0g                 
                serv2           float   %18.0g     kind       kind of service
                oth_serv        float   %9.0g                 other services
                trasp_comm      float   %9.0g                 transport&communic
                pa_ss           float   %9.0g                 pub admin&social sec
                educ            float   %9.0g                 education
                health          float   %9.0g                 health
                soc_serv        float   %9.0g                 person&socil serv
                min_elect       float   %9.0g                 mining,electr,gas&water
                pub             float   %9.0g      yesno      public sector
                temporary       float   %9.0g                 with a temporary or fixed term
                                                                contract
                wage            float   %9.0g                 
                hwage           float   %9.0g                 
                lnhwage         float   %9.0g                 
                --------------------------------------------------------------------------------
                Sorted by: country  year
                Hope this meet your kind consideration for a response.

                Khalid
                learner

                Comment


                • #9
                  Khalid:
                  the only decent advice that I can provide you with is studying the -XT- section of the Stata .pdf manual and consult one of the many herein recommended textbook on panel data econometrics. You cannot go any far without understanding what Stata codes are doing.
                  Kind regards,
                  Carlo
                  (StataNow 18.5)

                  Comment


                  • #10
                    Dear carlos,

                    Thanks a lot for the response... I am doing my best to reach to that fieet in a short moment. I have taking the advice seriously to study XT sections of the reccommended books on econometrics. However, permit me to still ask if i have to do some changes on the data set i have provided to enabel the use of xtdescribe?

                    Comment


                    • #11
                      Khalid:
                      1) my first source of coencern is the list of possible regression that you want to run (pooled OLS, fe, re, panel IV). They are all different in many respects and, at the top of that, IV (instrumental variable) regression is useful if you have endogeneity or, put differently, is not performed as a routinary regression;
                      2) you mention "robust standard of the OLS": I'm totally unclear with what you mean by that. Do you mean that you want perform (pooled) OLS first (BTW: not a good idea with panel data) and then check your results with -fe- and -re- estimators? In addition: robustness wity respect to what?
                      3) Stata threw the -repeated time values- error message. In order to fix this issue, you can simply -xtset- your data with -panelid- only, being alerted that this fix comes at the cost of making -xtdescribe- and time-series operators unavailable;
                      4) you listed tons of variables that are meaningless for those who (like me) do nit have a rough idea of your dataset.
                      Kind regards,
                      Carlo
                      (StataNow 18.5)

                      Comment


                      • #12
                        Dear Carlos,

                        Thanks once again for the response. As to the list on posible regression? Very much so, the OLS is assumed not to be best estimator in panel analyses, hence, using the robust standard can correct any disturbance, That is my understanding though!

                        And this statement? "Do you mean that you want perform (pooled) OLS first (BTW: not a good idea with panel data) and then check your results with -fe- and -re- estimators in addition? YES!!

                        The format of the data is what i showed. in the list. However, the data set are dummy variables......,1, 2 and 3 (country), 1999, 2000 and 2001 (year) respectively. and the waves are 6, 7, and 8....... etc....

                        The (3) number statement makes the point...and the rest of the statements improves my understanding of econometrics....I am grateful...if there is any more points to add please do not hesitate to throw more linght....



                        khalid
                        learner
                        Last edited by Khalid Atinoaga Compaore; 09 Apr 2022, 10:20.

                        Comment


                        • #13
                          Khalid:
                          1) while t's true that (pooled) OLS is not the first choice tool when it comes to pane data analysis, it is far from truth that robust standard errors can change the situation (as, under -regress-, they simply take heteroskedasticity into account and nothing more);
                          2) I would deeply change my preference rank and start with -xtreg-; pooled OLS is the way to go when there's no evidence of a panel-wise effect;
                          3) -xtset panelid- (without -timevar-, as replied before) is the way to go here. As far as the variables that should be included in the model, you're the only one who knows what to do;
                          Kind regards,
                          Carlo
                          (StataNow 18.5)

                          Comment


                          • #14
                            Dear Carlos,

                            Insightful....really grateful. Very helpful....................Accommodate more with time. Thanks

                            Khalid
                            Best of moments.

                            Comment


                            • #15
                              Code:
                               xtabond $ylist $xlist
                              must specify timevar; use xtset
                              Meanwhile i have xtset my panel.....
                              Code:
                              xtset $c_id $year
                                     panel variable:  country (unbalanced)
                              I need help please,....I have run regressions, and wish to test using the arollano bond test.....
                              Code:
                              xtabond $ylist $xlist, noconstant
                              must specify timevar; use xtset
                              Khalid
                              Last edited by Khalid Atinoaga Compaore; 28 Apr 2022, 11:21.

                              Comment

                              Working...
                              X