est_univ_mods {gspcr} | R Documentation |
Estimate simple GLM models
Description
Given a dependent variable, a set of possible predictors, and a GLM family, this function estimates a null GLM and all of the simple GLMs.
Usage
est_univ_mods(dv, ivs, fam)
Arguments
dv |
numeric vector or factor of dependent variable values |
ivs |
|
fam |
character vector of length 1 storing the description of the error distribution and link function to be used in the model (see |
Details
We use the expression "simple GLM models" to describe GLM models with a single dependent variable and a single predictor.
Value
List containing:
-
ll0
: log-likelihoods for the null model -
lls
: log-likelihoods for all the simple models -
coefs
: ifdv
andivs
are continuous, standardized simple regression coefficients
Author(s)
Edoardo Costantini, 2023
Examples
# Run the function on the example data set
dv_con_ivs_con <- est_univ_mods(
dv = GSPCRexdata$y$cont,
ivs = GSPCRexdata$X$cont,
fam = "gaussian"
)