Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test fixes

  • Loading branch information...
commit 1ceae1ba97cedc70f515648d3ed278a274f4409e 1 parent 1b81623
@philchalmers authored
View
1  inst/tests/confmods/MGmodel1
@@ -1 +0,0 @@
-F1 = 1-15
View
3  inst/tests/confmods/MGmodelg1
@@ -1,3 +0,0 @@
-F1 = 1-5
-F2 = 6-10
-F3 = 11-15
View
4 inst/tests/confmods/MGmodelg2
@@ -1,4 +0,0 @@
-F1 = 1-5
-F2 = 6-10
-F3 = 11-15
-COV = F1*F2, F1*F3, F2*F3
View
1  inst/tests/confmods/mixedmirt1
@@ -1 +0,0 @@
-Theta = 1-10
View
3  inst/tests/confmods/model1
@@ -1,3 +0,0 @@
-F1 = 1-4
-F2 = 4-8
-COV = F1 * F2
View
3  inst/tests/confmods/modelcombo
@@ -1,3 +0,0 @@
-F1 = 1-4
-F2 = 5-8
-(F1*F2) = 1,5
View
2  inst/tests/confmods/modelquad
@@ -1,2 +0,0 @@
-F = 1-8
-(F*F) = 1-4
View
21 inst/tests/test-05-confmirtTwo.R
@@ -29,10 +29,25 @@ test_that('confirmatory mods', {
#analyses
#CIFA for 2 factor crossed structure
+ model1 <- '
+ F1 = 1-4
+ F2 = 4-8
+ COV = F1*F2'
+
+ modelquad <- '
+ F = 1-8
+ (F*F) = 1-4
+ '
+
+ modelcombo <- '
+ F1 = 1-4
+ F2 = 5-8
+ (F1*F2) = 1,5
+ '
- model.1 <- confmirt.model('confmods/model1', quiet = TRUE)
- model.quad <- confmirt.model('confmods/modelquad', quiet = TRUE)
- model.combo <- confmirt.model('confmods/modelcombo', quiet = TRUE)
+ model.1 <- confmirt.model(model1, quiet = TRUE)
+ model.quad <- confmirt.model(modelquad, quiet = TRUE)
+ model.combo <- confmirt.model(modelcombo, quiet = TRUE)
mod1 <- confmirt(dataset,model.1, verbose = FALSE)
expect_is(mod1, 'ConfirmatoryClass')
View
3  inst/tests/test-06-multipleGroupOne.R
@@ -10,7 +10,8 @@ test_that('one factor', {
dataset2 <- simdata(a, d, N, itemtype, mu = .1, sigma = matrix(1.5))
dat <- rbind(dataset1, dataset2)
group <- c(rep('D1', N), rep('D2', N))
- models <- confmirt.model('confmods/MGmodel1', quiet = TRUE)
+ MGmodel1 <- 'F1 = 1-15'
+ models <- confmirt.model(MGmodel1, quiet = TRUE)
mod_configural <- multipleGroup(dat, models, group = group, verbose = FALSE, method = 'EM')
expect_is(mod_configural, 'MultipleGroupClass')
View
7 inst/tests/test-07-mixedmirt.R
@@ -11,12 +11,14 @@ test_that('mixed dich', {
group <- factor(rep(c('G1','G2','G3'), each = N/3))
data <- simdata(a,d,N, itemtype = rep('dich',10), Theta=Theta)
covdata <- data.frame(group, pseudoIQ)
+ mixedmirt1 <- 'Theta = 1-10'
+ model <- confmirt.model(mixedmirt1, quiet = TRUE)
- model <- confmirt.model('confmods/mixedmirt1', quiet = TRUE)
#group as a fixed effect predictor (aka, uniform dif)
mod1 <- mixedmirt(data, covdata, model, fixed = ~ group, itemtype = 'Rasch', verbose = FALSE,
fixed.constrain = TRUE)
expect_is(mod1, 'MixedClass')
+
#model using 2PL items instead of only Rasch
mod1b <- mixedmirt(data, covdata, model, fixed = ~ group, verbose = FALSE, fixed.constrain = TRUE)
expect_is(mod1b, 'MixedClass')
@@ -37,7 +39,8 @@ test_that('item covs', {
Theta <- matrix(rnorm(N))
data <- simdata(a, d, N, itemtype = rep('dich',10), Theta=Theta, D=1)
itemdesign <- data.frame(itempred=rep(1, ncol(data)))
- model <- confmirt.model('confmods/mixedmirt1', quiet = TRUE)
+ mixedmirt1 <- 'Theta = 1-10'
+ model <- confmirt.model(mixedmirt1, quiet = TRUE)
sv <- mixedmirt(data, model = model, fixed = ~ itempred, pars = 'values',
itemtype = 'Rasch', itemdesign = itemdesign)
sv$value[sv$name == 'd'] <- 0
View
14 inst/tests/test-08-multipleGroupTwo.R
@@ -13,10 +13,20 @@ test_that('three factor', {
dataset2 <- simdata(a, d, N, itemtype, mu = mu, sigma = sigma)
dat <- rbind(dataset1, dataset2)
group <- c(rep('D1', N), rep('D2', N))
+ MGmodelg1 <- '
+ F1 = 1-5
+ F2 = 6-10
+ F3 = 11-15'
+
+ MGmodelg2 <- '
+ F1 = 1-5
+ F2 = 6-10
+ F3 = 11-15
+ COV = F1*F2, F1*F3, F2*F3'
#group models
- model1 <- confmirt.model('confmods/MGmodelg1', quiet = TRUE)
- model2 <- confmirt.model('confmods/MGmodelg2', quiet = TRUE)
+ model1 <- confmirt.model(MGmodelg1, quiet = TRUE)
+ model2 <- confmirt.model(MGmodelg2, quiet = TRUE)
models <- list(D1=model1, D2=model2)
mod_metric <- multipleGroup(dat, models, group = group, invariance=c('slopes'), method = 'MHRM',

0 comments on commit 1ceae1b

Please sign in to comment.
Something went wrong with that request. Please try again.