I'm using Stata 13.1 SE under Windows 7E. I'm using apc_ie (http://econpapers.repec.org/software...de/s456754.htm) with some survey data, Since the module was not originally set up for survey data, the author kindly provided me with a modification to accommodate these kinds of data. This consisted of:
Definition of a new variable at the top of the program:
A code block to fill that variable:
And modification of the glm command to pick up the svy prefix:
So, one should be able to write:
for
However, I can't can't get it to recognize the svypre variable in the code. It's as if it's a null string. I get the same results with or without the svyopts option. I'm at a loss to explain why this is happening and how to fix it. Does anyone have any ideas?
Definition of a new variable at the top of the program:
Code:
svyopts(string)
Code:
*survey options? if "`svyopts'"=="" local svypre "" else local svypre "`svyopts':"
And modification of the glm command to pick up the svy prefix:
Code:
*estimate; if "`exposure'"~="" local exposurestr "exposure(`exposure')"; if "`offset'"~="" local offsetstr "offset(`offset')"; `svypre' glm `varlist' `xnames' if `touse' [`weight' `exp'], `constant' `exposurestr' `offsetstr' scale(`scale') `options' nodisplay;
So, one should be able to write:
Code:
apc_ie2 y, age(age) period(period) cohort(cohort) svyopts("svy")
Code:
svy: glm y
However, I can't can't get it to recognize the svypre variable in the code. It's as if it's a null string. I get the same results with or without the svyopts option. I'm at a loss to explain why this is happening and how to fix it. Does anyone have any ideas?

Comment