predict.coco: Make predictions from a coco object

Description Usage Arguments Value

View source: R/methods.R

Description

Similar to other predict methods, this functions predicts fitted values, logits, coefficients and more from a fitted coco object.

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'coco'
predict(
  object,
  newx,
  s = NULL,
  lambda.pred = NULL,
  type = c("response", "coefficients"),
  ...
)

Arguments

object

Fitted coco model object

newx

matrix of new values for x at which predictions are to be made. Do not include the intercept (this function takes care of that). Must be a matrix. This argument is not used for type=c("coefficients"). This matrix must have the same number of columns originally supplied to the coco fitting function.

s

Value(s) of the penalty parameter lambda at which predictions are required. Default is the entire sequence used to create the model.

lambda.pred

Value(s) of the penalty parameter lambda at which coefficients are extracted to calculate the response based on the matrix of new values newx. Default is lambda.sd.

type

Type of prediction required. Type "coefficients" computes the coefficients at the requested values for s. Type response computes the response based on the covariates values in newx, for coefficients corresponding to lambda value in lambda.pred

...

currently ignored

Value

The object returned depends on type.


celiaescribe/BDcocolasso documentation built on Feb. 11, 2020, 11:41 p.m.