predict.DALSM: Prediction based on a DALSM model

View source: R/predict.DALSM.R

predict.DALSMR 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:

  • mu : ⁠ ⁠estimated conditional mean.

  • sd : ⁠ ⁠estimated conditional standard deviation.

  • quant : ⁠ ⁠estimated quantiles (at probability level probs) of the fitted conditional response in the DALSM model.

  • qerr : ⁠ ⁠quantiles (at probability level probs) of the fitted error distribution in the DALSM model.

  • probs : ⁠ ⁠a reminder of the requested probability levels for the fitted quantiles.

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))

DALSM documentation built on Oct. 2, 2023, 5:09 p.m.