RでMauchly’s sphericity testを行う

RでMauchly’s sphericity testを行う.
基本は以下のサイトに従う.
https://biostats.w.uib.no/test-for-sphericity-mauchly-test/

library(car) # carライブラリをload

# データを定義
weight<-c(1.028016298,1.721868575,...) 
weight
my.new.matrix<-matrix(weight, nrow=10, ncol=6)
my.new.matrix

# 線形モデルを構築
model<-lm(my.new.matrix ~ 1)
design<-factor(c("c0","c1","c2", "c3", "c4", "c5"))

# Anova実行
options(contrasts=c("contr.sum", "contr.poly"))
results<-Anova(model, idata=data.frame(design), idesign=~design, type="III")
summary(results, multivariate=F)

出力の中頃にMauchly's testの結果が出てくる.