Learn R Programming

spls (version 1.0-0)

ci.spls: Calculate the bootstrapped confidence intervals of SPLS coefficients

Description

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

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 the 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 the confidence intervals of the coefficients?
plot.fix
If plot.fix="y", then it plots the confidence intervals of the predictors for a given response. If plot.fix="x", then it plots the confidence intervals of a given predictor acros
plot.var
Index vector of the 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
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 al

Value

  • Invisibly returns a list with components:
  • cibetaA list with as many matrix elements as the number of responses. Each matrix element is p by 2, where ith row of the matrix lists the upper and lower bounds of the bootstrapped confidence interval of the ith predictor.
  • betahatMatrix of the original coefficients of the SPLS fit.
  • lbmatMatrix of the lower bounds of confidence intervals (for internal use).
  • ubmatMatrix of the upper bounds of confidence intervals (for internal use).

References

Chun, H. and Keles, S. (2007). "Sparse partial least squares for simultaneous dimension reduction and variable selection", (http://www.stat.wisc.edu/~keles/Papers/SPLS_Nov07.pdf).

See Also

correct.spls and spls.

Examples

Run this code
data(mice)
# SPLS with eta=0.6 & 1 hidden components
f <- spls( mice$x, mice$y, K=1, eta=0.6 )
# Calculate the 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 DataLab