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}

main .nav-pills > li.active > a,

main .nav-pills > li.active > a:hover,

main .nav-pills > li.active > a:focus {

background-color: #566D81;

}

main .nav-pills > li > a:hover {

background-color: #566D81;

}

h1, h2, h3, h4, h5, h6, legend { color: #566D81; }

nav-top span.glyphicon {

color: #566D81;

}

table-of-contents header {

color: #566D81;

}

table-of-contents h2 {

background-color: #566D81;

}

main a {

background-image: linear-gradient(180deg,#7896AE,#7896AE);
color: #7C7D7D;

}

a:hover { color: #231E1F; }

postamble {

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;

}

postamble p {

color: #F4F5F5; font-size: 100%; margin-bottom: 0; }

body { background-color: #fcfcf7; }

content {

background: #fcfcf7;
max-width:1200px;

}

sidebar h2 {

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;

}

sidebar a {

color: #F4F5F5;

}

sidebar {

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)

Model Overview

Technical Information

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$.

Data Summary

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)).

Missing Data Summary

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 {.tabset .tabset-fade .tabset-pills}

assumptions <- irt_assume(my_model)

Unidimensionality

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')}"))

Relative Fit

anova(my_model)  %>% flextable() %>% autofit()

Local/Conditional Dependence

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')

Summary Plots {.tabset .tabset-fade .tabset-pills}

Test Information

plot(my_model, type = 'tinfo')

Theta Estimates and Item Difficulties

plot(my_model, type = 'theta_diff') + ggplot2::aes(color = type) + ggplot2::scale_color_manual(values = c("#020a23", "#566D81"))

Items

Item-level Statistics

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)

Item-level Plots {.tabset .tabset-fade .tabset-pills}

Item Characteristic Curves and Residuals

plot(my_model, type = 'resid_trace') + ggplot2::coord_cartesian(xlim = c(-3,3))

Item Characteristic Curves and Observed Responses

plot(my_model, type = 'obs_trace') + ggplot2::coord_cartesian(xlim = c(-3,3))

Standardized Residuals

plot(my_model, type = 'stand') + ggplot2::coord_cartesian(xlim = c(-3,3))

Item Information

plot(my_model, type = 'info') + ggplot2::coord_cartesian(xlim = c(-3,3))

Persons

Person-level Plots {.tabset .tabset-fade .tabset-pills}

Districution of Person Abilities

plot(my_model, type = 'theta_SE') 

Person Response Functions {.tabset .tabset-fade .tabset-pills}

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("

")
}

Person-level Statistics

Person-level Statistics

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)))

Quantitative Explanation of Person Misfit

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()

References

Estimation performed by the following packages:




Pflegermeister/wizirt documentation built on Nov. 22, 2020, 8:27 p.m.