predict.compCL: Make predictions based on a '"compCL"' object.

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/tools.R

Description

Make predictions based on a fitted "compCL" object.

Usage

1
2
## S3 method for class 'compCL'
predict(object, Znew, Zcnew = NULL, s = NULL, ...)

Arguments

object

fitted "compCL" object.

Znew

z matrix as in compCL with new compositional data or categorical data.

Zcnew

Zc matrix as in compCL with new data for other covariates. Default is NULL

s

value(s) of the penalty parameter lam at which predictions are required. Default is the entire sequence used in the fitted object.

...

not used.

Details

s is the vector at which predictions are requested. If s is not in the lambda sequence used for fitting the model, the predict function uses linear interpolation.

Value

predicted values at the requested values of s.

Author(s)

Zhe Sun and Kun Chen

References

Lin, W., Shi, P., Peng, R. and Li, H. (2014) Variable selection in regression with compositional covariates, https://academic.oup.com/biomet/article/101/4/785/1775476. Biometrika 101 785-979.

See Also

compCL and coef, predict and plot methods for "compCL" object.

Examples

1
2
3
4
5
6
Comp_data = comp_Model(n = 50, p = 30)
Comp_data2 = comp_Model(n = 30, p = 30, beta = Comp_data$beta)
m1 = compCL(y = Comp_data$y, Z = Comp_data$X.comp,
            Zc = Comp_data$Zc, intercept = Comp_data$intercept)
predict(m1, Znew = Comp_data2$X.comp, Zcnew = Comp_data2$Zc)
predict(m1, Znew = Comp_data2$X.comp, Zcnew = Comp_data2$Zc, s = c(1, 0.5, 0.1))

Compack documentation built on July 1, 2020, 10:26 p.m.