knitr::opts_chunk$set(echo = FALSE)
knitr::opts_chunk$set(options(knitr.kable.NA = ''))

title: "r report.title" date: "r format(Sys.Date(), '%B %d, %Y')"


Summary

if(dataset.name != "dataset"){
  cat("**Dataset:**", dataset.name)
  cat("\n\n")
}

Measure: r if(measure.name == "measure") outputs$item.name.range else paste0(measure.name, " (", outputs$item.name.range, ")")

Comparison groups: r if(length(outputs$dif.groups) == 2) paste(outputs$dif.groups, collapse = " and ") else paste(outputs$dif.groups, collapse = ", ")

Items with no variance: r outputs$no.var.items

Items with no variance within comparison groups: r outputs$no.var.by.group.items

Biased items: r paste(names(inputs$item.data)[dif.models$biased.items], collapse = ", ")

if(outputs$no.var.items != "none"){

  cat("\n\n")
  cat("^a^ Items were not included in any DIF analysis and were not used to compute 
      treatment effects.")
  cat("\n\n")
}


if(outputs$no.var.by.group.items != "none"){

  cat("\n\n")
  cat("^b^ Items were not included in the IRT-based DIF analysis and were not used 
      to compute IRT-based treatment effects.")
  cat("\n\n")
}

Treatment Effect Robustness

gridExtra::grid.arrange(bias.plots[[1]], bias.plots[[2]])
for(i in 1:length(effects.tables)){
  cat("\n\n")
  cat("##", names(effects.tables)[[i]])
  cat("\n\n")
  cat("'Bias Omitted' treatment effect estimates adjusted for bias in", paste(names(inputs$item.data)[dif.models$biased.items], collapse = ", "), ".")
  cat("\n\n")
  et.flex <- format_flex(effects.tables[[i]])
  cat("\n\n")
  cat(knitr::knit_print(et.flex))
  cat("\n\n")
  cat("&nbsp;  ")

  print(effects.plots[[i]])

}


knickodem/WBdif documentation built on Feb. 3, 2024, 2:20 a.m.