Dear Stata Community,
I am brand new to this list, and relatively new to Stata, but I was hoping someone would be able to help me with a problem I am having. Specifically, in an effor to become better acquainted with Stata, I have been trying to replicate results from a study I conducted using SAS. I have panel data for three decennial census years (1980-2000) and used Proc Genmod to estimate a fixed effects model. The code I used is below:
proc genmod data=two;
*ods output ParameterEstimates=sys.tvic0;
class tract tm;
model tvic = ac_ratio disadv stable prfemp p_for tm tm*p_for/d=nb dscale offset=lnpop;
run;
*The variable tm is a categorical variable indicating the census year.
Here is the syntax I submitted in Stata:
xtset tract year
xtnbreg tvic ac_ratio prfemp disadv stable p_for, fe exposure(tpop)
*The variable year is the decennial census year.
I did some reading and it appeared that xtnbreg would be the Stata command I should use for this purpose. However, I am unable to replicate the results, either in terms of the coefficient estimates or the standard errors. As such, I began trying different specification options, just in an attempt to see if I could duplicate the findings, which would help me to figure out some of the differences between programs. I tried both the "pa" (with different scale and correlation specifications) and "re" options, knowing the latter is incorrect.
I also came across a discussion of the xtgee command which I tried, specifying the link as log and the family as negative binomial. Still nothing matches. I was able to figure out a way to get xtnbreg and xtgee to produce the same results, which again are different from those produced by SAS. I am a little bit at a loss. If anyone could point out where I may be going wrong, or point me to some literature that could help clarify the differences, that would be much appreciated. Thank you for your time and I look forward to hearing from the community.
Sincerely,
Jake
-- Jacob I. Stowell, Ph.D. Associate Professor School of Criminology and Criminal Justice Northeastern University 360 Huntington Avenue Boston, Massachusetts 02115
I am brand new to this list, and relatively new to Stata, but I was hoping someone would be able to help me with a problem I am having. Specifically, in an effor to become better acquainted with Stata, I have been trying to replicate results from a study I conducted using SAS. I have panel data for three decennial census years (1980-2000) and used Proc Genmod to estimate a fixed effects model. The code I used is below:
proc genmod data=two;
*ods output ParameterEstimates=sys.tvic0;
class tract tm;
model tvic = ac_ratio disadv stable prfemp p_for tm tm*p_for/d=nb dscale offset=lnpop;
run;
*The variable tm is a categorical variable indicating the census year.
Here is the syntax I submitted in Stata:
xtset tract year
xtnbreg tvic ac_ratio prfemp disadv stable p_for, fe exposure(tpop)
*The variable year is the decennial census year.
I did some reading and it appeared that xtnbreg would be the Stata command I should use for this purpose. However, I am unable to replicate the results, either in terms of the coefficient estimates or the standard errors. As such, I began trying different specification options, just in an attempt to see if I could duplicate the findings, which would help me to figure out some of the differences between programs. I tried both the "pa" (with different scale and correlation specifications) and "re" options, knowing the latter is incorrect.
I also came across a discussion of the xtgee command which I tried, specifying the link as log and the family as negative binomial. Still nothing matches. I was able to figure out a way to get xtnbreg and xtgee to produce the same results, which again are different from those produced by SAS. I am a little bit at a loss. If anyone could point out where I may be going wrong, or point me to some literature that could help clarify the differences, that would be much appreciated. Thank you for your time and I look forward to hearing from the community.
Sincerely,
Jake
-- Jacob I. Stowell, Ph.D. Associate Professor School of Criminology and Criminal Justice Northeastern University 360 Huntington Avenue Boston, Massachusetts 02115
Comment