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=grep("IPchem", colnames(df))) # instructor growth mindset (chemistry)
SEchem <- subset(df, select=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_class <- cbind.data.frame(subset(subset(df, select=grep("CNEBochem", colnames(df))), select=c(1:3))) # entity norms and beliefs
CNEBochem_self <- cbind.data.frame(subset(subset(df, select=grep("CNEBochem", colnames(df))), select=c(4:6))) # 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
d <- subset(CCdisc, scale == "orig", select=-c(scale))
CCchem_desc <- data.frame(describe(d))
datatable(subset(CCchem_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 4 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=.4, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 1, rotation = "promax", cutoff = 0.3)
##
## Uniquenesses:
## CCdisc01 CCdisc02 CCdisc03 CCdisc04
## 0.966 0.964 0.586 0.005
##
## Loadings:
## [1] 0.643 0.997
##
## Factor1
## SS loadings 1.479
## Proportion Var 0.370
##
## Test of the hypothesis that 1 factor is sufficient.
## The chi square statistic is 2.47 on 2 degrees of freedom.
## The p-value is 0.29
d <- subset(CCdisc, scale == "alt", select=-c(scale))
CCchem_desc <- data.frame(describe(d))
datatable(subset(CCchem_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 11 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=.4, sort=TRUE)
##
## Call:
## factanal(x = d, factors = 1, rotation = "promax", cutoff = 0.3)
##
## Uniquenesses:
## CCdisc01 CCdisc02 CCdisc03 CCdisc04
## 0.934 0.005 0.991 0.999
##
## Loadings:
## [1] 0.997
##
## Factor1
## SS loadings 1.071
## Proportion Var 0.268
##
## Test of the hypothesis that 1 factor is sufficient.
## The chi square statistic is 2.96 on 2 degrees of freedom.
## The p-value is 0.228
d <- subset(CCdisc, scale == "orig", select=-c(scale))
d <- d %>%
mutate_at(vars(1:ncol(d)), recode, `1` = 0, `2` = 0, `3` = 1, `4` = 1)
mod <- rasch(d)
summary(mod)
##
## Call:
## rasch(data = d)
##
## Model Summary:
## log.Lik AIC BIC
## -140.9701 291.9402 303.9124
##
## Coefficients:
## value std.err z.vals
## Dffclt.CCdisc01 -0.3643 0.2380 -1.5305
## Dffclt.CCdisc02 0.5141 0.2492 2.0632
## Dffclt.CCdisc03 3.0657 0.7399 4.1433
## Dffclt.CCdisc04 2.1464 0.5007 4.2871
## Dscrmn 1.3011 0.3391 3.8365
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 0.0034
## quasi-Newton: BFGS
item.fit(mod, 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.
##
## 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)
## CCdisc01 18.6093 0.6337
## CCdisc02 18.3660 0.5149
## CCdisc03 9.6024 0.2574
## CCdisc04 21.9748 0.0792
plot(mod, type="ICC", cex = .7, legend = F, col = 1)
plot(mod, type="IIC", cex = .7, legend = F, col = 1)
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod, 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
plot(mod, type=c("IIC"), items=c(0))
d1 <- subset(d, select=c(CCdisc01, CCdisc02, CCdisc03))
d <- d1
mod <- rasch(d)
summary(mod)
##
## Call:
## rasch(data = d)
##
## Model Summary:
## log.Lik AIC BIC
## -119.4242 246.8484 256.4262
##
## Coefficients:
## value std.err z.vals
## Dffclt.CCdisc01 -0.5517 0.4447 -1.2406
## Dffclt.CCdisc02 0.7963 0.5291 1.5049
## Dffclt.CCdisc03 4.8681 2.6768 1.8186
## Dscrmn 0.7141 0.4273 1.6713
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 4e-06
## quasi-Newton: BFGS
item.fit(mod, 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.
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.
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.
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)
## CCdisc01 31.0271 0.4455
## CCdisc02 29.7570 0.4257
## CCdisc03 17.3357 0.3366
plot(mod, type="ICC", cex = .7, legend = F, col = 1)
plot(mod, type="IIC", cex = .7, legend = F, col = 1)
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod, 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
plot(mod, type=c("IIC"), items=c(0))
d <- subset(CCdisc, scale == "alt", select=-c(scale))
d <- d %>%
mutate_at(vars(1:ncol(d)), recode, `1` = 0, `2` = 0, `3` = 1, `4` = 1)
mod <- rasch(d)
Warning in rasch(d): Hessian matrix at convergence is not positive definite; unstable solution.
summary(mod)
Warning in sqrt(diag(new.covar)): NaNs produced
Warning in sqrt(diag(new.covar)): NaNs produced
Warning in sqrt(diag(new.covar)): NaNs produced
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
## -148.455 306.91 320.0348
##
## Coefficients:
## value std.err z.vals
## Dffclt.CCdisc01 -454.8986 NaN NaN
## Dffclt.CCdisc02 3690.3401 NaN NaN
## Dffclt.CCdisc03 17011.3772 NaN NaN
## Dffclt.CCdisc04 11791.5642 NaN NaN
## Dscrmn 0.0003 NaN NaN
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 2e-04
## quasi-Newton: BFGS
item.fit(mod, 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.
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.
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.
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.
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.
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.
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.
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)
## CCdisc01 18.7374 0.9307
## CCdisc02 48.9937 0.099
## CCdisc03 0.9899 0.6733
## CCdisc04 29.3406 0.1188
plot(mod, type="ICC", cex = .7, legend = F, col = 1)
plot(mod, type="IIC", cex = .7, legend = F, col = 1)
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod, 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
plot(mod, type=c("IIC"), items=c(0))
d1 <- subset(d, select=c(CCdisc01, CCdisc03, CCdisc04))
d <- d1
mod <- rasch(d)
Warning in rasch(d): Hessian matrix at convergence is not positive definite; unstable solution.
summary(mod)
Warning in sqrt(diag(new.covar)): NaNs produced
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
## -92.10244 192.2049 202.7048
##
## Coefficients:
## value std.err z.vals
## Dffclt.CCdisc01 -0.1353 0.1952 -0.693
## Dffclt.CCdisc03 4.2319 NaN NaN
## Dffclt.CCdisc04 2.9291 NaN NaN
## Dscrmn 1.3738 NaN NaN
##
## Integration:
## method: Gauss-Hermite
## quadrature points: 21
##
## Optimization:
## Convergence: 0
## max(|grad|): 2.4
## quasi-Newton: BFGS
item.fit(mod, 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.
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.
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.
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)
## CCdisc01 42.9025 0.495
## CCdisc03 2.1319 0.396
## CCdisc04 17.8159 0.5149
plot(mod, type="ICC", cex = .7, legend = F, col = 1)
plot(mod, type="IIC", cex = .7, legend = F, col = 1)
items <- colnames(d)
n <- 1
for (i in 1:ncol(d)) {
plot(mod, 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
plot(mod, type=c("IIC"), items=c(0))