Extract Model Coefficients from a ftmglm or ftmlm object
coef-ftmglm-method.RdExtracts the beta coefficients from a ftmglm or
ftmlm model. Allows coefficients to be estimated using a given set of variables.
Details
When select is specified, only the coefficients for the selected variables are calculated.
The ridge penalty parameter s is only applicable to ftmlm models.
Note
The use of a ridge penalty is not applicable to ftmglm models and will be ignored if specified.
See also
predict,ftmglm-method and predict,ftmlm-method for methods to make
predictions using model objects.
Examples
if (FALSE) { # \dontrun{
# Assuming ftmglmModel and ftmlmModel are pre-fitted model objects
# Extract all coefficients from a ftmglm model
coeffs_glm <- coef(ftmglmModel)
# Extract coefficients for specific variables from a ftmglm model
coeffs_glm_select <- coef(ftmglmModel, select = c("var1", "var2"))
# Extract all coefficients from a ftmlm model with a ridge penalty
coeffs_lm <- coef(ftmlmModel, s = 0.1)
# Extract coefficients for specific variables from a ftmlm model with no penalty
coeffs_lm_select <- coef(ftmlmModel, select = c("var1", "var2"))
} # }