# An IPV that comprises the honesty/humility and the agreeableness factor of
# the HEXACO. Estimation takes some time.
if (FALSE) res <- ipv_est(
HEXACO[ ,grep("^H|^A", names(HEXACO))],
"HA")
nested_chart(res)
# Customize call to lavaan::cfa via ellipsis to treat missing data and use long format
# Estimation takes some time.
if (FALSE) HEXACO_long <- reshape2::melt(
cbind(id = row.names(HEXACO)[1:1000],
HEXACO[1:1000,1:240]),
id.vars = "id")
HEXACO_long$test <- substr(HEXACO_long$variable, 1, 1)
HEXACO_long$facet <- substr(HEXACO_long$variable, 3, 6)
HEXACO_long$item <- substr(HEXACO_long$variable, 8, 13)
HEXACO_long$variable <- NULL
head(HEXACO_long)
res <- ipv_est(
HEXACO_long[HEXACO_long$test %in% c("H", "A"), ],
name = "HA", missing = "fiml")
Run the code above in your browser using DataLab