Skip to contents

Computes MGCFA model for a given pair of groups

Usage

pairwiseFit(
  model,
  data,
  group = "cntry",
  constraints = c(""),
  pairs.of.groups = NULL,
  message = "Fitting pairwise lavaan models",
  shiny = FALSE,
  signed = F,
  quiet = F,
  ...
)

Arguments

model

Model in lavaan syntax

data

Data object

group

Character. Group variable name.

constraints

Can be "", "loadings", or c("loadings", "intercepts").

pairs.of.groups

Full list of pairs of groups, used in shiny only.

message

Notification in shiny.

shiny

If it is executed in shiny environment.

signed

Only for DMACS, if the signed version should be used. See Nye et al 2019

...

Arguments passed to cfa function.

Value

The function returns matrix of fit indices for multiple group CFA models fitted to each possible pair of groups.

Details

Mostly for internal use within incrementalFit

Examples

if (FALSE) { # \dontrun{ 
 pairwiseFit(model = "F =~ impfree + iphlppl + ipsuces + ipstrgv", 
             data = ess6, 
             group = "cntry", 
             constraints = "loadings")
} # }