Code:
storage display value variable name type format label variable label --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- interested float %13.0g interested Interested(0/1) polpart float %9.0g polpart Participates (0/1) hhinc_eqr float %9.0g Real Equivalized HH-Inc. in thousand € female float %9.0g female Female (0/1) age int %8.0g Age of Individual west float %9.0g west West-Germany(0/1) y2013 float %9.0g y2013 Pre crisis(0/1) y2017 float %9.0g y2017 Post crisis(0/1) unemployed float %10.0g unemployed Unemployed(0/1) edyears float %9.0g Number of Years of Education party_pref float %13.0g party_pref Party preference(0/1) worried float %11.0g worried hhinc_group float %9.0g hhinc_group Income Groups hhsize byte %8.0g Number of Persons in HH persnr long %12.0g Unveraenderliche Personennummer (PID) syear int %12.0g Befragungsjahr
Code:
. logistic interested i.y2017##c.age i.y2017##ib(2).hhinc_group i.y2017##i.west /// > i.y2017##i.female i.y2017##i.party_pref i.y2017##i.unemployed /// > i.y2017##i.worried i.y2017##c.edyears, vce(cluster persnr) Logistic regression Number of obs = 21,444 Wald chi2(19) = 3116.28 Prob > chi2 = 0.0000 Log pseudolikelihood = -11933.143 Pseudo R2 = 0.1783 (Std. Err. adjusted for 15,309 clusters in persnr) ----------------------------------------------------------------------------------- | Robust interested | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] ------------------+---------------------------------------------------------------- y2017 | 2017 | 1.959571 .4097247 3.22 0.001 1.300721 2.952146 age | 1.028058 .0016503 17.24 0.000 1.024828 1.031297 | y2017#c.age | 2017 | .9953376 .0017759 -2.62 0.009 .991863 .9988244 | hhinc_group | Poor | .841905 .0772755 -1.87 0.061 .7032897 1.007841 Rich | 1.351389 .0803104 5.07 0.000 1.202805 1.518328 | y2017#hhinc_group | 2017#Poor | 1.102225 .1224724 0.88 0.381 .8865227 1.37041 2017#Rich | .8609955 .0585903 -2.20 0.028 .7534891 .9838406 | west | West | 1.097271 .0653854 1.56 0.119 .9763183 1.233207 | y2017#west | 2017#West | .9534032 .0610252 -0.75 0.456 .8409944 1.080837 | female | Female | .3994588 .020074 -18.26 0.000 .36199 .4408059 | y2017#female | 2017#Female | 1.080646 .0578372 1.45 0.147 .9730302 1.200164 | party_pref | preference | 3.502175 .1792699 24.49 0.000 3.167863 3.871767 | y2017#party_pref | 2017#preference | .9004705 .0542628 -1.74 0.082 .8001578 1.013359 | unemployed | unemployed | 1.166827 .1479902 1.22 0.224 .910013 1.496117 | y2017#unemployed | 2017#unemployed | .8746221 .1345562 -0.87 0.384 .6469451 1.182425 | worried | worried | .8425315 .0449318 -3.21 0.001 .758913 .9353632 | y2017#worried | 2017#worried | 1.066966 .0755296 0.92 0.360 .928741 1.225763 | edyears | 1.206524 .0125361 18.07 0.000 1.182202 1.231346 | y2017#c.edyears | 2017 | .9956702 .0111172 -0.39 0.698 .9741176 1.0177 | _cons | .010937 .0020517 -24.07 0.000 .0075722 .0157971 ----------------------------------------------------------------------------------- Note: _cons estimates baseline odds.
Code:
. xtlogit interested c.age##c.age ib(2).hhinc_group i.west i.female i.party_pref /// > i.unemployed i.worried edyears i.y2017, re nolog or intpoints(32) Random-effects logistic regression Number of obs = 21,444 Group variable: persnr Number of groups = 15,309 Random effects u_i ~ Gaussian Obs per group: min = 1 avg = 1.4 max = 2 Integration method: mvaghermite Integration pts. = 32 Wald chi2(11) = 1184.43 Log likelihood = -11080.549 Prob > chi2 = 0.0000 ------------------------------------------------------------------------------ interested | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- age | 1.043214 .0135104 3.27 0.001 1.017068 1.070033 | c.age#c.age | 1.000125 .0001226 1.02 0.308 .9998846 1.000365 | hhinc_group | Poor | .7840031 .0976617 -1.95 0.051 .6141654 1.000807 Rich | 1.440353 .1243391 4.23 0.000 1.216154 1.705883 | west | West | 1.22893 .1197768 2.12 0.034 1.015232 1.487609 | female | Female | .1370047 .0129937 -20.96 0.000 .1137644 .1649927 | party_pref | preference | 10.51701 .9246106 26.76 0.000 8.852339 12.49471 | unemployed | unemployed | 1.141778 .1908279 0.79 0.428 .8228457 1.584327 | worried | worried | .8122069 .0655849 -2.58 0.010 .6933188 .9514815 edyears | 1.541916 .0302456 22.08 0.000 1.48376 1.60235 | y2017 | 2017 | 1.840504 .1101531 10.19 0.000 1.636789 2.069573 _cons | .0000852 .0000392 -20.36 0.000 .0000346 .0002101 -------------+---------------------------------------------------------------- /lnsig2u | 2.411774 .067891 2.27871 2.544838 -------------+---------------------------------------------------------------- sigma_u | 3.339721 .1133685 3.124753 3.569477 rho | .7722266 .0119415 .7479791 .7947813 ------------------------------------------------------------------------------ Note: Estimates are transformed only in the first equation. Note: _cons estimates baseline odds (conditional on zero random effects). LR test of rho=0: chibar2(01) = 1719.38 Prob >= chibar2 = 0.000
Now I am wondering, whether I should interpret this change by looking at the marginal effects of my year-dummy, or if I need to estimate separate RE-Logit for each of the three income groups (?). AFAIK the year dummies will pick up any variation in the outcome that happen over time and that is not attributed to other explanatory variables, BUT does it make sense to estimate it for different subpopulations ? If not, what other possibilities do I have to compare my two waves ?
Here is what I ran after my RE-Logit:
Code:
. margins, dydx(y2017) over(hhinc_group) coeflegend post Average marginal effects Number of obs = 21,444 Model VCE : OIM Expression : Pr(interested=1), predict(pr) dy/dx w.r.t. : 1.y2017 over : hhinc_group ------------------------------------------------------------------------------ | dy/dx Legend -------------+---------------------------------------------------------------- 0.y2017 | (base outcome) -------------+---------------------------------------------------------------- 1.y2017 | hhinc_group | Poor | .0464933 _b[1.y2017:1bn.hhinc_group] Middle | .0518429 _b[1.y2017:2.hhinc_group] Rich | .05327 _b[1.y2017:3.hhinc_group] ------------------------------------------------------------------------------ Note: dy/dx for factor levels is the discrete change from the base level. . end of do-file . do "C:\Users\Lorenz\AppData\Local\Temp\STD1bbc_000000.tmp" . test _b[1.y2017:1bn.hhinc_group] = _b[1.y2017:2.hhinc_group] = _b[1.y2017:3.hhinc_group] ( 1) [1.y2017]1bn.hhinc_group - [1.y2017]2.hhinc_group = 0 ( 2) [1.y2017]1bn.hhinc_group - [1.y2017]3.hhinc_group = 0 chi2( 2) = 50.06 Prob > chi2 = 0.0000
Alternatively, I thought about running
Code:
xtlogit interested c.age##c.age ib(2).hhinc_group i.west i.female i.party_pref /// i.unemployed i.worried edyears i.y2017 if hhinc_group==1, re nolog or intpoints(32)
I am currently at undergrad level and re did my best to read all material available, but right now I cannot find an answer in regards to what I should use for my analysis.
I would very much appreciate any input.
Best regards,
Lorenz
0 Response to Comparing two waves with RE-Logit
Post a Comment