Announcement

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

  • fixed effect in panel data

    Hello everyone,
    I am asking for your help in interpreting my results. I am currently using a panel dataset wherein I am testing the time invariant effect on our DEPENDENT variable Scorex from the INDEPENDENT variable which i categorized into three parts - teacher qualification , school infrastructure and student enrolment and we have a total of 332 observations spread across a 10 year period (2013-2022). Our preferred method was to use a Fixed Effects model(i.year, fe) given. I am unsure about our initial results as my independent variable came out insignificant and and variables shows multicollinearity . All the other variables like enrolments did come out insignificant.

    I will be attaching my dataset for more clear understanding, and the test i performed is written below here ,its regression and after (i.year) fe results here for your reference in seeing the format of my data what i can improve and please also guide me that after this i perform IV or GMM estimator. I will also include my do file to show the commands which I tried executing.

    I thank you in advance.
    summarize

    Variable | Obs Mean Std. dev. Min Max
    -------------+---------------------------------------------------------
    region | 0
    school_cat~y | 0
    year | 332 2017.476 2.905775 2013 2022
    scoreX | 332 85.31801 12.66463 28.26 100
    SeparateRo~r | 332 29.20482 29.40631 0 113
    -------------+---------------------------------------------------------
    LandAvaila~e | 332 11.51506 12.70023 0 43
    Electricity | 332 29.74096 29.71495 1 115
    Functio~city | 332 29.73193 29.70993 1 115
    SolarPanel | 332 2.76506 6.8271 0 47
    Playground | 332 27.44277 28.80248 0 110
    -------------+---------------------------------------------------------
    LibraryorR~o | 332 29.47289 29.4748 1 115
    Librarian | 332 24.04819 25.37651 0 113
    Newspaper | 332 27.93072 28.2311 0 114
    KitchenGar~n | 332 2.433735 7.649328 0 69
    Furniture | 332 29.73494 29.71794 1 115
    -------------+---------------------------------------------------------
    BoysToilet | 332 21.46988 22.5748 0 95
    Fun~ysToilet | 332 21.46988 22.5748 0 95
    GirlsToilet | 332 18.81928 18.87382 0 84
    Fun~lsToilet | 332 18.81928 18.87382 0 84
    ToiletFaci~y | 332 29.74096 29.71495 1 115
    -------------+---------------------------------------------------------
    Functio~lity | 332 29.74096 29.71495 1 115
    Functiona~ys | 332 8.801205 18.57433 0 95
    Functiona~ls | 332 7.722892 15.88445 0 84
    Func~lUrinal | 332 12.17169 24.81942 0 115
    Func~dUrinal | 332 12.17169 24.81942 0 115
    -------------+---------------------------------------------------------
    DrinkingWa~r | 332 21.09036 29.10971 0 115
    Functional~r | 332 29.74096 29.71495 1 115
    WaterPurif~r | 332 14.75602 26.19663 0 113
    RainWaterH~g | 332 20.75301 23.97164 0 110
    WaterTested | 332 9.906627 20.91936 0 113
    -------------+---------------------------------------------------------
    Handwash | 332 29.5241 29.55076 0 115
    Incinerator | 332 4.355422 9.497982 0 61
    WASHFacili~o | 332 21.05422 29.06597 0 115
    Ramps | 332 28.65361 28.9154 0 115
    HandRails | 332 27.06024 28.03196 0 115
    -------------+---------------------------------------------------------
    MedicalChe~p | 332 17.5 18.5522 0 79
    CompleteMe~p | 332 6.957831 13.37755 0 65
    Internet | 332 29.01807 29.0523 0 115
    ComputerAv~e | 332 25.43675 27.04141 0 115
    Teache~F_Gra | 332 72.72289 88.11522 0 467
    -------------+---------------------------------------------------------
    Teache~M_Gra | 332 56.34639 72.25733 0 348
    Teacher_Gra | 332 129.0693 153.4517 0 697
    Teac~F_HiSec | 332 1.153614 5.013325 0 72
    Teac~M_HiSec | 332 .9638554 2.500493 0 27
    Teacher_Hi~c | 332 2.11747 6.766368 0 83
    -------------+---------------------------------------------------------
    Teacher_F_~l | 332 7.614458 10.45905 0 74
    Teacher_M_~l | 332 5.990964 8.663388 0 71
    Teacher_MP~l | 332 13.60542 17.62562 0 109
    Teacher_F_~D | 332 1.533133 2.31156 0 12
    Teacher_M_~D | 332 2.25 2.896112 0 14
    -------------+---------------------------------------------------------
    Teacher_PhD | 332 3.783133 4.768472 0 21
    Teacher_F~oc | 332 .0783133 .2690694 0 1
    Teacher_M~oc | 332 .0722892 .259357 0 1
    Teacher_Po~c | 332 .1506024 .3582008 0 1
    Teac~F_PoGra | 332 164.997 190.1061 0 876
    -------------+---------------------------------------------------------
    Teac~M_PoGra | 332 126.3133 149.8497 0 762
    Teacher_Po~a | 332 291.3102 318.9002 0 1273
    Teache~F_Sec | 332 .4698795 1.246989 0 10
    Teache~M_Sec | 332 .6596386 1.537585 0 12
    Teacher_Sec | 332 1.129518 2.335481 0 13
    -------------+---------------------------------------------------------
    Girls_IX | 332 4064.055 4670.614 0 19533
    Boys_IX | 332 3990.682 4835.612 0 19880
    Total_IX | 332 8054.736 9142.544 17 32362
    Girls_X | 332 2634 3005.819 0 13653
    Boys_X | 332 2396.9 2989.397 0 14000
    -------------+---------------------------------------------------------
    Total_X | 332 5030.9 5754.561 0 23341
    _merge | 332 2.987952 .1549954 1 3
    group | 332 18.56024 10.89136 1 38
    regress scoreX Boys_IX Boys_X Teacher_MPhil Furniture LandAvailable Newspaper R
    > ainWaterHarvesting WASHFacilityDrinkingWaterTo Internet ComputerAvailable Elec
    > tricity Playground LibraryorReadingCornerorBoo ToiletFacility MedicalCheckup Te
    > acher_PhD Girls_X Girls_IX
    note: ToiletFacility omitted because of collinearity.

    Source | SS df MS Number of obs = 332
    -------------+---------------------------------- F(17, 314) = 2.68
    Model | 6736.59541 17 396.270318 Prob > F = 0.0004
    Residual | 46353.4737 314 147.622528 R-squared = 0.1269
    -------------+---------------------------------- Adj R-squared = 0.0796
    Total | 53090.0691 331 160.392958 Root MSE = 12.15

    --------------------------------------------------------------------------------
    scoreX | Coefficient Std. err. t P>|t| [95% conf. interval]
    ---------------+----------------------------------------------------------------
    Boys_IX | -.0009618 .0009286 -1.04 0.301 -.0027888 .0008652
    Boys_X | .0013494 .0014304 0.94 0.346 -.0014651 .0041638
    Teacher_MPhil | -.0471119 .1210653 -0.39 0.697 -.2853137 .1910898
    Furniture | 39.09346 8.697975 4.49 0.000 21.97978 56.20714
    LandAvailable | .0871802 .2312804 0.38 0.706 -.3678749 .5422354
    Newspaper | .9072908 .4025813 2.25 0.025 .1151928 1.699389
    RainWaterHar~g | .1365526 .1063353 1.28 0.200 -.0726673 .3457724
    WASHFacility~o | .0458839 .0885049 0.52 0.605 -.1282537 .2200216
    Internet | -.8350966 .6505569 -1.28 0.200 -2.115098 .4449051
    ComputerAvai~e | -.3847039 .219117 -1.76 0.080 -.8158269 .0464192
    Electricity | -36.73764 8.843299 -4.15 0.000 -54.13726 -19.33803
    Playground | .1230561 .3249233 0.38 0.705 -.516246 .7623582
    LibraryorRea~o | -2.441607 1.319952 -1.85 0.065 -5.038675 .1554618
    ToiletFacility | 0 (omitted)
    MedicalCheckup | .1563752 .1510081 1.04 0.301 -.1407406 .4534909
    Teacher_PhD | -.0296182 .2866949 -0.10 0.918 -.593704 .5344677
    Girls_X | -.0003302 .0014261 -0.23 0.817 -.0031362 .0024758
    Girls_IX | .0005463 .000964 0.57 0.571 -.0013503 .002443
    _cons | 85.21689 1.055762 80.72 0.000 83.13963 87.29415
    --------------------------------------------------------------------------------

    . xtreg scoreX Boys_IX Boys_X Teacher_MPhil Furniture LandAvailable Newspaper Rai
    > nWaterHarvesting WASHFacilityDrinkingWaterTo Internet ComputerAvailable Electr
    > icity Playground LibraryorReadingCornerorBoo ToiletFacility MedicalCheckup Teac
    > her_PhD Girls_X Girls_IX i.year, fe
    note: ToiletFacility omitted because of collinearity.

    Fixed-effects (within) regression Number of obs = 332
    Group variable: group Number of groups = 38

    R-squared: Obs per group:
    Within = 0.3906 min = 3
    Between = 0.0062 avg = 8.7
    Overall = 0.2531 max = 10

    F(26, 268) = 6.61
    corr(u_i, Xb) = -0.1500 Prob > F = 0.0000

    --------------------------------------------------------------------------------
    scoreX | Coefficient Std. err. t P>|t| [95% conf. interval]
    ---------------+----------------------------------------------------------------
    Boys_IX | .0003876 .0011136 0.35 0.728 -.0018049 .00258
    Boys_X | .0002177 .0014349 0.15 0.880 -.0026074 .0030427
    Teacher_MPhil | -.0764411 .1245335 -0.61 0.540 -.3216296 .1687474
    Furniture | 26.74934 7.501408 3.57 0.000 11.98016 41.51853
    LandAvailable | -.1785086 .2652024 -0.67 0.501 -.7006536 .3436364
    Newspaper | .4997273 .4591983 1.09 0.277 -.4043677 1.403822
    RainWaterHar~g | .061257 .1186576 0.52 0.606 -.1723626 .2948765
    WASHFacility~o | -.0252245 .0906026 -0.28 0.781 -.2036079 .1531589
    Internet | -.3966404 .6132809 -0.65 0.518 -1.604102 .8108208
    ComputerAvai~e | -.0075351 .2195584 -0.03 0.973 -.4398138 .4247436
    Electricity | -25.66024 7.615206 -3.37 0.001 -40.65348 -10.667
    Playground | -.2996727 .4243963 -0.71 0.481 -1.135248 .5359022
    LibraryorRea~o | -.7769342 1.243039 -0.63 0.532 -3.224297 1.670429
    ToiletFacility | 0 (omitted)
    MedicalCheckup | .0887714 .1508031 0.59 0.557 -.2081382 .3856809
    Teacher_PhD | -.6393855 .3609008 -1.77 0.078 -1.349947 .0711759
    Girls_X | .0006092 .0015512 0.39 0.695 -.0024449 .0036632
    Girls_IX | -.0006778 .0011265 -0.60 0.548 -.0028957 .0015402
    |
    year |
    2014 | 2.029162 3.008666 0.67 0.501 -3.894466 7.95279
    2015 | 1.397446 3.023991 0.46 0.644 -4.556355 7.351247
    2016 | 1.45816 3.090388 0.47 0.637 -4.626366 7.542685
    2017 | 5.810476 2.905405 2.00 0.047 .0901533 11.5308
    2018 | -9.692334 3.175377 -3.05 0.002 -15.94419 -3.440476
    2019 | -7.394266 3.259548 -2.27 0.024 -13.81184 -.9766872
    2020 | .2079743 3.320268 0.06 0.950 -6.329153 6.745102
    2021 | 12.93491 3.220797 4.02 0.000 6.593631 19.2762
    2022 | -1.056892 3.419985 -0.31 0.758 -7.790346 5.676562
    |
    _cons | 83.4673 4.404457 18.95 0.000 74.79556 92.13904
    ---------------+----------------------------------------------------------------
    sigma_u | 7.2071026
    sigma_e | 9.5599876
    rho | .36238238 (fraction of variance due to u_i)
    --------------------------------------------------------------------------------
    F test that all u_i=0: F(37, 268) = 3.26 Prob > F = 0.0000


    Attached Files

  • #2
    Rupal:
    as per FAQ, ypou should use CODE delimiters to share what you typed and what Stata gave you back.
    In addition, some concerns may come with downloading other's attachments.
    With all that said:
    1) if I got you right, the -fe- estimator cannot give you back a coefficinet for a time-invariant predictor;
    2) with 38 panels, you should impose the cluster robust standard error via the -robust- or -vce(cluster panelid)- options;
    3) iv regress makes sense if you detect endogenety. Did you?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      yes sir, this is my endogenety test results. you mean to say, I should use XTREG Y X1 X2 i.year, fe vce (cluster) like that and yes did not give any time variant predictor.
      Attached Files

      Comment


      • #4
        Rupal:
        as per FAQ, you should use CODE delimiters to share what you typed and what Stata gave you back.
        In addition, some concerns may come with downloading other's attachments. Thanks.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5





          This is my result but would it be okay if , I take considering only statically significant variables. Thanks carlo. as you said rather using this I should use fe vce (cluster)?
          Attached Files

          Comment


          • #6
            This is my IV regression results.
            Attached Files

            Comment


            • #7
              Rupal:
              1) you should not focus on statistically significant predictors only;
              2) you should revise the specification of the right-hand side of your regression equation. You seem to have too many predictors;
              3) with 38 panels you should use cluster robust standard errors;
              4) after 2), double-check if the endogeneity issue still holds.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                This results came after using VCE(cluster group) but still one variable show collinearity. Is it normal or i should use only those predictors which has p value <0.05?
                Attached Files

                Comment


                • #9
                  This is my IV results, which shows that my model fit for it.
                  Attached Files

                  Comment


                  • #10
                    Rupal:
                    1) it is correct to go robust SE (eben though they do not seem to differ from their default counerparts);
                    2) why not using - xtivreg- with panel data?
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #11
                      I do not get it. As, I am still new to stata so i want to know again from you to guide me that for fixed effects fe vce(cluster group) and which iv test will be required or not for my results? As you said using xtivreg in testing for IV and in fixed effects too i applied with this command which i used and attached below and after that to check, it said not valid in command estat firststage.what would be me final approach or command in stata?

                      Comment


                      • #12
                        IV output with xtiverg
                        Attached Files

                        Comment


                        • #13
                          after this i tried IV with ivreg2 and i get this results. Now i am bit confused, Sir.
                          Attached Files

                          Comment


                          • #14
                            Dear rupal rana in posts #2 and #4 Carlo Lazzaro suggests writing your command here (on this platform) using the CODE delimiter- which means write your commands as-

                            [CODE] Write here your commands [/CODE - and close the second code with ]

                            your syntax from post #1 will look like:
                            Code:
                             xtreg scoreX Boys_IX Boys_X Teacher_MPhil Furniture LandAvailable Newspaper RainWaterHarvesting WASHFacilityDrinkingWaterTo Internet ComputerAvailable Electricity Playground LibraryorReadingCornerorBoo ToiletFacility MedicalCheckup Teacher_PhD Girls_X Girls_IX i.year, fe
                            In this way, your commands will be easily readable, and you can get proper feedback
                            Best regards,
                            Mukesh

                            Comment


                            • #15
                              Thank you, Mukesh. I was not aware of this function in stata but now I get it.

                              Comment

                              Working...
                              X