title: r params$title
subtitle: r params$notes
author: r params$author
data: r params$data
date: r format(Sys.time(), '%B %d, %Y, %H:%M %p')
```{css, echo = FALSE, message = FALSE, warning = FALSE}
background-color: #566D81;
}
background-color: #566D81;
}
h1, h2, h3, h4, h5, h6, legend { color: #566D81; }
color: #566D81;
}
color: #566D81;
}
background-color: #566D81;
}
background-image: linear-gradient(180deg,#7896AE,#7896AE); color: #7C7D7D;
}
a:hover { color: #231E1F; }
color: #F4F5F5; background: #020a23; border-top: solid 10px #020a23; font-family: "Lato","proxima-nova","Helvetica Neue",Arial,sans-serif; font-size: 90%; z-index: 400; padding: 12px;
}
color: #F4F5F5; font-size: 100%; margin-bottom: 0; }
body { background-color: #fcfcf7; }
background: #fcfcf7; max-width:1200px;
}
z-index: 200; background-color: #566D81; text-align: center; padding: 0.809em; display: block; color: #F4F5F5; font-size: 100%; margin-top: 0; margin-bottom: 0.809em;
}
color: #F4F5F5;
}
position: fixed; top: 0; overflow: hidden; display: flex; flex-direction: column; height: 100%; background: #020a23; z-index: 200; font-size: 16px;
}
p { color:#201520; }
img { border-radius: 5px; box-shadow: 3px 3px 10px #ccc; }
.table-wrapper, .ReactTable { padding: 7px; border-radius: 5px; background-color: white; box-shadow: 3px 3px 10px #ccc; }
pre {
box-shadow: 3px 3px 10px #ccc;
}
.logo { position: absolute; right:0; width: 100px; box-shadow: 0 0 0 #ccc; }
```r library(knitr) library(rmdformats) library(flextable) library(reactable) library(wizirt) ## Global options options(max.print="75") opts_chunk$set(echo=FALSE, prompt=FALSE, tidy=TRUE, comment=NA, message=FALSE, warning=FALSE) opts_knit$set(width=75)
if(is.null(params$data)){ cat('This report was generated using the practice data from the wizirt package') data('responses') data <- responses[,-1] } else { data <- readr::read_rds(params$data) }
my_model <- wizirt(data = data, engine = params$engine, item_type = params$item_type, tol = params$tol, rownames = params$rownames)
cat(params$note)
A r my_model$fit$model$n_factors
factor r my_model$fit$model$item_type
model was estimated using the function r my_model$fit$model$engine$func
from the package r my_model$fit$model$engine$pkg
(v r my_model$fit$model$engine$ver
). Estimation has r ifelse(my_model$fit$estimation$convergence, "", "not")
converged using the r my_model$fit$estimation$method
method after r my_model$fit$estimation$iterations
iterations with a convergence criteria $r my_model$fit$estimation$criteria
$.
Model built on a data set with r nrow(my_model$fit$data)
examinees ($\bar{\theta}$ = r round(mean(my_model$fit$parameters$persons$ability, na.rm = T), 2)
, $\sigma_{\theta}$ = r round(sd(my_model$fit$parameters$persons$ability, na.rm = T), 2)
) and r ncol(my_model$fit$data)
items ($\bar{\delta}$ = r round(mean(my_model$fit$parameters$coefficients$difficulty, na.rm = T), 2)
, $\sigma_{\delta}$ = r round(sd(my_model$fit$parameters$coefficients$difficulty, na.rm = T), 2)
).
if(mean(is.na(my_model$fit$data)) == 0){ cat("No data were missing from this data set.") } else { print(my_model, type = 'na_item') %>% dplyr::filter(count != 0) %>% flextable() %>% autofit() print(my_model, type = 'na_person') %>% dplyr::filter(count != 0) %>% flextable() %>% autofit() }
if(mean(is.na(my_model$fit$data)) == 0){ cat("") } else { cat("## Description of Missing Data Handling Generally, missing data are handled using full information during estimation. Additional functions for item and person fit tend to use list wise deletion or pairwise deletion.") }
assumptions <- irt_assume(my_model)
print(assumptions, type = 'unid') %>% flextable() %>% autofit() %>% add_header_lines(c("Statistics Detecting Essential Unidimensionality", "Table 1")) %>% add_footer_lines(glue::glue("Statistics generated using sirt {packageVersion('sirt')}"))
anova(my_model) %>% flextable() %>% autofit()
library(reactable) assumptions$ld %>% dplyr::mutate(dplyr::across(LD_std:ccov, round, 3)) %>% dplyr::rename(`Item 1` = "item_1", `Item 2` = "item_2") %>% reactable::reactable(filterable = T, paginationType = "simple", searchable = TRUE, columns = list( pvals = colDef(style = function(value) { if (value < .05) { color <- "#9e0317" } else { color <- "#020a23" } list(color = color) }) ))
plot(my_model, type = 'ld_pairs')
plot(my_model, type = 'tinfo')
plot(my_model, type = 'theta_diff') + ggplot2::aes(color = type) + ggplot2::scale_color_manual(values = c("#020a23", "#566D81"))
ifa <- irt_item_fit(my_model, stats = params$ifa_stats) print(ifa) %>% dplyr::mutate(dplyr::across(-item, round, 2)) %>% reactable::reactable(paginationType = "simple", searchable = TRUE)
plot(my_model, type = 'resid_trace') + ggplot2::coord_cartesian(xlim = c(-3,3))
plot(my_model, type = 'obs_trace') + ggplot2::coord_cartesian(xlim = c(-3,3))
plot(my_model, type = 'stand') + ggplot2::coord_cartesian(xlim = c(-3,3))
plot(my_model, type = 'info') + ggplot2::coord_cartesian(xlim = c(-3,3))
plot(my_model, type = 'theta_SE')
persons_per = 30 out <- plot_wrap(object = my_model, type = 'np_prf', persons_per = persons_per) for (i in seq_len(length(out))){ numbers <- seq_len(persons_per)+(i-1)*persons_per numbers <- numbers[numbers %in% seq_len(nrow(my_model$fit$data))] cat(glue::glue("#### Persons {min(numbers)}:{max(numbers)} ")) print(out[[i]]) cat(" ") }
pfa <- irt_person_fit(my_model, stats = params$pfa_stats) print(pfa, patterns = T, item_order = 'by_diff') %>% dplyr::relocate(ids) %>% dplyr::mutate(dplyr::across(c(-ids, -pattern), round, 2)) %>% reactable::reactable(paginationType = "simple", searchable = TRUE, columns = list( pattern = colDef(minWidth = 300)))
pfa_mlm <- irt_model_pfa(my_model, pfa = pfa, predictors = params$pfa_predictors) eval(parse(text = paste0("pfa_mlm$icc %>% as.data.frame() %>% tibble::rownames_to_column('ICC') %>% dplyr::mutate(dplyr::across(tidyselect::all_of(params$pfa_stats), function(x) round(as.numeric(x),3) )) %>% reactable::reactable(columns = list(", paste( glue::glue('{params$pfa_stats} = colDef(maxWidth = 100)'), collapse = ', '), "))") ) ) mods <- lapply(1:length(pfa_mlm$models), function(x) { pfa_mlm$models[[x]] %>% summary() %>% coef() %>% round(2) %>% as.data.frame() %>% tibble::rownames_to_column() %>% dplyr::mutate(Model = names(pfa_mlm$models)[x]) }) dplyr::bind_rows(mods) %>% reactable::reactable()
Estimation performed by the following packages:
Chung Y, Rabe-Hesketh S, Dorie V, Gelman A, Liu J (2013). A nondegenerate penalized likelihood estimator for variance parameters in multilevel models. Psychometrika, 78(4), 685-709.
Dimitris Rizopoulos (2006). ltm: An R package for Latent Variable Modelling and Item Response Theory Analyses, Journal of Statistical Software, 17 (5), 1-25. URL http://www.jstatsoft.org/v17/i05/
Jorge N. Tendeiro, Rob R. Meijer, A. Susan M. Niessen (2016). PerFit: An R Package for Person-Fit Analysis in IRT. Journal of Statistical Software, 74(5), 1-27. doi:10.18637/jss.v074.i05
Mair, P., Hatzinger, R., & Maier M. J. (2020). eRm: Extended Rasch Modeling. 1.0-1. https://cran.r-project.org/package=eRm
R. Philip Chalmers (2012). mirt: A Multidimensional Item Response Theory Package for the R Environment. Journal of Statistical Software, 48(6), 1-29. doi:10.18637/jss.v048.i06
Robitzsch, A. (2020). sirt: Supplementary Item Response Theory Models. R package version 3.9-4. https://CRAN.R-project.org/package=sirt
Powered by wizirt
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.