Dear all
I'm running a extended family fixed effects regression by manually de-meaning my variables with respect to extended family means. I'm doing a simple DoF adjustment to get the correct standard errors. When I do this, Stata returns the correct coefficients, SEs, t values but for some reason different p-values and I'm not sure why?
Also if anyone knows a command, similar to the -, dof() - command that allows you to input the correct degrees of freedom for calculating e.g. F statistic when clustering, or even a more parsimonious manual adjustment, I'd be very grateful to hear.
Many thanks
Owen
Below is my code and a sample of my dataset
I'm running a extended family fixed effects regression by manually de-meaning my variables with respect to extended family means. I'm doing a simple DoF adjustment to get the correct standard errors. When I do this, Stata returns the correct coefficients, SEs, t values but for some reason different p-values and I'm not sure why?
Also if anyone knows a command, similar to the -, dof() - command that allows you to input the correct degrees of freedom for calculating e.g. F statistic when clustering, or even a more parsimonious manual adjustment, I'd be very grateful to hear.
Many thanks
Owen
Below is my code and a sample of my dataset
Code:
*Running FE with extended family dummies reg chmarried6 chtotal6 childnum6 chage6 feduc i.efamid, cluster(nfamid) *Running FE with de-meaned variables reg d_chmarried6 d_chtotal6 d_childnum6 d_chage6 d_feduc, cluster(nfamid) *Adjusting DoF mat b = e(b) mat vbyhand = e(V) qui reg d_chmarried6 d_chtotal6 d_childnum6 d_chage6 d_feduc scalar dfrr = e(df_r) qui reg d_chmarried6 d_chtotal6 d_childnum6 d_chage6 d_feduc, cluster(efamid) scalar dfra = dfrr - e(N_clust)+1 mat vcorr = (dfrr/dfra)*vbyhand ereturn post b vcorr ereturn display
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input long efamid float(nfamid chmarried6 chtotal6) byte childnum6 float(chage6 feduc d_chmarried6 d_chtotal6 d_childnum6 d_chage6 d_feduc)
1200002 4 0 3 1 45 13 -.5 0 -1 3.5 0
1200002 4 . 3 2 42 13 . . . . .
1200002 4 1 3 3 38 13 .5 0 1 -3.5 0
1200004 7 1 2 1 42 20 0 0 -.5 2.5 0
1200004 7 1 2 2 37 20 0 0 .5 -2.5 0
1200005 8 1 2 1 49 14 .5 0 -.5 .5 0
1200005 8 0 2 2 48 14 -.5 0 .5 -.5 0
1200007 12 1 3 1 38 16 0 0 -.75 -4.25 -.75
1200007 12 . 3 2 35 16 . . . . .
1200007 12 1 3 3 . 16 . . . . .
1200007 13 1 3 1 46 17 0 0 -.75 3.75 .25
1200007 13 1 3 2 43 17 0 0 .25 .75 .25
1200007 13 1 3 3 42 17 0 0 1.25 -.25 .25
1200009 15 1 9 1 50 13 0 1.5 -3.25 3.583332 -.25
1200009 15 1 9 2 48 13 0 1.5 -2.25 1.583332 -.25
1200009 15 1 9 3 47 13 0 1.5 -1.25 .58333206 -.25
1200009 15 1 9 4 46 13 0 1.5 -.25 -.4166679 -.25
1200009 15 1 9 5 45 13 0 1.5 .75 -1.416668 -.25
1200009 15 1 9 6 44 13 0 1.5 1.75 -2.416668 -.25
1200009 15 1 9 7 44 13 0 1.5 2.75 -2.416668 -.25
1200009 15 1 9 8 41 13 0 1.5 3.75 -5.416668 -.25
1200009 15 1 9 9 33 13 0 1.5 4.75 -13.416668 -.25
1200009 16 1 3 1 60 14 0 -4.5 -3.25 13.583332 .75
1200009 16 1 3 2 53 14 0 -4.5 -2.25 6.583332 .75
1200009 16 1 3 3 46 14 0 -4.5 -1.25 -.4166679 .75
1200010 18 0 2 1 34 17 -.5 0 -.5 2 0
1200010 18 1 2 2 30 17 .5 0 .5 -2 0
1200011 19 1 2 1 45 12 0 0 -.5 1 0
1200011 19 1 2 2 43 12 0 0 .5 -1 0
1200012 21 1 4 1 47 12 .25 0 -1.5 3.75 0
1200012 21 1 4 2 45 12 .25 0 -.5 1.75 0
1200012 21 0 4 3 43 12 -.75 0 .5 -.25 0
1200012 21 1 4 4 38 12 .25 0 1.5 -5.25 0
1200013 23 0 3 1 44 17 -.6666667 0 -1 2 0
1200013 23 1 3 2 42 17 .3333333 0 0 0 0
1200013 23 1 3 3 40 17 .3333333 0 1 -2 0
1200015 28 0 2 1 42 12 0 0 -.5 1.5 0
1200015 28 0 2 2 39 12 0 0 .5 -1.5 0
1200016 29 1 3 1 52 13 .6666666 0 -1 2 0
1200016 29 0 3 2 50 13 -.3333333 0 0 0 0
1200016 29 0 3 3 48 13 -.3333333 0 1 -2 0
1200017 31 0 2 1 30 14 -.6 -.5999999 -.8 -8.200001 1.1999998
1200017 31 0 2 2 30 14 -.6 -.5999999 .20000005 -8.200001 1.1999998
1200017 32 1 3 1 48 12 .4 .4000001 -.8 9.799999 -.8000002
1200017 32 1 3 2 47 12 .4 .4000001 .20000005 8.799999 -.8000002
1200017 32 1 3 3 36 12 .4 .4000001 1.2 -2.2000008 -.8000002
1200018 33 0 3 1 49 12 0 0 0 0 0
1200018 33 0 3 2 . 12 . . . . .
1200018 33 1 3 3 . 12 . . . . .
1200019 35 1 4 1 44 18 .3333333 .6666667 -1.1666667 6.833332 .666666
1200019 35 1 4 2 42 18 .3333333 .6666667 -.16666675 4.833332 .666666
1200019 35 0 4 3 41 18 -.6666667 .6666667 .8333333 3.833332 .666666
1200019 35 1 4 4 38 18 .3333333 .6666667 1.8333333 .8333321 .666666
1200019 36 1 2 1 31 16 .3333333 -1.3333333 -1.1666667 -6.166668 -1.333334
1200019 36 0 2 2 27 16 -.6666667 -1.3333333 -.16666675 -10.166668 -1.333334
1200020 37 . 2 1 . 22 . . . . .
1200020 37 . 2 2 . 22 . . . . .
1200021 39 0 2 1 48 15 -.6666667 -1.3333333 -1.1666667 .6666679 0
1200021 39 0 2 2 46 15 -.6666667 -1.3333333 -.16666675 -1.333332 0
1200021 40 1 4 1 52 15 .3333333 .6666667 -1.1666667 4.666668 0
1200021 40 1 4 2 50 15 .3333333 .6666667 -.16666675 2.666668 0
1200021 40 1 4 3 46 15 .3333333 .6666667 .8333333 -1.333332 0
1200021 40 1 4 4 42 15 .3333333 .6666667 1.8333333 -5.333332 0
1200024 45 . 2 1 41 16 . . . . .
1200024 45 1 2 2 38 16 0 0 0 0 0
1200028 52 1 2 1 44 12 0 0 -.5 5.5 0
1200028 52 1 2 2 42 12 0 0 .5 3.5 0
1200028 53 1 2 1 36 12 0 0 -.5 -2.5 0
1200028 53 1 2 2 32 12 0 0 .5 -6.5 0
1200029 54 0 4 1 49 16 -.75 0 -1.5 4.75 0
1200029 54 1 4 2 46 16 .25 0 -.5 1.75 0
1200029 54 1 4 3 43 16 .25 0 .5 -1.25 0
1200029 54 1 4 4 39 16 .25 0 1.5 -5.25 0
1200032 60 0 7 1 56 16 -.8333333 0 -2.666667 6.666668 0
1200032 60 1 7 2 54 16 .1666667 0 -1.6666667 4.666668 0
1200032 60 1 7 3 52 16 .1666667 0 -.6666667 2.666668 0
1200032 60 1 7 4 50 16 .1666667 0 .33333325 .6666679 0
1200032 60 1 7 5 48 16 .1666667 0 1.3333333 -1.333332 0
1200032 60 . 7 6 45 16 . . . . .
1200032 60 1 7 7 36 16 .1666667 0 3.333333 -13.333332 0
1200033 61 0 3 1 49 14 -.5 0 -.5 2 0
1200033 61 1 3 2 45 14 .5 0 .5 -2 0
1200033 61 . 3 3 21 14 . . . . .
1200034 64 0 6 1 49 16 -.75 0 -3 2.75 0
1200034 64 . 6 2 49 16 . . . . .
1200034 64 . 6 3 48 16 . . . . .
1200034 64 1 6 4 47 16 .25 0 0 .75 0
1200034 64 1 6 5 46 16 .25 0 1 -.25 0
1200034 64 1 6 6 43 16 .25 0 2 -3.25 0
1200036 67 1 2 1 50 12 .28571427 -3.571429 -2.4285715 2.8571434 0
1200036 67 1 2 2 48 12 .28571427 -3.571429 -1.4285715 .8571434 0
1200036 68 0 7 1 56 12 -.7142857 1.4285712 -2.4285715 8.857143 0
1200036 68 1 7 2 53 12 .28571427 1.4285712 -1.4285715 5.857143 0
1200036 68 . 7 3 51 12 . . . . .
1200036 68 . 7 4 47 12 . . . . .
1200036 68 1 7 5 43 12 .28571427 1.4285712 1.5714285 -4.1428566 0
1200036 68 0 7 6 41 12 -.7142857 1.4285712 2.5714285 -6.142857 0
1200036 68 1 7 7 39 12 .28571427 1.4285712 3.5714285 -8.142857 0
1200037 69 1 2 1 39 17 .5 0 -.5 1 0
1200037 69 0 2 2 37 17 -.5 0 .5 -1 0
end