Will use dplyr to pull data together into a big file, then pull off subsets for shinyItemAnalysis.
library(dplyr)
Attaching package: 'dplyr'
The following objects are masked from 'package:stats':
filter, lag
The following objects are masked from 'package:base':
intersect, setdiff, setequal, union
ACED Items
allitems <-read.csv("data/allItems.csv")bnscores <-read.csv("data/bnscores.csv")demographics <-read.csv("data/prepost.csv")demographics |>inner_join(allitems,join_by(SubjID)) |>inner_join(bnscores,join_by(SubjID)) -> acedall#acedall # Only useful in interactive mode.
Data – items only
The write.csv by default puts row names/numbers as the first column, but ShinyItemAnalysis does not want them, so need to use the row.names=FALSE switch.
Race is a bit more complex, as there are 8 groups.
table(acedall$Race)
1 2 3 4 5 6 7 8
3 25 32 6 6 55 90 12
Group 7 has the biggest number, so lets call that reference. Groups 2, 3 and 6 are big enough to be interesting. The dplyr::case_match function allows us to do this.
Warning: There was 1 warning in `mutate()`.
ℹ In argument: `focal2 = case_match(Race, 7 ~ 0, 2 ~ 1)`.
Caused by warning:
! `case_match()` was deprecated in dplyr 1.2.0.
ℹ Please use `recode_values()` instead.
Academic ELL Honors Part 1 Part 2 Regular
129 17 35 23 7 19
Some interesting contrasts here are the regular (Honors, Academic and Regular) versus ELL and Special Ed (Parts 1 and 2). ELL had some irregularities in administration, so it is worth looking at separately.