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
Reshape ProblemDear all, I am trying to bring a dataset into the right format. However, I can´t figure out the las…
Verify Fixed Effects resultsDear Statalists, I did a fixed-effects analysis and obtained the expected significant results. Then…
How to count the number of rows and columns of a non-null values in matrix?Hello, I am new to Mata and how do you count the number of rows and columns of a non-null values in …
Event StudyCan I get the event study video tutorial or commands along with data files, such as, firm data, mark…
🛂 Stata errorsDear All, the following section of the manual contains the error codes that Stata may issue: https:…
Subscribe to:
Post Comments (Atom)
0 Response to xtgee with IPW
Post a Comment