Generate a Fake Data Set for Embedded Standard Setting
generateMockDataSet.Rd`generateMockDataSet()` generates a simulated data set that follows the input structure required by `emstans()`. The generated data can be used to test functions in the EmStanS package, demonstrate the expected data format, or run examples without using operational data.
Usage
generateMockDataSet(
ngca,
ntable,
npanelist,
cor_val,
nlevel,
sdinp = 1,
ecinp = 0,
n,
...,
domains = c("Alg", "Geom", "Calc", "Prob")
)Arguments
- ngca
A numeric value indicating the number of grade clusters or GCAs to generate.
- ntable
A numeric value indicating the number of tables to generate within each GCA.
- npanelist
A numeric value indicating the number of panelists to generate within each table.
- cor_val
A numeric value indicating the intended correlation between item locations and aligned level descriptions.
- nlevel
A numeric value indicating the number of performance levels or aligned level-description categories.
- sdinp
A numeric value used to adjust the standard deviation of the values used in Weighted Embedded Standard Setting. Default is `1`.
- ecinp
A numeric value used to control essentially consistent items in the simulated item ratings. Default is `0`.
- n
A numeric value indicating the number of items to generate within each GCA.
- ...
Additional numeric arguments passed to `runif()`, typically the minimum and maximum score values used to generate item locations. For example, `100, 300` generates item locations between 100 and 300.
- domains
The content subdomains of the items, added to the item data as a `Domain` column. Either a character vector of subdomain names (for example `c("Number", "Algebra", "Geometry")`), or the number of subdomains, which are then named from `"Alg"`, `"Geom"`, `"Calc"`, `"Prob"`, `"Stat"`, `"Num"` (or `"D1"`, `"D2"`, ... beyond six). Items are split as evenly as possible across subdomains and assigned at random, so every subdomain spans the whole location range. `NULL` adds no `Domain` column. Must be named, since it follows `...`.
Value
A list of simulated data frames formatted for use with `emstans()`. The returned list contains test setup information, panelist information, item ratings, item metadata, and student data.
Details
This function is mainly intended for package testing, examples, and demonstrations. Use the `Domain` column with `emstans(by_domain = TRUE)` to also estimate cut scores within each subdomain. The returned object mimics the data structure expected by `emstans()`, allowing users to inspect the required format before preparing their own data.
Examples
# 2 grades, 2 tables of 3 panelists, 30 items per grade, locations 300-500
set.seed(1)
fake_data <- generateMockDataSet(ngca = 2, ntable = 2, npanelist = 3,
cor_val = 0.7, nlevel = 3, sdinp = 1,
ecinp = 0, n = 30, 300, 500)
names(fake_data)
#> [1] "setup" "panelist" "rating"
#> [4] "item_data" "examineedata_data"
head(fake_data$rating)
#> # A tibble: 6 × 8
#> GCA Subject Grade Round Table Panelist Item_ID ALD
#> <chr> <chr> <chr> <dbl> <chr> <chr> <chr> <chr>
#> 1 M1 Math 1 1 T1 M1.T1.1 M1_1 Level1
#> 2 M1 Math 1 1 T1 M1.T1.1 M1_2 Level1
#> 3 M1 Math 1 1 T1 M1.T1.1 M1_3 Level2
#> 4 M1 Math 1 1 T1 M1.T1.1 M1_4 Level1
#> 5 M1 Math 1 1 T1 M1.T1.1 M1_5 Level2
#> 6 M1 Math 1 1 T1 M1.T1.1 M1_6 Level1
# Three named subdomains
fake_data <- generateMockDataSet(ngca = 2, ntable = 2, npanelist = 4,
cor_val = 0.6, nlevel = 3, sdinp = 1,
ecinp = 0, n = 45, 300, 500,
domains = c("Number", "Algebra", "Geometry"))
table(fake_data$item_data$GCA, fake_data$item_data$Domain)
#>
#> Algebra Geometry Number
#> M1 15 15 15
#> M2 15 15 15
# Four levels and no subdomains
fake_data <- generateMockDataSet(ngca = 1, ntable = 2, npanelist = 3,
cor_val = 0.7, nlevel = 4, sdinp = 1,
ecinp = 0, n = 40, 300, 500, domains = NULL)
names(fake_data$item_data)
#> [1] "GCA" "Item_ID" "Total_points"
#> [4] "Point" "Order_of_Difficulty" "Loc_RP50"