add_fscores: Computes and adds factor scores based on CFA

Description Usage Arguments

View source: R/add_fscores.r

Description

Creates and adds factor scores to the data frame that was used to estimate the CFA.

Usage

1
2
3
4
5
6
7
8
add_fscores(
  data,
  object,
  rename_vars = NULL,
  id = NULL,
  to_wide = FALSE,
  group = NULL
)

Arguments

data

The data frame that was originally passed to cfa() or sem().

object

An object of class lavaan created by using cfa().

rename_vars

A vector that represents new names for the factor scores.

id

Variable that identifies each individual case in the data frame. Only necessary if the data frame is in the long format. or sem().

to_wide

A logical value indicating whether the multigroup factor scores should be passed to long or to a wide format data frame.

group

A vector representing the grouping variable in the long format that was passed to data.


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