if (FALSE) {
# Numerical example for post hoc power analysis for PCM
y <- eRm::pcmdat2
n <- nrow(y) # sample size
x <- c( rep(0,n/2), rep(1,n/2) ) # binary covariate
res <- post_hocPCM(data = y, splitcr = x, alpha = 0.05)
# > res
# $test
# W LR RS GR
# 11.395 11.818 11.628 11.978
#
# $power
# W LR RS GR
# 0.683 0.702 0.694 0.709
#
# $dev_global #`observed global deviation`
# W LR RS GR
# 0.045 0.046 0.045 0.047
#
# $ dev_local #`observed local deviation`
# I1-C2 I2-C1 I2-C2 I3-C1 I3-C2 I4-C1 I4-C2
# group1 2.556 0.503 2.573 -2.573 -2.160 -1.272 -0.683
# group2 2.246 0.878 3.135 -1.852 -0.824 -0.494 0.941
#
# $score_dist_group1 #`person score distribution in group 1`
#
# 1 2 3 4 5 6 7
# 0.016 0.097 0.137 0.347 0.121 0.169 0.113
#
# $score_dist_group2 #`person score distribution in group 2`
#
# 1 2 3 4 5 6 7
# 0.015 0.083 0.136 0.280 0.152 0.227 0.106
#
# $df #`degrees of freedom`
# [1] 7
#
# $ncp #`noncentrality parameter`
# W LR RS GR
# 11.395 11.818 11.628 11.978
#
# $call
# post_hocPCM(alpha = 0.05, data = y, x = x)
}
Run the code above in your browser using DataLab