Learn R Programming

qtlmt (version 0.1-1)

sureStep: SURE model selection

Description

Select a SURE model via model selection.

Usage

sureAdd1(obj, y, x, range=NULL, iter=250, tol=1e-8, ext=FALSE)

sureDrop1(obj, y, x, range=NULL, iter=250, tol=1e-8, ext=FALSE)

sureStep(y, x, v, lower, upper, k, direction=c("both","backward",
   "forward"), iter=250, max.terms=200, steps=1000, tol=1e-8)

sureStep2(obj, y, x, cv, direction=c("both","backward","forward"),
   range=NULL, iter=250, steps=1000, tol=1e-8, ext=FALSE)

Arguments

obj
initial model in model search; can be an object of sureEst.
y
n by p matrix, whose columns are dependent variables.
x
n by m matrix, whose columns are predictor variables to select from.
cv
critical value used in the likelihood ratio test to determine adding/dropping a term.
v
list; v[[j]] indicates which x's to start with for y[,j].
range
list; range[[j]] indicates which x's (all if NULL) correspond to which y[,j].
lower
list in the format of v; lower scope of the model.
upper
list in the format of v; upper scope of the model.
k
penalty, 0 if missing or
direction
forward selection, backward elimination or stepwise.
iter
maximum number of iterations in a numerical process to estimate model parameters.
max.terms
maximum number of terms in the final model.
steps
maximum number of search steps.
tol
convergence tolerance.
ext
whether to perform an extensive search.

Value

  • a list with the following components:
  • loglik:log-likelihood of the model
  • b:estimates of model coefficients
  • sigma:estimates of residual variance-covariance
  • v:variables selected in the model

Examples

Run this code
data(etrait)
x<- as.matrix(3/2-mdat)
y<- as.matrix(traits)[,1:3]
v<- list()
upper<- list()
for(k in 1:ncol(y)){
   v[[k]]<- numeric(0)
   upper[[k]]<- 1:ncol(x)
}
g1<- sureStep(y, x, v=v, upper=upper, k=19)
g2<- sureStep2(g1, y, x, cv=1/2, ext=FALSE)

Run the code above in your browser using DataLab