Skip to contents

S3 method for class 'pred.bas'. Simple utility function to extract the variable names. Used to print names for the selected models using estimators for 'HPM', 'MPM' or 'BPM". for the selected model created by predict for BAS objects.

Usage

# S3 method for class 'pred.bas'
variable.names(object, ...)

Arguments

object

a BAS object created by predict from a BAS `bas.lm` or `bas.glm` object

...

other arguments to pass on

Value

a character vector with the names of the variables included in the selected model; in the case of 'BMA' this will be all variables

Examples

data(Hald)
hald.gprior =  bas.lm(Y~ ., data=Hald, prior="ZS-null", modelprior=uniform())
hald.bpm = predict(hald.gprior, newdata=Hald[1,],
                   se.fit=TRUE,
                   estimator="BPM")
variable.names(hald.bpm)
#> [1] "Intercept" "X2"