predict.DALSM {DALSM}R Documentation

Prediction based on a DALSM model

Description

Estimated conditional mean and standard deviation of the response based on a DALSM object for given covariate values in a data frame 'newdata'. Conditional quantiles can also be computed.

Usage

## S3 method for class 'DALSM'
predict(object, newdata, probs, ...)

Arguments

object

a DALSM.object.

newdata

an optional data frame in which to look for variables with which to predict. If omitted, the covariate values in the original data frame used to fit the DALSM model are considered.

probs

probability levels of the requested conditional quantiles.

...

further arguments passed to or from other methods.

Value

Returns a list containing:

Author(s)

Philippe Lambert p.lambert@uliege.be

References

Lambert, P. (2021). Fast Bayesian inference using Laplace approximations in nonparametric double additive location-scale models with right- and interval-censored data. Computational Statistics and Data Analysis, 161: 107250. <doi:10.1016/j.csda.2021.107250>

See Also

DALSM.object, print.DALSM, plot.DALSM.

Examples

require(DALSM)
data(DALSM_IncomeData)
resp = DALSM_IncomeData[,1:2]
fit = DALSM(y=resp,
            formula1 = ~twoincomes+s(age)+s(eduyrs),
            formula2 = ~twoincomes+s(age)+s(eduyrs),
            data = DALSM_IncomeData)
data2 = data.frame(age=c(40,60),eduyrs=c(18,12))
predict(fit, data = DALSM_IncomeData, newdata=data2, probs=c(.2,.5,.8))

[Package DALSM version 0.9.1 Index]