jma: JMA: Jackknife Model Averaging

Description Usage Arguments Details Value Author(s) References Examples

View source: R/jma.r

Description

Performs model averaging on a set of (linear) candidate models with the weight vector chosen such that the leave-one-out cross validation error is minimized.

Usage

1
2
jma(y,x,method=c("JMA","MMA"),subset=c("nested","all"),factor.variables=NULL,pd=T,
                variance=c("none","boot"), bsa=100)

Arguments

y

The response vector.

x

A matrix or dataframe containing the covariates.

method

A character vector specifiying whether jackknife model averaging (JMA) or Mallow's model averaging (see mma) should be performed.

subset

A character vector specifiying whether all 2^p candidate models should be considered or the nested subset of p models.

factor.variables

A (vector of) string(s) specifying which variables should be treated as factors, i.e. recoded into dummy variables. Factor variables will automatically be recoded if not specified here.

pd

A logical value specifying whether messages should be printed or not.

variance

A character vector specifying whether no variance should be estimated or based on bootstrapping ("boot").

bsa

A positive integer specifying the number of bootstrap samples used if variance = "boot".

Details

This function utilizes Jackknife model averaging as described in Hansen and Racine (2012), see reference below.

If subset = "all", then 2^p candidate models are being evaluated. This means p can't be too large (say<20) and occasionally the residual matrix used in the quadtratic programming problem may not be positive definite. In the latter case, this matrix is altered by jma such that it is positive definite, but results should be interpreted with care.

Value

Returns an object of class ‘jma’:

betahat

estimates coefficients

se

standarde error

lci

lower confidence limit

uci

upper confidence limit

weight

JMA weight vector

yhat

fitted values

ehat

fitted residuals

y

outcome variable

x

matrix of covariates

Author(s)

Michael Schomaker (based on the file of Bruce Hansen at https://www.ssc.wisc.edu/~bhansen/progs/joe_12.html)

References

Hansen, B. and Racine, J. (2012), Jackknife Model Averaging, Journal of Econometrics, 167:38-46

Examples

1
2
3
4
5
6
7
data(Prostate)
jma(y=Prostate$lpsa,x=Prostate[,-9])
jma(y=Prostate$lpsa,x=Prostate[,-9], variance="boot", bsa=100)

# can also perform Mallow's Model Averaging as in mma()
jma(y=Prostate$lpsa,x=Prostate[,-9],method="MMA")
mma(Prostate, formula=lpsa~.,ycol="lpsa")

MAMI documentation built on Dec. 11, 2017, 3 p.m.