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

n \times p data.frame of independent variables (factors allowed)

fam

character vector of length 1 storing the description of the error distribution and link function to be used in the model (see cv_gspcr() for the list of possible options)

Details

We use the expression "simple GLM models" to describe GLM models with a single dependent variable and a single predictor.

Value

List containing:

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"
)


[Package gspcr version 0.9.5 Index]