12.4 Now Build Do Your Analysis

12.4.1 Import/ Munge

First, add your data from the requester into the data-raw folder. Use the 01-import.R script as a template and do whatever data importing and munging is required. If you need to perform some matching, please verify that 02-match.R writes out a file to disk.

12.4.2 Check the Analysis

Now check to make sure that the code is modeling all of the outcome parameters desired in the 01-run-analysis.R file.

12.4.3 Verify the Parameters in the RMarkdown Document

The usualsuspects template utilises a parameterised Rmarkdown report which allows you to set some variables that carry forward for the rest of the report. Below is an example of the parameters used in a report. It includes some information about the names for the treatment and control groups, the language to use when describing the differences between the two groups and some additional features.

---
title: "Review of _SOMETHING_"
subtitle: "Descriptive Statistics of Demographics"
author: "Michael DeWitt _Office of Institutional Research_"
date: "TODAY (Updated: 2019-08-01)"
toc: false
output: 
  bookdown::pdf_document2:
    keep_tex: TRUE
bibliography: my_bib.bib
params:
  treated_group_name: "Subscribed"
  control_group_name: "Did Not Subscribe"
  between_language: "those students whose parents/guardians subscribed to the _Daily Deac_ blog and those who did not"
  regression_analysis_scope: "First Year"
  causal: FALSE
  clear_log: TRUE
  draft: FALSE
  nc_region: TRUE
  hdi_level: "95%"
  demographics: TRUE
  regression_analysis: TRUE
header-includes:
   - \usepackage{eso-pic,graphicx,transparent, float}
---
  • treated_group_name: The name to be used for the group of interest
  • control_group_name: The name to be used for the rest of the population that did not attend/ receive the intervention
  • between_language: this is the language that is used to describe the differences between the two groups
  • regression_analysis: note used, yet
  • causal: if true this will print a warning about assigning causality
  • clean_log: should be left as TRUE
  • draft: If TRUE then a DRAFT watermark will be printed on all pages
  • nc_region: If TRUE then students from NC will be broken out into a separate category when Census region of origin is examined
  • hdi_level: Highest Density Interval/ Confidence interval to be considered
  • demographics: TRUE/FALSE to complete the demographic analysis crosstabs
  • regression_analysis: TRUE/FALSE for if you print the regression analysis

12.4.4 Then make

After most of the code is written, go to the terminal and type make. This will begin to execute a series of operations that will run all of the R scripts in order, generate the Rmarkdown report as a pdf, sort the results into a file located in report/log_file.txt and then move a draft into the drafts folder.

You can continue to type make into the console whenever needed and only those files you have modified and their dependencies will be re-run.