gaiarrido
2012-Feb-06 10:56 UTC
[R] glht (multicomparisons) with a binomial response variable
Hi, I,ve a run a model like this mcrm<-glm(catroj~month,binomial) being catroj a binary response variable with two levels (infected and non infected)> anova(mcrm3,test="Chisq")Df Deviance Resid. Df Resid. Dev P(>|Chi|) NULL 520 149.81 mes 3 16.86 517 132.94 0.0007551 *** When I?m trying to do a post comparisons between factors i tried with glht of multcomp package by Torsten Hothorn I use "Tukey" contrast, but d?dn't get diferencies > summary(glht(mcrm3,linfct=mcp(month="Tukey"))) Estimate Std. Error z value Pr(>|z|) may - april == 0 -18.2470 1555.0564 -0.012 1.0000 june - april == 0 -1.9436 0.8307 -2.340 0.0671 . july - april == 0 -0.6253 0.5477 -1.142 0.6133 june - may == 0 16.3034 1555.0565 0.010 1.0000 july - may == 0 17.6216 1555.0563 0.011 1.0000 july - june == 0 1.3182 0.7899 1.669 0.2870 I'm afraid "Tukey" it is not the correct contrast, but, What should i use for a binary response variable? Any advice, please? ----- Mario Garrido Escudero PhD student Dpto. de Biolog?a Animal, Ecolog?a, Parasitolog?a, Edafolog?a y Qca. Agr?cola Universidad de Salamanca -- View this message in context: http://r.789695.n4.nabble.com/glht-multicomparisons-with-a-binomial-response-variable-tp4360898p4360898.html Sent from the R help mailing list archive at Nabble.com.
Frank Harrell
2012-Feb-06 12:55 UTC
[R] glht (multicomparisons) with a binomial response variable
Making sure you have the most recent version of rms, try require(rms) dd <- datadist(catroj, month); options(datadist='dd') f <- lrm(catroj ~ month) contrast(f, list(month=2:12), list(month=1), conf.type='simultaneous') The actual coding will depend on how month is defined. The contrast above contrasts January with all other months, with simultaneous confidence intervals provided by glht. Frank gaiarrido wrote> > Hi, > I,ve a run a model like this > mcrm<-glm(catroj~month,binomial) > being catroj a binary response variable with two levels (infected > and non infected) > >> anova(mcrm3,test="Chisq") > Df Deviance Resid. Df Resid. Dev P(>|Chi|) > NULL 520 149.81 > mes 3 16.86 517 132.94 0.0007551 *** > > When I?m trying to do a post comparisons between factors i tried with glht > of multcomp package by Torsten Hothorn I use "Tukey" contrast, but d?dn't > get diferencies > > summary(glht(mcrm3,linfct=mcp(month="Tukey"))) > Estimate Std. Error z value Pr(>|z|) > may - april == 0 -18.2470 1555.0564 -0.012 1.0000 > june - april == 0 -1.9436 0.8307 -2.340 0.0671 . > july - april == 0 -0.6253 0.5477 -1.142 0.6133 > june - may == 0 16.3034 1555.0565 0.010 1.0000 > july - may == 0 17.6216 1555.0563 0.011 1.0000 > july - june == 0 1.3182 0.7899 1.669 0.2870 > > I'm afraid "Tukey" it is not the correct contrast, but, What should i use > for a binary response variable? > Any advice, please? >----- Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/glht-multicomparisons-with-a-binomial-response-variable-tp4360898p4361171.html Sent from the R help mailing list archive at Nabble.com.
gaiarrido
2012-Feb-07 12:01 UTC
[R] glht (multicomparisons) with a binomial response variable
Thanks very much, Frank, I will try, first I have to adjust your solution to my problem cause i have just for months : april, may, june and july. I will tell you!! Thanks again ----- Mario Garrido Escudero PhD student Dpto. de Biolog?a Animal, Ecolog?a, Parasitolog?a, Edafolog?a y Qca. Agr?cola Universidad de Salamanca -- View this message in context: http://r.789695.n4.nabble.com/glht-multicomparisons-with-a-binomial-response-variable-tp4360898p4364501.html Sent from the R help mailing list archive at Nabble.com.