if (FALSE) {
# Real data example
data(SCS)
# Without purification
difMantel.poly(data = SCS[, 1:10], group = SCS$Gender, focal.name = 1,
ref.name = 2, purify = FALSE)
# Without purification and restscore
difMantel.poly(data = SCS[, 1:10], group = SCS$Gender, focal.name = 1,
ref.name = 2, purify = TRUE,match = "restscore")
# With purification
difMantel.poly(data = SCS[, 1:10], group = SCS$Gender, focal.name = 1,
ref.name = 2, purify = TRUE)
# With simulated data
set.seed(1234)
# original item parameters
a <- rlnorm(10, -0.5) # slopes
b <- runif(10, -2, 2) # difficulty
d <- list()
d[[1]] <- c(0, 2, .5, -.15, -1.1)
d[[2]] <- c(0, 2, .25, -.45, -.75)
d[[3]] <- c(0, 1, .5, -.65, -1)
d[[4]] <- c(0, 2, .5, -.85, -2)
d[[5]] <- c(0, 1, .25, -.05, -1)
d[[6]] <- c(0, 2, .5, -.95, -1)
d[[7]] <- c(0, 1, .25, -.35, -2)
d[[8]] <- c(0, 2, .5, -.15, -1)
d[[9]] <- c(0, 1, .25, -.25, -2)
d[[10]] <- c(0, 2, .5, -.35, -1)
# Uniform DIF
It <- 10; NR <- 1000; NF <- 1000
ItDIFa <- NULL; Ga <- NULL
ItDIFb <- c(1, 3)
Gb <- rep(.5, 2)
Out.Unif <- SimPolyDif(It, ItDIFa, ItDIFb, NR, NF, a, b, d,
ncat = 5, Ga = Ga, Gb = Gb)
Out.Unif$ipars
Data <- Out.Unif$data
# Without purification and rest score
difMantel.poly(data = Data[, 1:10], group = Data$group, focal.name = "G1",
ref.name = "G2", purify = FALSE,match = "restscore")
# With purification
difMantel.poly(data = Data[, 1:10], group = Data$group, focal.name = "G1",
ref.name = "G2", purify = TRUE)
# We implemented a specific S3 plot method: plot.Logistic. It can be used as follows:
res <- difMantel.poly(data = Data[, 1:10], group = Data$group, focal.name = "G1",
ref.name = "G2", purify = FALSE)
plot.MHPoly(res)
}
Run the code above in your browser using DataLab