Hi. I am looking at the effect of non-employer based health insurance on self-employment on panel data. I'm running a difference-in-difference GEE model using inverse probability weights that I created. The insurance policy was enacted in 2007 and in the calculation of my weights I only consider the data for 2006 on the assumption that that year probably had the most influence on decisions made post the policy. However, despite restricting the data to 2006, it appears that I get different weights for the same individual across years, which results in the error "weight must be constant within idind" when I run the xtgee command. I've pasted my code for the ipw and xtgee below. Any guidance will be much appreciated.
probit treatment_group $X if year==2006 & urban == 1
predict phat
gen uipw=1/phat if treatment_group == 1
replace uipw=1/(1-phat) if treatment_group == 0
drop phat
label var uipw "Urban Inverse Propensity Weight"
xtgee $F post post#urban_hukou $X2 i.year [pw=uipw], family(binomial) link(logit) corr(independent)
note: 1.post#0.urban_hukou omitted because of collinearity
note: 1.post#1.urban_hukou omitted because of collinearity
note: 0.army omitted because of collinearity
note: 1.otherprof omitted because of collinearity
note: 2011.year omitted because of collinearity
weight must be constant within idind
r(199);
Thanks,
Karishma
Related Posts with xtgee with IPW
IV regressions with interaction termsDear Stata community, I'd like to run an IV regression with interaction terms between the endogenou…
Dropping Observations and Creating Fertility VariableQuestion 1: I am using two fertlity variables- age at first intercourse (var name: age1stsex) and a…
Transform data from wide to long but then lots of values/observations went missing.Hi everyone, I have a dataset with dimension of individuals, observations (e.g income, total broadc…
how can concat observation data by IDI have the dataset like this: ID Course 1 MS Word 1 MS Excel 2 Windows 2 DOS I want to change it a…
How do I reference an estimate after lincom?Hi Everyone: I know there must be a simple solution to this but I haven't found it. I thought that u…
Subscribe to:
Post Comments (Atom)
0 Response to xtgee with IPW
Post a Comment