Thanks Kieran,
this is the SAS code I'm using
=========================================================================
data dat2;
set victor.diar_completers;
lobs=log(At_Risk);
run;
proc genmod data=dat2;
class Commid pair size trt;
model EPISODES= pair trt / d=nb offset=lobs type1 type3;
output out=victor.res3 pred=pred stdresdev=resids;
run;
quit;
=========================================================================
and the Stata command:
xi: nbreg numepisodes i.pair i.studyortest, exposure( atriskdays)
or
xi: glm numepisodes i.pair i.studyortest, exposure( atriskdays)
family(nb 0.1267885)
==============================================================================
where 0.1267885 is the dispersion parameter of the negative binomial
obtained using nbreg.
Regards,
Victor
Quoting "Kieran McCaul" <[email protected]>:
Hi Victor,
You might get a response I fyou sent the SAS code that generated this
output and then the Stata code that you are trying to use.
Kieran
______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2140
Fax: (08) 9224 8009
email: [email protected]
http://myprofile.cos.com/mccaul
_______________________________________________
The fact that no one understands you doesn't make you an artist.
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Victor M.
Enciso M.
Sent: Thursday, 27 November 2008 9:04 PM
To: [email protected]
Subject: st: nbreg proc genmod equivalency
Hi everybody,
I'm doing a negative binomial regression using Proc Genmod on SAS
where this is part of the output
Parameter DF Estimate Error Limits Square
Pr > ChiSq
TRT 1 1 -0.2397 0.1102 -0.4557 -0.0237 4.73
0.0296
TRT 2 0 0.0000 0.0000 0.0000 0.0000
Dispersion 1 0.1268 0.0315 0.0651 0.1885
NOTE: The negative binomial dispersion parameter was estimated by
maximum likelihood.
LR Statistics For Type 1 Analysis
2*Log Chi-
Source Likelihood DF Square Pr > ChiS
Intercept 5189.2817
PAIR 5253.0473 34 63.77 0.0015
TRT 5257.5618 1 4.51 0.0336
LR Statistics For Type 3 Analysis
Chi-
Source DF Square Pr > ChiSq
PAIR 34 65.03 0.0011
TRT 1 4.51 0.0336
I'm trying to reproduce this analysis in Stata but I don't know how to
get the Type 1 and Type 3 Statistics. Anybody knows how to do this?
Another question is why are the p-values of the contrast of tratment 1
wrt to treatment 2 (0.0296) and the one given for TRT (0.0336)
different?
Thank you very much.
Victor Enciso
*
* 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/
*
* 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/
--
Víctor M. Enciso M.
School of Mathematics
The University of Manchester
C24 Ferranti Building
PO BOX 88
M60 1QD
Manchester, UK
Ext: 55820
*
* 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/