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
Probit with endogenous binary regressorHello I am using ivprobit for my regression with a binary outcome variable. The help file suggests t…
Saving ado fileDear Statalist, I am having difficulties with saving ado file. I don't understand where to save the…
Correlation Coefficient and logarithmic variablesHi, I am working on some data containing 1400 observations over a 7 year period, whereas the observ…
Endogeneity in panel dataHi everyone, I have a balanced panel data N=14 (country) T=5. I have developed a Correlated random-e…
Generating geographical group variables from Household IDHi, I am using STATA 14, I am interested in generating a new variable from household ID, which is a…
Subscribe to:
Post Comments (Atom)
0 Response to xtgee with IPW
Post a Comment