data(miscEx)
# forward selection
# any variance component will be selected
# if AIC improve by 1e-5 or larger
v=list(AA=gmF8$AA, DD=gmF8$DD, HH=NULL, AD=NULL,
MH=NULL, EE=diag(length(pdatF8$bwt)))
o<- aicVC(y=pdatF8$bwt, x=pdatF8$sex, k=0, v=v, verbose=TRUE)
o
# forward selection
of<- aicVC(y=pdatF8$bwt, x=pdatF8$sex, v=v, k=1/2, init=6,
direction="for", verbose=TRUE)
of
# backward elimination
ob<- aicVC(y=pdatF8$bwt, x=pdatF8$sex, v=v, k=1/2, keep=6,
direction="back", verbose=TRUE)
obRun the code above in your browser using DataLab