[R] About logistic regression

Silvano silvano at uel.br
Thu Apr 1 14:19:43 CEST 2010


Hi,

I have a dichotomous variable (Q1) whose answers are Yes or 
No.
Also I have 2 categorical explanatory variables (V1 and V2) 
with two levels each.

I used logistic regression to determine whether there is an 
effect of V1, V2 or an interaction between them.

I used the R and SAS, just for the conference. It happens 
that there is disagreement about the effect of the 
explanatory variables between the two softwares.

R:
 q1 = glm(Q1~grau*genero, family=binomial, data=dados)
 anova(q1, test="Chisq")

            Df Deviance Resid. Df Resid. Dev P(>|Chi|)
NULL                          202     277.82
grau         1   4.3537       201     273.46   0.03693 *
genero       1   1.4775       200     271.99   0.22417
grau:genero  1   0.0001       199     271.99   0.99031

SAS:
proc logistic data=psico;
class genero (param=ref ref='0') grau (param=ref ref='0');
model Q1 = grau genero grau*genero / expb;
run;
                                   Type 3 Analysis of 
Effects
                                                      Wald
                         Effect           DF    Chi-Square 
Pr > ChiSq

                         grau              1        1.6835 
0.1945
                         genero            1        0.7789 
0.3775
                         genero*grau       1        0.0002 
0.9902

The parameters estimates are the same for both.
Coefficients:
             Estimate Std. Error z value Pr(>|z|)
(Intercept)  0.191055   0.310016   0.616    0.538
grau         0.562717   0.433615   1.298    0.194
genero      -0.355358   0.402650  -0.883    0.377
grau:genero  0.007052   0.580837   0.012    0.990

What am I doing wrong?

Thanks,

--------------------------------------
Silvano Cesar da Costa
Departamento de Estatística
Universidade Estadual de Londrina
Fone: 3371-4346



More information about the R-help mailing list