DALSM_additive {DALSM}R Documentation

Extraction of the estimated additive terms in a DALSM.object

Description

Extract the estimated additive terms with their standard errors from a DALSM.object resulting from the fit of a DALSM model. In addition to the estimated functions in the location and dispersion submodels, their values on a regular grid covering the observed covariate values are reported together with credible intervals. The mean effective coverage of these pointwise credible intervals for the additive terms with respect to given (optional) reference functions (such as the ones for the 'true' additive terms used to generate data in a simulation study) can also be computed.

Usage

DALSM_additive(obj.DALSM, ngrid=101,
       true.loc=NULL, true.disp=NULL, ci.level=NULL,
       verbose=FALSE)

Arguments

obj.DALSM

a DALSM.object

ngrid

(optional) grid size of covariate values where the additive terms are calculated (default: 101).

true.loc

(optional) list of functions containing the 'true' additive terms in the location sub-model.

true.disp

(optional) list of functions containing the 'true' additive terms in the dispersion sub-model.

ci.level

(optional) level of credible intervals.

verbose

logical indicating whether the computed corverages should be printed out (default: TRUE).

Value

It returns an invisible 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, DALSM, 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)
obj = DALSM_additive(fit)
str(obj)

## Visualize the estimated additive terms for Age
## ... in the location submodel
with(obj$f.loc.grid$age, matplot(x,y.mat,
                                 xlab="Age",ylab="f.loc(Age)",
                                 type="l",col=1,lty=c(1,2,2)))
## ... and in the dispersion submodel
with(obj$f.disp.grid$age, matplot(x,y.mat,
                                 xlab="Age",ylab="f.disp(Age)",
                                 type="l",col=1,lty=c(1,2,2)))
## Also report their values for selected age values
obj$f.loc$age(c(30,40,50)) ; obj$f.disp$age(c(30,40,50))
## ... together with their standard errors
obj$se.loc$age(c(30,40,50)) ; obj$se.disp$age(c(30,40,50))

[Package DALSM version 0.9.1 Index]