Import surveys, combine into single data frame, delete identifying information, assign IDs, and separate out by scale for item examination.
# https://hansjoerg.me/2018/04/23/rasch-in-r-tutorial/
knitr::knit_hooks$set(
error = function(x, options) {
paste('\n\n<div class="alert alert-danger">',
gsub('##', '\n', gsub('^##\ Error', '**Error**', x)),
'</div>', sep = '\n')
},
warning = function(x, options) {
paste('\n\n<div class="alert alert-warning">',
gsub('##', '\n', gsub('^##\ Warning:', '**Warning**', x)),
'</div>', sep = '\n')
},
message = function(x, options) {
paste('\n\n<div class="alert alert-info">',
gsub('##', '\n', x),
'</div>', sep = '\n')
}
)
# load libraries ----------------------------------------------------------
library(stringi)
library(psych)
library(DT)
library(naniar)
library(UpSetR)
library(nFactors)
library(lavaan)
library(corrplot)
library(tidyr)
library(ggplot2)
library(dplyr)
library("eRm")
library("ltm")
library("difR")
library("psych")
# load data ---------------------------------------------------------------
# alt <- read.csv(file="UBelong Post-Survey Pitt OChem Spring 2022 Alternative Scales_April 28, 2022_12.34.csv", header=T)
# alt <- alt[-c(1,2),]
# alt$scale <- "alt"
#
# orig <- read.csv(file="UBelong Post-Survey Pitt OChem Spring 2022 Original Scales_April 28, 2022_12.35.csv", header=T)
# orig <- orig[-c(1,2),]
# orig$scale <- "orig"
#
# df <- rbind.data.frame(alt, orig)
# df <- subset(df, select = -c(1:19))
# names(df)
# myFun <- function(n) {
# a <- do.call(paste0, replicate(5, sample(LETTERS, n, TRUE), FALSE))
# paste0(a, sprintf("%04d", sample(9999, n, TRUE)), sample(LETTERS, n, TRUE))
# }
# df$id <- myFun(nrow(df))
# write.csv(df, file="imported_anonymized.csv", row.names = F)
df <- read.csv(file="imported_anonymized.csv", header=T)
# extract items -----------------------------------------------------------
# new items
EEochem <- subset(df, select=c(scale,grep("EEochem", colnames(df)))) # entry expectations
CCdisc <- subset(df, select=c(scale,grep("CCdisc", colnames(df)))) # classroom climate
IDochem <- cbind.data.frame(subset(df, select=c(scale,grep("IDochem", colnames(df)))), subset(df, select=grep("FASochem", colnames(df)))) # identity
CSochem <- subset(df, select=grep("CSochem", colnames(df))) # career satisfaction
# established scales
MSchem <- subset(df, select=c(scale,grep("MSchem", colnames(df)))) # discipline growth mindset (chemistry)
IPchem <- subset(df, select=c(scale,grep("IPchem", colnames(df)))) # instructor growth mindset (chemistry)
SEchem <- subset(df, select=c(scale, grep("SEchem", colnames(df)))) # disciplinary self-efficacy (chemistry)
MSochem <- subset(df, select=c(scale, grep("MSochem", colnames(df)))) # disciplinary growth mindset (organic chemistry)
IPochem <- subset(df, select=grep("IPochem", colnames(df))) # instructor growth mindset (organic chemistry)
SEochem <- subset(df, select=grep("SEochem", colnames(df))) # disciplinary self-efficacy (organic chemistry)
CNEBochem <- subset(df, select=c(scale, grep("CNEBochem", colnames(df)))) # entity norms and beliefs
CNHSochem_others <- cbind.data.frame(subset(subset(df, select=grep("CNHSochem", colnames(df))), select=c(1:3))) # help seeking
CNHSochem_self <- cbind.data.frame(subset(subset(df, select=grep("CNHSochem", colnames(df))), select=c(4:6))) # help seeking
CNSWochem <- subset(df, select=grep("CNSWochem", colnames(df))) # help seeking
FCochem <- subset(df, select=grep("FCochem", colnames(df))) # faculty caring
CNEBochem$CNEBochem03_rc[CNEBochem$CNEBochem03 == 1] <- 4
CNEBochem$CNEBochem03_rc[CNEBochem$CNEBochem03 == 2] <- 3
CNEBochem$CNEBochem03_rc[CNEBochem$CNEBochem03 == 3] <- 2
CNEBochem$CNEBochem03_rc[CNEBochem$CNEBochem03 == 4] <- 1
CNEBochem$CNEBochem06_rc[CNEBochem$CNEBochem06 == 1] <- 4
CNEBochem$CNEBochem06_rc[CNEBochem$CNEBochem06 == 2] <- 3
CNEBochem$CNEBochem06_rc[CNEBochem$CNEBochem06 == 3] <- 2
CNEBochem$CNEBochem06_rc[CNEBochem$CNEBochem06 == 4] <- 1
CNEBochem$CNEBochem03 <- CNEBochem$CNEBochem03_rc
CNEBochem$CNEBochem06 <- CNEBochem$CNEBochem06_rc
CNEBochem <- subset(CNEBochem, select=-c(CNEBochem03_rc, CNEBochem06_rc))
Imagine students who scored low on the first exam in this class. What did most students in this class think about the low scoring students?
What did you think about the low scoring students? I thought…
d <- subset(CNEBochem, scale == "orig", select=-c(scale))
CNEBchem_desc <- data.frame(describe(d))
datatable(subset(CNEBchem_desc, select=-c(n, trimmed, mad))) %>%
formatRound(1:10) %>%
formatStyle(8:9, color = styleInterval(c(-2, 2), c('red', 'black', 'red')))
vis_miss(d)
# gg_miss_upset(EEochem)
ggplot(gather(d), aes(value)) +
geom_histogram(bins = 4) +
facet_wrap(~key)
Warning Removed 2 rows containing non-finite values (stat_bin).
corr <- corr.test(d, adjust = "holm")
rval <- corr$r
rval[lower.tri(corr$r, diag = T)] <- NA
datatable(rval) %>%
formatRound(1:ncol(rval)) %>%
formatStyle(1:ncol(rval), color = styleInterval(c(-.7, .7), c('red', 'black', 'red')))
corrplot(corr$r)
d <- na.omit(d)
ev <- eigen(cor(d))
ap <- parallel(subject=nrow(d),var=ncol(d),rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
EFA <- factanal(d, factors = 1, rotation = "promax")
print(EFA, digits=3, cutoff=.0, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 1, rotation = "promax")
##
## Uniquenesses:
## CNEBochem01 CNEBochem02 CNEBochem03 CNEBochem04 CNEBochem05 CNEBochem06
## 0.890 0.411 0.658 0.760 0.285 0.753
##
## Loadings:
## [1] 0.767 0.585 0.845 0.331 0.489 0.497
##
## Factor1
## SS loadings 2.242
## Proportion Var 0.374
##
## Test of the hypothesis that 1 factor is sufficient.
## The chi square statistic is 38.45 on 9 degrees of freedom.
## The p-value is 1.45e-05
d <- na.omit(d)
ev <- eigen(cor(d))
ap <- parallel(subject=nrow(d),var=ncol(d),rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
EFA <- factanal(d, factors = 2, rotation = "promax")
print(EFA, digits=3, cutoff=.25, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 2, rotation = "promax")
##
## Uniquenesses:
## CNEBochem01 CNEBochem02 CNEBochem03 CNEBochem04 CNEBochem05 CNEBochem06
## 0.882 0.489 0.613 0.748 0.086 0.005
##
## Loadings:
## Factor1 Factor2
## CNEBochem02 0.687
## CNEBochem04 0.554
## CNEBochem05 1.014
## CNEBochem06 1.072
## CNEBochem01 0.290
## CNEBochem03 0.304 0.398
##
## Factor1 Factor2
## SS loadings 1.927 1.417
## Proportion Var 0.321 0.236
## Cumulative Var 0.321 0.557
##
## Factor Correlations:
## Factor1 Factor2
## Factor1 1.000 -0.565
## Factor2 -0.565 1.000
##
## Test of the hypothesis that 2 factors are sufficient.
## The chi square statistic is 20.99 on 4 degrees of freedom.
## The p-value is 0.000318
d <- na.omit(d)
ev <- eigen(cor(d))
ap <- parallel(subject=nrow(d),var=ncol(d),rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
EFA <- factanal(d, factors = 3, rotation = "promax", cutoff = 0.3)
print(EFA, digits=3, cutoff=.3, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 3, rotation = "promax", cutoff = 0.3)
##
## Uniquenesses:
## CNEBochem01 CNEBochem02 CNEBochem03 CNEBochem04 CNEBochem05 CNEBochem06
## 0.005 0.488 0.548 0.670 0.005 0.249
##
## Loadings:
## Factor1 Factor2 Factor3
## CNEBochem02 0.597
## CNEBochem05 1.074
## CNEBochem01 1.030
## CNEBochem03 0.559
## CNEBochem06 0.900
## CNEBochem04 0.482
##
## Factor1 Factor2 Factor3
## SS loadings 1.829 1.184 1.163
## Proportion Var 0.305 0.197 0.194
## Cumulative Var 0.305 0.502 0.696
##
## Factor Correlations:
## Factor1 Factor2 Factor3
## Factor1 1.00 0.410 0.560
## Factor2 0.41 1.000 0.294
## Factor3 0.56 0.294 1.000
##
## The degrees of freedom for the model is 0 and the fit was 0.0894
d <- subset(CNEBochem, scale == "alt", select=-c(scale))
CNEBchem_desc <- data.frame(describe(d))
datatable(subset(CNEBchem_desc, select=-c(n, trimmed, mad))) %>%
formatRound(1:10) %>%
formatStyle(8:9, color = styleInterval(c(-2, 2), c('red', 'black', 'red')))
vis_miss(d)
# gg_miss_upset(EEochem)
ggplot(gather(d), aes(value)) +
geom_histogram(bins = 4) +
facet_wrap(~key)
Warning Removed 6 rows containing non-finite values (stat_bin).
corr <- corr.test(d, adjust = "holm")
rval <- corr$r
rval[lower.tri(corr$r, diag = T)] <- NA
datatable(rval) %>%
formatRound(1:ncol(rval)) %>%
formatStyle(1:ncol(rval), color = styleInterval(c(-.7, .7), c('red', 'black', 'red')))
corrplot(corr$r)
d <- na.omit(d)
ev <- eigen(cor(d))
ap <- parallel(subject=nrow(d),var=ncol(d),rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
EFA <- factanal(d, factors = 1, rotation = "promax", cutoff = 0.3)
print(EFA, digits=3, cutoff=.0, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 1, rotation = "promax", cutoff = 0.3)
##
## Uniquenesses:
## CNEBochem01 CNEBochem02 CNEBochem03 CNEBochem04 CNEBochem05 CNEBochem06
## 0.916 0.511 0.718 0.893 0.313 0.699
##
## Loadings:
## [1] 0.700 0.531 0.829 0.548 0.289 0.327
##
## Factor1
## SS loadings 1.950
## Proportion Var 0.325
##
## Test of the hypothesis that 1 factor is sufficient.
## The chi square statistic is 64.32 on 9 degrees of freedom.
## The p-value is 1.96e-10
d <- na.omit(d)
ev <- eigen(cor(d))
ap <- parallel(subject=nrow(d),var=ncol(d),rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
EFA <- factanal(d, factors = 2, rotation = "promax", cutoff = 0.3)
print(EFA, digits=3, cutoff=.4, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 2, rotation = "promax", cutoff = 0.3)
##
## Uniquenesses:
## CNEBochem01 CNEBochem02 CNEBochem03 CNEBochem04 CNEBochem05 CNEBochem06
## 0.005 0.473 0.719 0.748 0.211 0.723
##
## Loadings:
## Factor1 Factor2
## CNEBochem02 0.617
## CNEBochem03 0.570
## CNEBochem05 0.925
## CNEBochem06 0.523
## CNEBochem01 1.036
## CNEBochem04 0.432
##
## Factor1 Factor2
## SS loadings 1.868 1.347
## Proportion Var 0.311 0.225
## Cumulative Var 0.311 0.536
##
## Factor Correlations:
## Factor1 Factor2
## Factor1 1.000 -0.379
## Factor2 -0.379 1.000
##
## Test of the hypothesis that 2 factors are sufficient.
## The chi square statistic is 31.11 on 4 degrees of freedom.
## The p-value is 2.9e-06
d <- na.omit(d)
ev <- eigen(cor(d))
ap <- parallel(subject=nrow(d),var=ncol(d),rep=100,cent=.05)
nS <- nScree(x=ev$values, aparallel=ap$eigen$qevpea)
plotnScree(nS)
EFA <- factanal(d, factors = 3, rotation = "promax", cutoff = 0.3)
print(EFA, digits=3, cutoff=.4, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 3, rotation = "promax", cutoff = 0.3)
##
## Uniquenesses:
## CNEBochem01 CNEBochem02 CNEBochem03 CNEBochem04 CNEBochem05 CNEBochem06
## 0.005 0.005 0.484 0.733 0.448 0.304
##
## Loadings:
## Factor1 Factor2 Factor3
## CNEBochem03 0.715
## CNEBochem06 0.906
## CNEBochem02 1.041
## CNEBochem05 0.507
## CNEBochem01 0.983
## CNEBochem04 0.444
##
## Factor1 Factor2 Factor3
## SS loadings 1.533 1.380 1.198
## Proportion Var 0.256 0.230 0.200
## Cumulative Var 0.256 0.485 0.685
##
## Factor Correlations:
## Factor1 Factor2 Factor3
## Factor1 1.000 -0.258 0.178
## Factor2 -0.258 1.000 -0.535
## Factor3 0.178 -0.535 1.000
##
## The degrees of freedom for the model is 0 and the fit was 0.0264
d <- subset(CNEBochem, scale == "orig", select=-c(scale))
d <- d %>%
mutate_at(vars(1:ncol(d)), recode, `1` = 0, `2` = 0, `3` = 1, `4` = 1)
mod2 <- rasch(d)
Warning in rasch(d): Hessian matrix at convergence is not positive definite; unstable solution.
summary(mod2)
Warning in sqrt(diag(new.covar)): NaNs produced
Warning in sqrt(Var[n.ind + 1, n.ind + 1]): NaNs produced
##
## Call:
## rasch(data = d)
##
## Model Summary:
## log.Lik AIC BIC
## -296.9734 607.9467 624.7079
##
## Coefficients:
## value std.err z.vals
## Dffclt.CNEBochem01 1.2834 0.1461 8.7844
## Dffclt.CNEBochem02 -0.6834 0.2578 -2.6507
## Dffclt.CNEBochem03 0.4333 0.2756 1.5718
## Dffclt.CNEBochem04 2.0903 NaN NaN
## Dffclt.CNEBochem05 -0.0131 0.2904 -0.0452
## Dffclt.CNEBochem06 -0.1212 0.2881 -0.4207
## Dscrmn 0.8960 NaN NaN
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 10
## quasi-Newton: BFGS
item.fit(mod2, simulate.p.value=T)
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
##
## Item-Fit Statistics and P-values
##
## Call:
## rasch(data = d)
##
## Alternative: Items do not fit the model
## Ability Categories: 10
## Monte Carlo samples: 100
##
## X^2 Pr(>X^2)
## CNEBochem01 13.0366 0.1881
## CNEBochem02 10.8825 0.5248
## CNEBochem03 3.9446 0.9208
## CNEBochem04 12.8103 0.1386
## CNEBochem05 9.3885 0.6139
## CNEBochem06 7.5899 0.7624
plot(mod2, type = 'ICC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
plot(mod2, type = 'IIC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'ICC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'IIC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
plot(mod2, type=c("IIC"), items=c(0), ylim=c(0,5))
d <- subset(CNEBochem, scale == "alt", select=-c(scale))
d <- d %>%
mutate_at(vars(1:ncol(d)), recode, `1` = 0, `2` = 0, `3` = 1, `4` = 1)
d1 <- subset(d, select=c(CNEBochem03, CNEBochem06))
d2 <- subset(d, select=c(CNEBochem02, CNEBochem05))
d3 <- subset(d, select=c(CNEBochem01, CNEBochem04))
d <- d1
mod2 <- rasch(d)
summary(mod2)
##
## Call:
## rasch(data = d)
##
## Model Summary:
## log.Lik AIC BIC
## -123.0712 252.1424 260.0174
##
## Coefficients:
## value std.err z.vals
## Dffclt.CNEBochem03 0.0145 0.1448 0.1001
## Dffclt.CNEBochem06 0.3371 0.1509 2.2341
## Dscrmn 2.9261 0.7238 4.0427
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 0.0029
## quasi-Newton: BFGS
item.fit(mod2, simulate.p.value=T)
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
##
## Item-Fit Statistics and P-values
##
## Call:
## rasch(data = d)
##
## Alternative: Items do not fit the model
## Ability Categories: 10
## Monte Carlo samples: 100
##
## X^2 Pr(>X^2)
## CNEBochem03 12.0698 0.505
## CNEBochem06 11.3033 0.5149
plot(mod2, type = 'ICC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
plot(mod2, type = 'IIC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'ICC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'IIC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
plot(mod2, type=c("IIC"), items=c(0), ylim=c(0,5))
d <- d2
mod2 <- rasch(d)
summary(mod2)
##
## Call:
## rasch(data = d)
##
## Model Summary:
## log.Lik AIC BIC
## -109.1146 224.2293 232.1042
##
## Coefficients:
## value std.err z.vals
## Dffclt.CNEBochem02 -0.7694 0.1609 -4.7804
## Dffclt.CNEBochem05 -0.3257 0.1448 -2.2497
## Dscrmn 3.3902 0.9066 3.7396
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 3.3e-06
## quasi-Newton: BFGS
item.fit(mod2, simulate.p.value=T)
##
## Item-Fit Statistics and P-values
##
## Call:
## rasch(data = d)
##
## Alternative: Items do not fit the model
## Ability Categories: 10
## Monte Carlo samples: 100
##
## X^2 Pr(>X^2)
## CNEBochem02 8.9556 0.4455
## CNEBochem05 11.1753 0.3861
plot(mod2, type = 'ICC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
plot(mod2, type = 'IIC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'ICC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'IIC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
plot(mod2, type=c("IIC"), items=c(0), ylim=c(0,5))
d <- d3
mod2 <- rasch(d)
summary(mod2)
##
## Call:
## rasch(data = d)
##
## Model Summary:
## log.Lik AIC BIC
## -89.47386 184.9477 192.8226
##
## Coefficients:
## value std.err z.vals
## Dffclt.CNEBochem01 1.0326 0.2536 4.0712
## Dffclt.CNEBochem04 1.5773 0.3469 4.5473
## Dscrmn 1.8010 0.6069 2.9675
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 0.00068
## quasi-Newton: BFGS
item.fit(mod2, simulate.p.value=T)
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
Warning in rasch(data = X.new): Hessian matrix at convergence is not positive definite; unstable solution.
##
## Item-Fit Statistics and P-values
##
## Call:
## rasch(data = d)
##
## Alternative: Items do not fit the model
## Ability Categories: 10
## Monte Carlo samples: 100
##
## X^2 Pr(>X^2)
## CNEBochem01 21.3531 0.4356
## CNEBochem04 11.7735 0.5248
plot(mod2, type = 'ICC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
plot(mod2, type = 'IIC', auto.key = FALSE)
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in text.default(z[pos[it]], pr[pos[it], itms[it]], labels = nams[it], :
“auto.key” is not a graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'ICC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod2, type = 'IIC', auto.key = FALSE, items = n, main = items[n], annot = F)
n <- n + 1
}
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
Warning in plot.window(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy, type, …): “auto.key” is not a graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in axis(side = side, at = at, labels = labels, …): “auto.key” is not a
graphical parameter
Warning in box(…): “auto.key” is not a graphical parameter
Warning in title(…): “auto.key” is not a graphical parameter
Warning in plot.xy(xy.coords(x, y), type = type, …): “auto.key” is not a
graphical parameter
plot(mod2, type=c("IIC"), items=c(0), ylim=c(0,5))