predict.DALSM {DALSM} | R Documentation |
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.
## S3 method for class 'DALSM'
predict(object, newdata, probs, ...)
object |
a |
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. |
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.
Philippe Lambert p.lambert@uliege.be
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>
DALSM.object
, print.DALSM
, plot.DALSM
.
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))