#install.packages("car")
#install.packages("sjstats")
#install.packages("compute.es")
#install.packages("pwr")
#install.packages("ltm")
#install.packages("infer")
#install.packages("lsr")
#install.packages("tidyverse")
#install.packages("dplyer")
#install.packages("ggplot2")
library(tidyverse)
## Warning: package 'tidyverse' was built under R version 4.4.1
## Warning: package 'ggplot2' was built under R version 4.4.1
## Warning: package 'tibble' was built under R version 4.4.1
## Warning: package 'tidyr' was built under R version 4.4.1
## Warning: package 'readr' was built under R version 4.4.1
## Warning: package 'purrr' was built under R version 4.4.1
## Warning: package 'dplyr' was built under R version 4.4.1
## Warning: package 'stringr' was built under R version 4.4.1
## Warning: package 'forcats' was built under R version 4.4.1
## Warning: package 'lubridate' was built under R version 4.4.1
## ── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
## ✔ dplyr     1.1.4     ✔ readr     2.1.5
## ✔ forcats   1.0.0     ✔ stringr   1.5.1
## ✔ ggplot2   3.5.1     ✔ tibble    3.2.1
## ✔ lubridate 1.9.3     ✔ tidyr     1.3.1
## ✔ purrr     1.0.2     
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::filter() masks stats::filter()
## ✖ dplyr::lag()    masks stats::lag()
## ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(dplyr)
library(ltm)
## Warning: package 'ltm' was built under R version 4.4.1
## Loading required package: MASS
## 
## Attaching package: 'MASS'
## 
## The following object is masked from 'package:dplyr':
## 
##     select
## 
## Loading required package: msm
## Warning: package 'msm' was built under R version 4.4.1
## Loading required package: polycor
## Warning: package 'polycor' was built under R version 4.4.1
library(infer)
## Warning: package 'infer' was built under R version 4.4.1
retail <- read_csv("retail_salespeople_statistic_5000_no_persons.csv")
## Rows: 5000 Columns: 60
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## dbl (60): q01, q02, q03, q04, q05, q06, q07, q08, q09, q10, q11, q12, q13, q...
## 
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
model <- rasch(retail, IRT.param = TRUE)
## Warning in rasch(retail, IRT.param = TRUE): Hessian matrix at convergence is not positive definite; unstable solution.
#GoF.rasch(model)
coef (model, prob = TRUE, order = TRUE)
##          Dffclt    Dscrmn P(x=1|z=0)
## q25 -3.14465445 0.5692239 0.85692881
## q21 -3.03642443 0.5692239 0.84920834
## q43 -2.99440241 0.5692239 0.84611965
## q11 -2.89151560 0.5692239 0.83833884
## q17 -2.81301634 0.5692239 0.83219108
## q38 -2.47412654 0.5692239 0.80350272
## q39 -1.68313666 0.5692239 0.72273755
## q30 -1.67920559 0.5692239 0.72228893
## q55 -1.59035856 0.5692239 0.71203131
## q20 -1.34135375 0.5692239 0.68211978
## q44 -1.25552613 0.5692239 0.67143345
## q36 -1.22243452 0.5692239 0.66726457
## q34 -1.08304792 0.5692239 0.64942138
## q02 -1.08266747 0.5692239 0.64937207
## q10 -0.81347516 0.5692239 0.61373735
## q49 -0.69796034 0.5692239 0.59803775
## q59 -0.51600509 0.5692239 0.57290720
## q08 -0.32702591 0.5692239 0.54640382
## q07 -0.17619409 0.5692239 0.52505248
## q13 -0.15588630 0.5692239 0.52216901
## q22  0.02163278 0.5692239 0.49692157
## q24  0.09004398 0.5692239 0.48718901
## q53  0.10496267 0.5692239 0.48506763
## q47  0.23772911 0.5692239 0.46622126
## q18  0.28660673 0.5692239 0.45930437
## q29  0.40861595 0.5692239 0.44211225
## q60  0.41895898 0.5692239 0.44066060
## q26  0.43187549 0.5692239 0.43884919
## q12  0.54067302 0.5692239 0.42366061
## q06  0.72078500 0.5692239 0.39884305
## q16  0.77024747 0.5692239 0.39211197
## q14  0.90238166 0.5692239 0.37433658
## q57  0.96546571 0.5692239 0.36596507
## q28  1.26268281 0.5692239 0.32766847
## q58  1.30623549 0.5692239 0.32223043
## q41  1.36618132 0.5692239 0.31482377
## q09  1.37726831 0.5692239 0.31346402
## q40  1.41067093 0.5692239 0.30938680
## q23  1.45664275 0.5692239 0.30382358
## q01  1.54608588 0.5692239 0.29316347
## q48  1.71353868 0.5692239 0.27380803
## q54  1.75956204 0.5692239 0.26862995
## q46  1.80340517 0.5692239 0.26375519
## q52  1.92005887 0.5692239 0.25106442
## q03  1.98676638 0.5692239 0.24399229
## q42  2.17692847 0.5692239 0.22458228
## q56  2.19276006 0.5692239 0.22301683
## q19  2.46144390 0.5692239 0.19763960
## q50  2.52243321 0.5692239 0.19219204
## q37  2.62123728 0.5692239 0.18361110
## q51  2.75758082 0.5692239 0.17226188
## q45  2.77356654 0.5692239 0.17096828
## q35  2.80006016 0.5692239 0.16884135
## q15  2.81223100 0.5692239 0.16787135
## q05  3.23069306 0.5692239 0.13717106
## q04  3.30978725 0.5692239 0.13192895
## q32  3.41918042 0.5692239 0.12495964
## q33  3.93021422 0.5692239 0.09646175
## q27  4.52127414 0.5692239 0.07085579
## q31  5.39100614 0.5692239 0.04441741
plot(model, type = "ICC")

plot(model, type = "IIC")

information(model, c(-4,4))
## 
## Call:
## rasch(data = retail, IRT.param = TRUE)
## 
## Total Information = 33.71
## Information in (-4, 4) = 24.7 (73.25%)
## Based on all the items