###################################
# fixed model fitting
###################################
# load in abf1 data
data(abf1)
## Not run:
#
# # fit model with random effect
# fit.full.mix <- fitmaanova(abf1, formula = ~Strain+Sample,
# random = ~Sample)
#
# # this is to explain the usage of including covariate variable.
# # .CEL file is not included in the package, thus use can not use this.
# # array specific covariate : add it to the design matrix
# beforeRma <- ReadAffy() # suppose there are 18 arrays.
# rmaData <- rma(beforeRma)
# datafile <- exprs(rmaData)
# design.table=data.frame(Array=row.names(pData(beforeRma)))
# Strain = rep(c('Aj', 'B6', 'B6xAJ'), each=6)
# Sample = rep(c(1:9), each=2)
# Cov1 = sample(1:100,18) # this is artificial example
# designfile.cov1 = cbind(design.table, Strain, Sample,Cov1)
# data.cov1=read.madata(datafile, designfile=designfile.cov1)
# fit.cov1 = fitmaanova(data.cov1,formula = ~Strain+Sample+Cov1, covariate = ~ Cov1)
#
# # gene specific covariate - make artificial 'covM' matrix
# covm = matrix(rnorm(length(datafile)), nrow=nrow(datafile))
# designfile.cov2 = cbind(design.table, Strain, Sample)
# data.cov2=read.madata(datafile, designfile=designfile.cov2, covM=covm)
# fit.cov2 = fitmaanova(data.cov2,formula = ~Strain+Sample+covM, covariate = ~ covM) ## End(Not run)
Run the code above in your browser using DataLab