regress {slca} | R Documentation |
Regress Exogenous Variables on Latent Variables
Description
This function performs regression analysis to explore the influence of exogenous (external) variables on the latent class variables within an estimated slca
model. It utilizes logistic regression and employs a three-step approach.
Usage
regress(object, ...)
## S3 method for class 'slca'
regress(
object, formula, data = parent.frame(),
imputation = c("modal", "prob"),
method = c("naive", "BCH", "ML"), ...
)
Arguments
object |
an object of class |
... |
additional arguments. |
formula |
a formula defining the regression model, including both latent class variables from the estimated model and any exogenous (external) variables. |
data |
an optional data frame containing the exogenous variables of interest. |
imputation |
the imputation method for imputing (assigning) latent class variables. Possible values are:
|
method |
the method used to adjust bias in the three-step approach, with options including "naive", "BCH", and "ML". |
Value
A list
with following components:
coefficients |
a matrix of regression coefficients representing the odds ratios of each class against the baseline class (the last class). |
std.err |
a matrix of standard errors corresponding to the regression coefficients. |
vcov |
the calculated variance-covariance matrix for the regression coefficients. |
dim |
the dimensions of the coefficients matrix. |
ll |
the log likelihood of the regression model. |
Using the summary
function, you can print coefficients, standard errors, corresponding Wald statistics, and p-values for these statistics.
References
Vermunt, J. K. (2010). Latent Class Modeling with Covariates: Two Improved Three-Step Approaches. Political Analysis, 18(4), 450–469. http://www.jstor.org/stable/25792024
Examples
library(magrittr)
names(nlsy97)
nlsy_jlcpa %>% regress(smk98 ~ SEX, nlsy97)
nlsy_jlcpa %>% regress(drk98 ~ SEX, nlsy97)
nlsy_jlcpa %>% regress(mrj98 ~ SEX, nlsy97)
nlsy_jlcpa %>% regress(use98 ~ SEX, nlsy97)
nlsy_jlcpa %>% regress(prof ~ SEX, nlsy97)