@@ -13,22 +13,28 @@ type <- "WS" # "WS" or "WG"
1313resp <- " production" # "comprehension" or "production"
1414
1515d_poly <- 3
16- poly_mode <- " Flexi" # "Fixed" # "Fixed" # or
16+ poly_mode <- " Flexi" # "Fixed" or "Flexi"
1717criteria <- " incl.anyFinite" # or "excl.Inf" — for evaluation of log = -inf
1818gen_list <- c(" Female" , " Male" )
1919
2020# ######### Functions
21+ # Convert item_id to an integer
22+ convert_item_id <- function (data ) {
23+ data %> %
24+ mutate(item_id = as.integer(gsub(" item_" , " " , item_id )))
25+ }
26+
2127# Get data from word bank
2228prep_data <- function (){
2329 admin_ws <<- get_administration_data(lang , type , include_demographic_info = TRUE )
2430 if (lang == " English (American)" ){
2531 admin_ws <<- admin_ws # %>% filter(norming=="TRUE")
2632 }
27- data_ws <<- get_instrument_data(lang , type )
33+ data_ws <<- get_instrument_data(lang , type ) % > % convert_item_id
2834 if (lang == " English (American)" ){
2935 data_ws <<- data_ws %> % filter(data_id %in% admin_ws $ data_id )
3036 }
31- items_ws <<- get_item_data(lang , type )
37+ items_ws <<- get_item_data(lang , type ) % > % convert_item_id
3238
3339 # reduce datasets
3440 items_ws <<- subset(items_ws , item_kind == " word" )
@@ -424,7 +430,7 @@ for (i in 1:(length(items@ParObjects$pars) - 1)){
424430rownames(irtparam ) <- 1 : nrow(irtparam )
425431
426432IRT_Parameters <- irtparam %> % data.frame () %> %
427- mutate(word_id = gsub( pattern = " item_ " , replacement = " " , x = names(data_irt ))) %> %
433+ mutate(word_id = as.integer( names(data_irt ))) %> %
428434 select(word_id , colnames(. [,1 : (ncol(. )- 1 )]))
429435
430436if (type == " WG" ) {
0 commit comments