Skip to content

Instantly share code, notes, and snippets.

View soumyaray's full-sized avatar

Soumya Ray soumyaray

View GitHub Profile
@soumyaray
soumyaray / seminr-csem-compare.R
Created October 8, 2024 12:30
DEMO: SEMinR - cSEM comparison (response to comment on Reddit)
# Code below demonstrates similar/same results from SEMinR and cSEM for given model
# Needed changing default value of .disattenuate for cSEM
# Response to: https://www.reddit.com/r/rstats/comments/1fy42vy/structural_equation_model_results_differ_when/
library(seminr)
library(cSEM)
nck <- corp_rep_data
data <- MASS::mvrnorm(1000,mu = rep(0,37),Sigma =diag(1,37))
data <- cbind(mobi, corp_rep_data[1:250,3:17])
colnames(data) <- c(multi_items("A", 1:3),