mmsvarwts: Variable importance

Description Usage Arguments Value Author(s) Examples

View source: R/mmsvarwts.R

Description

Function to calculate variable importance from output of mmsmodwts by summing LNOCV weights.

Usage

1
mmsvarwts(pred, weights, prednames = NULL)

Arguments

pred

a numeric vector giving indices of predictor variables as used in a call to mmsmodwts

weights

a data frame of model weights, output from mmsmodwts

prednames

a character vector of predictor names. If NULL (the default), the indices in pred are used as names

Value

an object of class dataframe consisting of summed variable weights

Author(s)

Jon Walter, jaw3es@virginia.edu

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
v2<-matrix(rnorm(100),10,10)
v2<-v2+t(v2)
v3<-matrix(rnorm(100),10,10)
v3<-v3+t(v3)
v4<-matrix(rnorm(100),10,10)
v4<-v4+t(v4)
err<-matrix(rnorm(100,sd=.1),10,10)
err<-err+t(err)
v1<-1*v2+2*v3+3*v4+1+err
mats<-list(v1=v1,v2=v2,v3=v3,v4=v4)
model.names<-NA
n<-2
#in a real application nrand should be larger 
nrand<-25 
maxruns<-Inf
weights<-mmsmodwts(mats=mats,model.names=model.names,
             nrand=nrand,n=n,maxruns=maxruns,progress=FALSE)
pred<-2:4
res<-mmsvarwts(pred=pred,weights=weights)

reumandc/mms documentation built on May 28, 2019, 5:39 p.m.