Learn R Programming

CFM (version 0.8.0)

censored_factor_models: Basic censored-factor data simulator

Description

Generates multivariate data that follow a latent factor structure with censored errors (Normal, Student-t or Logistic).

Usage

censored_factor_models(
  n,
  p,
  m,
  distribution = c("normal", "t", "logistic"),
  df = NULL,
  seed = NULL
)

Value

A list with components:

data

numeric n × p matrix of observations

loadings

p × m factor loadings matrix

uniqueness

p × p diagonal uniqueness matrix

KMO

KMO measure of sampling adequacy

Bartlett_p

p-value of Bartlett's test

distribution

error distribution used

seed

random seed

Arguments

n

Sample size (> 0).

p

Number of observed variables (> 0).

m

Number of latent factors (< p).

distribution

Error distribution: "normal" (default), "t", "logistic".

df

Degrees of freedom when distribution = "t".

seed

Optional random seed.

Examples

Run this code
# \donttest{
set.seed(2025)
obj <- censored_factor_models(200, 6, 2)
psych::KMO(obj$data)
# }

Run the code above in your browser using DataLab