predict.bcgam {bcgam} | R Documentation |
Predicted values based on bcgam object.
## S3 method for class 'bcgam'
predict(object, newdata, interval = c("credible"),
level = 0.95, parameter = c("mu"), ...)
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 |
level |
Tolerance/credible level. The default is |
parameter |
The type of parameter to predict. If parameter= |
... |
further arguments passed to or from other methods. |
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.
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. |
Cristian Oliva-Aviles and Mary C. Meyer
## 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)