Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Fw: appling a gamma distribution random effects model. SAS to Stata


From   "Brent McSharry" <brent@focused-light.net>
To   "Statalist" <statalist@hsphsun2.harvard.edu>
Subject   st: Fw: appling a gamma distribution random effects model. SAS to Stata
Date   Wed, 7 Dec 2011 22:31:54 +1300

I have some SAS code to apply a model to patient data, and I would like to apply this to our local data (the model is externally validated to predict length of ICU stay in days).
Unfortunately I have no idea about SAS syntax, and exclusively use stata.

the first part of the SAS code obviously generates a linear coefficient & applies an exp link
ie in Stata:

scalar s2u = 1
scalar a = 2
generate linCoef = 0.2 + varA * 0.4 + varB*-0.02 ...
generate mu= exp(linCoef)
gen b = mu/a

and then i am affraid I am lost (particularly as the = signs stop and the tildas ~ begin)

model los_days ~ gamma(a,b);
random u ~ normal(0,s2u) subject=varY out=random;
predict mu out=predout;
run;

Can anyone please assist in translating tothe equivalent Stata code?

Thank you very much for any help.

Brent McSharry
Intensivist
Starship Children's Health
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index