mStep: Model selection in multivariate multiple regression

Description Usage Arguments Value See Also Examples

View source: R/mstep.R

Description

Select a multivariate multiple regression model via model selection.

Usage

1
2
mStep(object, scope, direction=c("both","backward","forward"),
   trace=FALSE, keep=TRUE, steps=1000, k=2, ...)

Arguments

object

initial model in model search.

scope

a single formula, which provides ‘upper’, or a list containing components ‘upper’ and ‘lower’, both formulae; defines the lower and upper bound. See step.

direction

forward selection, backward elimination or stepwise.

trace

whether to track the process for monitoring purpose.

keep

whether to return the change of terms and related statistics.

steps

maximum number of search steps.

k

penalty on a parameter. The selection criterion is the known "AIC" if k = 2 and is "BIC" if k = log(n) where "n" is the sample size.

...

additional arguments to update.

Value

a list with components of a lm object plus ‘keep’ if required.

See Also

mAdd1 and mDrop1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(etrait)
mdf<- data.frame(traits,markers)
## Not run: 
mlm<- lm(cbind(T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16) ~
   m1 + m2 + m3 + m4 + m5, data=mdf)

lw<- formula(paste("~ ", paste("m",1:3,collapse=" + ",sep="")))
up<- formula(paste("~", paste("m",1:15,collapse=" + ",sep="")))

ob<- mStep(mlm, scope=list(lower=lw), k=99, direction="backward", data=mdf)
of<- mStep(mlm, scope=list(upper=up), k=5, direction="forward", data=mdf)
o1<- mStep(mlm, scope=list(upper=up), k=5, direction="both", data=mdf)
o2<- mStep(o1, scope=list(upper=up), k=2, direction="forward", data=mdf)

## End(Not run)

Example output

R/qtlmt is loaded

qtlmt documentation built on May 2, 2019, 2:23 p.m.

Related to mStep in qtlmt...