An S4 method returning the estimates of the model parameters.

# S4 method for penfa
coef(object, type = "free", labels = TRUE)

Arguments

object

An object of class penfa, found as a result of a call to penfa.

type

Character. If type="free", only the estimated parameters (both penalized and unpenalized) are returned. If type="user", all parameters listed in the parameter table are returned, including fixed parameters.

labels

Logical. If TRUE, parameters are returned with their names.

Value

A numeric vector of class penfa.vector containing the estimated model parameters.

See also

Examples

data(ccdata) syntax = 'help =~ h1 + h2 + h3 + h4 + h5 + h6 + h7 + 0*v1 + v2 + v3 + v4 + v5 voice =~ 0*h1 + h2 + h3 + h4 + h5 + h6 + h7 + v1 + v2 + v3 + v4 + v5' alasso_fit <- penfa(## factor model model = syntax, data = ccdata, std.lv = TRUE, ## penalization pen.shrink = "alasso", eta = list(shrink = c("lambda" = 0.01), diff = c("none" = 0)), ## automatic procedure strategy = "auto")
#> Computing weights for alasso (ML estimates)... done. #> #> Automatic procedure: #> Iteration 1 : 0.00298271 #> Iteration 2 : 0.00452604 #> #> Largest absolute gradient value: 12.76355181 #> Fisher information matrix is positive definite #> Eigenvalue range: [180.2917, 9189645] #> Trust region iterations: 15 #> Factor solution: admissible #> Effective degrees of freedom: 27.12936
coef(alasso_fit)
#> help=~h1 help=~h2 help=~h3 help=~h4 help=~h5 help=~h6 #> 0.766 0.858 0.775 0.921 0.810 0.782 #> help=~h7 help=~v2 help=~v3 help=~v4 help=~v5 voice=~h2 #> 0.523 0.000 0.000 0.000 0.000 0.000 #> voice=~h3 voice=~h4 voice=~h5 voice=~h6 voice=~h7 voice=~v1 #> 0.000 -0.041 0.053 0.104 0.341 0.851 #> voice=~v2 voice=~v3 voice=~v4 voice=~v5 h1~~h1 h2~~h2 #> 0.871 0.842 0.843 0.805 0.388 0.233 #> h3~~h3 h4~~h4 h5~~h5 h6~~h6 h7~~h7 v1~~v1 #> 0.372 0.184 0.235 0.201 0.264 0.245 #> v2~~v2 v3~~v3 v4~~v4 v5~~v5 help~~voice #> 0.208 0.261 0.259 0.324 0.877