data(miscEx)
if (FALSE) {
# forward selection
# any variance component will be selected
# if AIC improve by 1e-5 or larger
pheno<- pdatF8[!is.na(pdatF8$bwt) & !is.na(pdatF8$sex),]
ii<- match(rownames(pheno), rownames(gmF8$AA))
v<- list(A=gmF8$AA[ii,ii], D=gmF8$DD[ii,ii])
o<- aicVC(y=pheno$bwt, x=pheno$sex, k=0, v=v, msg=TRUE)
o
# forward selection
of<- aicVC(y=pheno$bwt, x=pheno$sex, v=v, k=1/2,
direction="for", msg=TRUE)
of
# backward elimination
ob<- aicVC(y=pheno$bwt, x=pheno$sex, v=v, k=1/2, init=1:2,
direction="back", msg=TRUE)
ob
}
Run the code above in your browser using DataLab