Tutorial has hidden code that reader should be aware of
Brought up by Anthony Liu.
A few things are have echo = FALSE option set on the R-chunk. This was done to hide messy code unrelated to tutorial. While it's all available in the .Rmd file, it is confusing to the reader who is trying to copy and paste the visible code from the tutorial as it will not work as expected without some of this hidden code.
To do: Alex needs to separate messy code that should be hidden from code that could be "brought forward."
Notes from Anthony below for future reference.
Issues occur in Evaluating synthetic control fit, Calculate pre-treatment sd, and Store Cohen's D in each period for cross-validated lambda.
Specific issues: PreTreatmentSD <- sd(unlist(SCUL.output$y.actual[1:(SCUL.input$TreatmentBeginsAt-1),])) out of echo = FALSE and StandardizedDiff <- abs(SCUL.output$y.actual-SCUL.output$y.scul)/PreTreatmentSD names(StandardizedDiff) <- c("scul.cv") and StandardizedDiff <- abs(SCUL.output$y.actual-SCUL.output$y.scul)/PreTreatmentSDnames(StandardizedDiff) <- c("scul.cv")
Coady thinks that adding this line Results.y.StandardizedDiff <- (SCUL.output$y.actual-SCUL.output$y.scul)/sd(unlist(SCUL.output$y.actual[1:(SCUL.input$TreatmentBeginsAt-1),])) fixes some of the issues.