Learn R Programming

exametrika (version 2.0.0)

add_M2: Attach the margin-based fit indices to a fitted model

Description

Computes M2 for the model and for the independence baseline, and returns the fitted object with a TestFitIndicesM2 component added. The print method then shows the response-pattern indices and the margin-based ones side by side.

This is a separate step rather than part of the fit because it is expensive: the cost is the Cholesky factorisation of a dense matrix whose size grows with the square of the item count (see M2).

Usage

add_M2(x, ...)

# S3 method for default add_M2(x, ...)

# S3 method for nominalLCA add_M2(x, verbose = TRUE, gc = TRUE, ...)

# S3 method for ratedLCA add_M2(x, verbose = TRUE, gc = TRUE, ...)

# S3 method for LRAordinal add_M2(x, verbose = TRUE, gc = TRUE, ...)

# S3 method for ordinalBiclustering add_M2(x, verbose = TRUE, gc = TRUE, ...)

# S3 method for nominalBiclustering add_M2(x, verbose = TRUE, gc = TRUE, ...)

Value

The fitted object with TestFitIndicesM2 added.

Arguments

x

A fitted model object of class "exametrika".

...

Additional arguments passed to methods.

verbose

Logical; if TRUE (default), reports the size of the margin covariance matrix before computing it when that matrix is large.

gc

Logical; if TRUE (default), releases the workspace before returning. See M2.

Examples

Run this code
# \donttest{
dat <- dataFormat(J20S600, response.type = "nominal")
fit <- LCA(dat, ncls = 3)
fit <- add_M2(fit)
fit
print(fit, fit_indices = "margin")
# }

Run the code above in your browser using DataLab