[R] The contrast and Design libraries

Frank Harrell f.harrell at vanderbilt.edu
Sat Nov 26 00:49:07 CET 2011


Note that you can do what you specified using only the rms package:
require(rms)
f <- Glm(propalive~exptime+infstat*status, 
        data=dat)
contrast(f,
   a = list(status = levels(dat$status), infstat="control", exptime=8230),
   b = list(status = levels(dat$status), infstat="infected",exptime=8230))
Frank

Joanne Lello wrote
> 
> Dear all,
> 
> I have been using the contrast library in my teaching for the last couple 
> of years and am right in the middle of this year's round. In the last week 
> R has been updated to version 2.14.0 on our computers. This has had the 
> unfortunate effect of meaning the contrasts library no longer works, as 
> the Design library is no longer available. I wonder if anyone has a fix 
> for this...or alternatively can tell me another package that is as simple 
> to use (the students won't cope with anything more complicated - we're all 
> biologists not statisticians).
> 
> I hope someone can help.
> 
> Here is a typical bit of code I'm currently running so you can see what 
> I'm trying to do:
> 
> exptime is a covariate and both infstat and status are factors
> 
> mod<-glm(propalive~exptime+infstat+status+ 
>         infstat:status,
>         data=dat)
> 
> library(contrast)
> 
> contrast(mod3,
>    a = list(status = levels(dat$status), infstat="control", exptime=8230),
>    b = list(status = levels(dat$status), infstat="infected",exptime=8230))
> 
> any help gratefully received,
> 
> Jo
> 
> Dr Joanne Lello
> Cardiff University
> School of Biosciences
> Organism and Environment Group
> Biomedical Sciences Building
> Museum Avenue
> Cardiff
> CF10 3AX
> Tel: 02920 875885
> E-mail: lelloj at .ac
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help@ mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
> 


-----
Frank Harrell
Department of Biostatistics, Vanderbilt University
--
View this message in context: http://r.789695.n4.nabble.com/The-contrast-and-Design-libraries-tp4106321p4109210.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list