[R] Genmod in SAS vs. glm in R

sandsky realstone at hotmail.com
Wed Sep 10 00:37:28 CEST 2008


Hello,

I have different results from these two softwares for a simple binomial GLM
problem. 
>From Genmod in SAS: LogLikelihood=-4.75, coeff(intercept)=-3.59,
coeff(x)=0.95
>From glm in R: LogLikelihood=-0.94, coeff(intercept)=-3.99, coeff(x)=1.36

Is there anyone tell me what I did wrong?

Here are the code and results,

1) SAS Genmod:

% r: # of failure
% k: size of a risk set

data bin_data;
input r k y x;
os=log(y);
cards;
1	3	5	0.5
0	2	5	0.5
0	2	4	1.0
1	2	4	1.0
;
proc genmod data=nelson;
	model r/k = x / 	dist = binomial 	link =cloglog   offset = os ;

     <Results from SAS>

    Log Likelihood                       -4.7514

    Parameter    DF    Estimate       Error           Limits           
Square    Pr > ChiSq

    Intercept     1     -3.6652      1.9875     -7.5605      0.2302      
3.40        0.0652
    x                1      0.8926      2.4900     -3.9877      5.7728      
0.13        0.7200
    Scale          0      1.0000      0.0000      1.0000      1.0000



2) glm in R

bin_data <-
data.frame(cbind(y=c(5,5,4,4),r=c(1,0,0,1),k=c(3,2,2,2),x=c(0.5,0.5,1.0,1.0)))
glm(r/k ~ x, family=binomial(link='cloglog'), data=bin_data, offset=log(y))

     <Results from R>
    Coefficients:
    (Intercept)            x  
        -3.991        1.358 
    
    'log Lik.' -0.9400073 (df=2)
-- 
View this message in context: http://www.nabble.com/Genmod-in-SAS-vs.-glm-in-R-tp19402751p19402751.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list