spls (version 2.2-3)

ci.spls: Calculate bootstrapped confidence intervals of SPLS coefficients

Description

Calculate bootstrapped confidence intervals of coefficients of the selected predictors and generate confidence interval plots.

Usage

ci.spls( object, coverage=0.95, B=1000,
        plot.it=FALSE, plot.fix="y",
        plot.var=NA, K=object$K, fit=object$fit )

Arguments

object

A fitted SPLS object.

coverage

Coverage of confidence intervals. coverage should have a number between 0 and 1. Default is 0.95 (95\(\%\) confidence interval).

B

Number of bootstrap iterations. Default is 1000.

plot.it

Plot confidence intervals of coefficients?

plot.fix

If plot.fix="y", then plot confidence intervals of the predictors for a given response. If plot.fix="x", then plot confidence intervals of a given predictor across all the responses. Relevant only when plot.it=TRUE.

plot.var

Index vector of responses (if plot.fix="y") or predictors (if plot.fix="x") to be fixed in plot.fix. The indices of predictors are defined among the set of the selected predictors. Relevant only when plot.it=TRUE.

K

Number of hidden components. Default is to use the same K as in the original SPLS fit.

fit

PLS algorithm for model fitting. Alternatives are "kernelpls", "widekernelpls", "simpls", or "oscorespls". Default is to use the same PLS algorithm as in the original SPLS fit.

Value

Invisibly returns a list with components:

cibeta

A list with as many matrix elements as the number of responses. Each matrix element is p by 2, where i-th row of the matrix lists the upper and lower bounds of the bootstrapped confidence interval of the i-th predictor.

betahat

Matrix of original coefficients of the SPLS fit.

lbmat

Matrix of lower bounds of confidence intervals (for internal use).

ubmat

Matrix of upper bounds of confidence intervals (for internal use).

References

Chun H and Keles S (2010), "Sparse partial least squares for simultaneous dimension reduction and variable selection", Journal of the Royal Statistical Society - Series B, Vol. 72, pp. 3--25.

See Also

correct.spls and spls.

Examples

Run this code
# NOT RUN {
data(mice)
# SPLS with eta=0.6 & 1 hidden components
f <- spls( mice$x, mice$y, K=1, eta=0.6 )
# Calculate confidence intervals of coefficients
ci.f <- ci.spls( f, plot.it=TRUE, plot.fix="x", plot.var=20 )
# Bootstrapped confidence intervals
cis <- ci.f$cibeta
cis[[20]]   # equivalent, 'cis$1422478_a_at'
# }

Run the code above in your browser using DataCamp Workspace