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
logit regression with categorical variables: obtain p-value of the difference to the basecategoryHi, I am trying to estimate a logit model using survey data. I have a categorical variable (age gro…
how to keep month end data from daily data (with various month-ending dates)Dear All, I have a daily data set with different month-ending date (sometime on 27 or 28 or 29 or 30…
Different results between Heckman model and separate probit + OLSDear Statalist I'm running a Heckman model and I wanted to compare the results of the Heckman model…
Forming new variable using several existing variablesHi, I am trying to create a variable "IN" that takes value from existing variables "IN_1 IN_2 IN_3 I…
If else inside for each loopI am trying to run the following code and it does not seem to be working. I want to change the refer…
Subscribe to:
Post Comments (Atom)
0 Response to xtgee with IPW
Post a Comment