coef.savvyPR: Extract Coefficients From a Parity Regression Model Object

View source: R/coef.savvyPR.R

coef.savvyPRR Documentation

Extract Coefficients From a Parity Regression Model Object

Description

Extracts the estimated coefficients from a fitted parity regression model object. It seamlessly handles models fitted using either the "budget" or "target" parameterization method.

Usage

## S3 method for class 'savvyPR'
coef(object, ...)

Arguments

object

A fitted model object of class savvyPR.

...

Additional arguments passed to the predict.savvyPR method.

Details

Extract Coefficients From a Parity Regression Model Object

This function is an S3 method for the generic coef function. It extracts the estimated coefficients of the fitted model. The extraction is internally delegated to the predict.savvyPR method with type = "coefficients".

Value

A named numeric vector of the estimated coefficients from the fitted model. If the model was fitted with an intercept, it will be included as the first element.

Author(s)

Ziwei Chen, Vali Asimit and Pietro Millossovich
Maintainer: Ziwei Chen <ziwei.chen.3@citystgeorges.ac.uk>

See Also

savvyPR, predict.savvyPR

Examples

# Generate synthetic data
set.seed(123)
x <- matrix(rnorm(100 * 10), 100, 10)
y <- rnorm(100)

# Example 1: Extract coefficients from a Budget-based model
model_budget <- savvyPR(x, y, method = "budget", val = 0.05)
coef(model_budget)

# Example 2: Extract coefficients from a Target-based model
model_target <- savvyPR(x, y, method = "target", val = 1)
coef(model_target)


savvyPR documentation built on April 7, 2026, 5:08 p.m.