## Annette Dobson (1990) "An Introduction to Generalized Linear Models".
## Page 9: Plant Weight Data.
ctl <- c(4.17,5.58,5.18,6.11,4.50,4.61,5.17,4.53,5.33,5.14)
trt <- c(4.81,4.17,4.41,3.59,5.87,3.83,6.03,4.89,4.32,4.69)
group <- gl(2,10,20, labels=c("Ctl","Trt"))
weight <- c(ctl, trt)
anova(lm.D9 <- lm(weight ~ group))
# Analysis of Variance Table
# Response: weight
# Df Sum Sq Mean Sq F value Pr(>F)
#group 1 0.6882 0.6882 1.4191 0.249
#Residuals 18 8.7292 0.4850
Fstat(indata = rbind(weight,weight),formula1=~group) # Fstat will need at least two genes to work with #
#$Fstat
# weight weight
#1.419101 1.419101
#$fnum
#[1] 18
#$fdenom
#[1] 1
#$design1
# (Intercept) groupTrt
#1 1 0
#2 1 0
#3 1 0
#4 1 0
#5 1 0
#6 1 0
#7 1 0
#8 1 0
#9 1 0
#10 1 0
#11 1 1
#12 1 1
#13 1 1
#14 1 1
#15 1 1
#16 1 1
#17 1 1
#18 1 1
#19 1 1
#20 1 1
#attr(,"assign")
#[1] 0 1
# $design0
# NULL
# $SS1
# weight weight
#8.72925 8.72925
#$SS0
# weight weight
#0.688205 0.688205
Run the code above in your browser using DataLab