Description Usage Source References See Also Examples
See Details for GrowthCount
.
1 |
Sue Stieve \& Dennis Stimart
Venables and Ripley (1999) Modern Applied Statistics with S-PLUS, 3rd ed., ch. 7.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | data( Growth )
Growth <- Growth[,c("trt","advplt")]
# drop the added BHTA control ( trt = 20 )
Growth <- Growth[ Growth$trt != 20, ]
Growth$BA <- c(rep(0,4),rep(0.44,4),rep(4.4,3),rep(NA,9),0)[1+Growth$trt]
Growth$TDZ <- c(rep(c(0,0.2,2,20),3)[1:11],rep(NA,9),0)[1+Growth$trt]
Growth$code <- c(0:9,"a",rep(NA,9),"C")[1+Growth$trt]
Growth$trt <- factor(Growth$trt)
Growth$BA <- factor(Growth$BA)
Growth$TDZ <- factor(Growth$TDZ)
Growth <- Growth[!is.na(Growth$advplt),]
sample.size( Growth$BA, Growth$TDZ )
hist( Growth$advplt, nclass = 25 )
table( Growth$advplt )
Growth$nonzero <- as.numeric( Growth$advplt > 0 )
Growth.bin <- glm( nonzero ~ BA * TDZ, data = Growth,
family = binomial )
anova( Growth.bin, test = "Chisq" )
Growth.bin <- glm( nonzero ~ TDZ * BA, data = Growth,
family = binomial )
anova( Growth.bin, test = "Chisq" )
drop1( Growth.bin, formula( Growth.bin), test = "Chisq" )
Growth.des <- data.frame(
BA = factor( rep( levels( Growth$BA ), 4 )),
TDZ = factor( rep( levels( Growth$TDZ ), rep(3,4) )))
Growth.pred <- 1 / ( 1 + exp( - predict(
Growth.bin, Growth.des )))
plot( c(1,21),range( Growth.pred ), type = "n", log = "x",
xlab = "TDZ", ylab = "fraction nonzero" )
for( i in levels( Growth.des$BA ))
{
Growth.BA <- i == Growth.des$BA
text( 1 + unfactor( Growth.des$TDZ[Growth.BA] ),
Growth.pred[Growth.BA], i )
}
rm( Growth.BA )
Growth.pois <- glm( advplt ~ TDZ * BA, data = Growth,
family = poisson )
anova( Growth.pois )
Growth.apois <- glm( advplt ~ TDZ + BA, data = Growth,
family = poisson )
anova( Growth.apois )
drop1( Growth.apois, formula( Growth.apois ), test = "F" )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.