library(discnorm )
The discnorm package uses bootstrapping to help determine whether the commonly assumed normality assumption is tenable for an ordinal dataset. Researchers wanting to proceed with ordinal SEM based on polychoric correlations need first to check that the normality assumption is not violated.
The procedure is fully described in Foldnes and Grønneberg (2019)
The procedure is named bootTest() and operates on an ordinal dataset and returns a p-value associated with the null-hypothesis of underlying normality. Let us first use the test for a dataset that is produced by underlying normality.
#let us discretize an underlying normal vector
# with moderate correlation
<- 0.3
rho <- diag(5)
Sigma !=1] <- rho
Sigma[Sigma set.seed(1234)
<- MASS::mvrnorm(n=200, mu=rep(0,5), Sigma=Sigma)
norm.sample # let us discretize into 4 categories
<- apply(norm.sample, 2, cut, breaks=c(-Inf, -1, 1, 2, Inf), labels=FALSE)
disc.sample
#check for underlying normality
<- bootTest(disc.sample, B=500)
pvalue #> Progress 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
print(pvalue)
#> [1] 0.918
# we have no evidence against the null hypothesis of underlying normality
And let us discretize a non-normal dataset
<- data.frame(norm.sample[, 1:4], norm.sample[,1]*norm.sample[,2])
nonnorm.sample <- apply(nonnorm.sample, 2, cut, breaks=c(-Inf, -1, 1, 2, Inf), labels=FALSE)
disc.sample2 <- bootTest(disc.sample2, B=500)
pvalue #> Progress 0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%
print(pvalue)
#> [1] 0
# rejected!