Skip to content

cfa

const cfa: (syntax, spec) => any = sem

Defined in: index.js:96

Alias: confirmatory factor analysis (same engine, reads better in code).

Fit a structural equation model.

Parameters

syntax

string

lavaan-style model syntax: factor =~ ind1 + ind2 (measurement), y ~ x1 + x2 (regression), a ~~ b ((co)variance), 1*x (fix), NA*x (free a default-fixed parameter)

spec?

cov?

number[][]

Sample covariance (instead of data)

data?

any[]

Rows as objects (column per variable)

n?

number

Sample size (required with cov)

names?

string[]

Variable names (required with cov)

Returns

any

{estimates, fit, Sigma, S, converged, summary()}