coef: Extract coefficients from fitted model

coef.smleR Documentation

Extract coefficients from fitted model

Description

Extract coefficients from fitted model for either a 'smle' or 'selection' object.

Usage

## S3 method for class 'smle'
coef(object, refit = TRUE, ...)

## S3 method for class 'selection'
coef(object, refit = TRUE, ...)

Arguments

object

Returned object from either the function SMLE() or smle_select().

refit

A logical flag that controls what coefficients are being return. Default is TRUE.

...

This argument is not used and listed for method consistency.

Value

Fitted coefficients based on the screened or selected model specified in the object. If refit = TRUE, the coefficients are estimated by re-fitting the final screened/selected model with glm(). If refit = FALSE the coefficients estimated by the IHT algorithm are returned.

Examples


set.seed(1)
Data<-Gen_Data(n=100, p=5000, family = "gaussian", correlation="ID")
fit<-SMLE(Y = Data$Y, X = Data$X, k=15, family = "gaussian")
coef(fit)
fit_s<-smle_select(fit)
coef(fit_s)

SMLE documentation built on Jan. 22, 2023, 1:55 a.m.