predict.bcgam: Predict method for 'bcgam' fits

Description Usage Arguments Details Value Author(s) Examples

View source: R/predict_bcgam.R

Description

Predicted values based on bcgam object.

Usage

1
2
3
## S3 method for class 'bcgam'
predict(object, newdata, interval = c("credible"),
  level = 0.95, parameter = c("mu"), ...)

Arguments

object

Object of class inheriting from "bcgam".

newdata

An optional data frame in which to look for variable with which to predict.

interval

Type of interval calculation. It can be either "credible" or "prediction". If interval=prediction, then a summary of the predictive posterior distribution is shown.

level

Tolerance/credible level. The default is 0.95.

parameter

The type of parameter to predict. If parameter="eta", then the systematic component η is predicted. If parameter="mu", then the mean value μ obtained by transforming η using the inverse of the link function is predicted. The default is μ. If interval="prediction", then this variable is ignored.

...

further arguments passed to or from other methods.

Details

predict.bcgam produces estimated values, standard errors, and interval estimates; obtained by the fitted model in the frame newdata. Setting intervals specifies computation of credible or prediction (tolerance) intervals at the specified level.

All predictions are based on the posterior distribution in the bcgam object.

Value

predict.bcgam produces a list of predictions, standard errors, and bounds based on the posterior disitribution in the bcgam object.

If interval="credible", a list with the following components is returned:

cred.mean

the mean values.

cred.sd

standard error of mean values.

cred.lower

lower bound of mean values.

cred.upper

upper bound of mean values.

If interval="prediction", a list with the following components is returned:

pred.mean

the predicted values.

pred.sd

standard error of predicted values.

pred.lower

lower bound of predicted values.

pred.upper

upper bound of predicted values.

Author(s)

Cristian Oliva-Aviles and Mary C. Meyer

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
n<-50
x<-(1:n)^{1/3}
z<-as.factor(rbinom(n, 1, 0.6))
y<-x+7*as.numeric(z)+rnorm(n,sd=2) 
bcgam.fit <- bcgam(y~sm.incr(x)+z, nloop=100)
predict(bcgam.fit, newdata=data.frame(x=0.5, z="1"), parameter="mu", interval="prediction")

## End(Not run)

bcgam documentation built on May 2, 2019, 8:42 a.m.

Related to predict.bcgam in bcgam...