Learn R Programming

betaselectr (version 0.1.3)

coef.lav_betaselect: Coefficients of a 'lav_betaselect'-Class Object

Description

Return the betas-select in a 'lav_betaselect'-class object.

Usage

# S3 method for lav_betaselect
coef(object, drop_na = FALSE, ...)

Value

A numeric vector: The betas-select in the object. The names of parameters follow the convention in lavaan.

Arguments

object

The output of lav_betaselect().

drop_na

Logical. Whether betas-select with NA are dropped. Default is FALSE.

...

Optional arguments. Not used.

Details

It just extracts and returns the column est from the object: the betas-select, with selected variables standardized.

See Also

lav_betaselect()

Examples

Run this code

library(lavaan)
# Need to mean-center iv and mod
data_test_medmod$iv <- data_test_medmod$iv - mean(data_test_medmod$iv)
data_test_medmod$mod <- data_test_medmod$mod - mean(data_test_medmod$mod)
mod <-
"
med ~ iv + mod + iv:mod
dv ~ med + iv
"
fit <- sem(mod,
           data_test_medmod,
           fixed.x = TRUE)
summary(fit)
fit_beta <- lav_betaselect(fit,
                           to_standardize = c("iv", "dv"))
coef(fit_beta)

Run the code above in your browser using DataLab