predict.zlm {BMS}R Documentation

Predict Method for zlm Linear Model

Description

Expected value (And standard errors) of predictions based on 'zlm' linear Bayesian model under Zellner's g prior

Usage

## S3 method for class 'zlm'
predict(object, newdata = NULL, se.fit = FALSE, ...)

Arguments

object

a zlm linear model object - see zlm

newdata

An optional data.frame, matrix or vector containing variables with which to predict. If omitted, then (the expected values of) the fitted values are returned.

se.fit

A switch indicating if the standard deviations for the predicted varaibles are required.

...

further arguments passed to or from other methods.

Value

A vector with (expected values of) fitted values.
If se.fit is TRUE, then the output is a list with the following elements:

fit

a vector with the expected values of fitted values

std.err

a vector with the standard deviations of fitted values

se.fit

a vector with the standard errors without the residual scale akin to se.fit in predict.lm

residual.scale

The part from the standard deviations that involves the identity matrix. Note that sqrt(se.fit^2+residual.scale^2) yields std.err.

See Also

bms for creating zlm objects, predict.lm for a comparable function, predict.bma for predicting with bma objects

Check http://bms.zeugner.eu for additional help.

Examples


 data(datafls)
 mm=zlm(datafls,g="EBL")
 
 predict(mm) #fitted values 
 predict(mm, newdata=1:41) #prediction based on a 'new data point' 
 
 #prediction based on a 'new data point', with 'standard errors'
 predict(mm, newdata=datafls[1,], se.fit=TRUE) 
 

[Package BMS version 0.3.5 Index]