Coefficients of a 'lav_betaselect'-Class Object
Source:R/coef_lav_betaselect.R
coef.lav_betaselect.Rd
Return the betas-select in a 'lav_betaselect'-class object.
Usage
# S3 method for class 'lav_betaselect'
coef(object, drop_na = FALSE, ...)
Arguments
- object
The output of
lav_betaselect()
.- drop_na
Logical. Whether betas-select with
NA
are dropped. Default isFALSE
.- ...
Optional arguments. Not used.
Value
A numeric vector: The betas-select
in the object. The names of parameters
follow the convention in lavaan
.
Details
It just extracts and
returns the column est
from
the object: the betas-select, with
selected variables standardized.
Author
Shu Fai Cheung https://orcid.org/0000-0002-9871-9448
Examples
library(lavaan)
#> This is lavaan 0.6-19
#> lavaan is FREE software! Please report any bugs.
mod <-
"
med ~ iv + mod + iv:mod
dv ~ med + iv
"
fit <- sem(mod,
data_test_medmod,
fixed.x = TRUE)
summary(fit)
#> lavaan 0.6-19 ended normally after 3 iterations
#>
#> Estimator ML
#> Optimization method NLMINB
#> Number of model parameters 7
#>
#> Number of observations 200
#>
#> Model Test User Model:
#>
#> Test statistic 2.685
#> Degrees of freedom 2
#> P-value (Chi-square) 0.261
#>
#> Parameter Estimates:
#>
#> Standard errors Standard
#> Information Expected
#> Information saturated (h1) model Structured
#>
#> Regressions:
#> Estimate Std.Err z-value P(>|z|)
#> med ~
#> iv -6.339 0.997 -6.357 0.000
#> mod -3.903 0.622 -6.277 0.000
#> iv:mod 0.286 0.039 7.248 0.000
#> dv ~
#> med 0.093 0.011 8.298 0.000
#> iv 0.229 0.039 5.917 0.000
#>
#> Variances:
#> Estimate Std.Err z-value P(>|z|)
#> .med 61.851 6.185 10.000 0.000
#> .dv 2.104 0.210 10.000 0.000
#>
fit_beta <- lav_betaselect(fit,
to_standardize = c("iv", "dv"))
coef(fit_beta)
#> med~iv med~mod med~iv:mod dv~med dv~iv
#> -17.69726186 -3.90320725 0.79715974 0.04874437 0.33334073
#> med~~med dv~~dv iv~~iv iv~~mod iv~~iv:mod
#> 61.85098096 0.57409180 1.00000000 1.89369830 35.18916975
#> mod~~mod mod~~iv:mod iv:mod~~iv:mod
#> 23.12940750 174.84683241 1862.98287427