print_rel: Print reliabilities of a latent factor

Description Usage Arguments Examples

View source: R/print_rel.r

Description

This function takes the output of rel_table and transforms it into latex-code to be used in a rmarkdown file.

Usage

1
2
3
4
5
6
print_rel(
  object,
  var = NULL,
  rel_values = c("alpha", "omega3", "avevar"),
  list = F
)

Arguments

list

Logical value indicating whether each estimate should be printed separately and put into a list.

rel_table

A dataframe resulting from rel_table.

indices

Vector of the indices that should be in the ouput.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
library(lavaan)
model <- '
  # latent variables
  ind60 =~ x1 + x2 + x3
  dem60 =~ y1 + y2 + y3 + y4
  dem65 =~ y5 + y6 + y7 + y8
  
  # regressions
  dem60 ~ ind60
  dem65 ~ ind60 + dem60
  
  # residual covariances
  y1 ~~ y5
  y2 ~~ y4 + y6
  y3 ~~ y7
  y4 ~~ y8
  y6 ~~ y8
'
fit <- sem(model,
           data = PoliticalDemocracy)

# First step
table <- rel_table(fit)

# Second step
print_rel(table)

masurp/pmstats documentation built on Oct. 6, 2020, 9:24 p.m.