lav: Generic SEM Fit Function

Description Usage Arguments

View source: R/med.R

Description

Fits a specified SEM model on given data using lavaan.

Usage

1
2
3
4
5
6
7
8
9
lav(
  data,
  model,
  raw_data = TRUE,
  mean_vector = NULL,
  n = NULL,
  minimal = TRUE,
  ...
)

Arguments

data

If raw_data = TRUE, sample raw data. The column names must contain observed variable names. If raw_data = FALSE, numeric matrix. A sample variance-covariance matrix. The raw names and column names must contain observed variable names.

model

Specified model to fit following lavaan notation.

raw_data

Logical. If TRUE, data is a sample raw data. If FALSE, data is a sample variance-covariance matrix.

mean_vector

A sample mean vector. Ignored if raw_data = TRUE.

n

Sample size. Ignored if raw_data = TRUE.

minimal

Logical. If TRUE, returns the indirect effect of X on Y through M. If FALSE, returns all the regression coefficients estimated.

...

Arguments to pass to lavaan::sem.


jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.