4 Generate the report

After carefully setting your parameters, you can now generate your report!

There are three ways to generate reports:

  1. Generate one report for one measure using the default settings render_report()

  2. Generate one report for one measure using customized settings by the users render_report_manual()

  3. Generate multiple separate reports for multiple measures using default settings render_report_multiple()

After generating the report, make sure to rename it and manually edit the sections that are text-heavy. The renaming is necessary because you may accidentally overwrite your manual edits if you regenerate the report in R.

Rmarkdown is not powerful yet to allow back-translation from Word to R codes, so your manual changes in Word will not be reflected in the R codes when you regenerate the report for some reasons (e.g. wrong file names). So we recommend finalizing the tables and plots before you write texts in the Word document (or you can just store the texts in another and move them over to the master report whenever you feel ready).

4.1 render_report()

Run ?render_report() to see what each argument represents.

Example:

render_report(input_dir = "/Users/michaelfive/Google Drive/NYU/3EA/test",
              template = "input_template_lebanon_cs.xlsx",
              index = "lebanon_cs",
              title = "Lebanon Year 1 (2016-2017)",
              output_dir = "/Users/michaelfive/Google Drive/NYU/3EA/test")

This function renders one report for the specified measure.

4.2 render_report_manual()

Run ?render_report_manual() to see what each argument represents.

Example:

render_report_manual(index = "lebanon_cs",
                     output_dir = "/Users/michaelfive/Google Drive/NYU/3EA/test")

This function opens a Shiny web page where you can click/unclick sections you’d like to include/exclude in the report (see descriptions below). It also renders one report for the specified measure.

Screen Shot 2020-12-21 at 10 13 31 PM

Parameters Description
printcode whether you’d like R codes to be printed in your document
printwarning whether you’d like to print warnings in running the codes
storecache whether you’d like to store knitr cache (only for programming purposes, see here)
set_title title
set_author author
template parameter template file path
item print item descriptions
descriptive print descriptive statistics table
ds_plot print descriptive statistics histograms
correlation_matrix_lg print factor-level correlation matrix from longitudinal invariance model
correlation_matrix_bivar print factor-level correlation matrix from master dataset
correlation_matrix_item print item-level correlation matrix from master dataset (set to FALSE because correlations among dozens of items may be unnecessary)
efa_screeplot print EFA screeplot at all waves
cfa_model_fit print CFA model fits at all waves
cfa_model_plot print CFA model path diagram (for the first specified CFA model; i.e. Time 1; assuming factor structure does not change)
cfa_model_parameters print CFA model parameters at all waves (factor loadings and thresholds)
cfa_r2 print CFA model R-squared at all wave
internal_reliability print estimates of internal reliability (Cronbach’s Alpha and McDonald’s Omega, descriptions of the other indices can be found here)
summary_item_statistics print summary item statistics (descriptions of the other indices can be found here)
item_total_statistics print total item statistics (descriptions of the other indices can be found here)
inv_tx print model fits for treatment invariance models at all waves
inv_gender print model fits for gender invariance models at all waves
inv_age print model fits for age invariance models at all waves
inv_lg print model fit for the longitudinal invariance model

4.3 render_report_multiple()

Run ?render_report_multiple() to see what each argument represents.

Example:

render_report_multiple(input_dir = "/Users/michaelfive/Google Drive/NYU/3EA/test",
                       templates = c("input_template_lebanon_cs.xlsx",
                                     "input_template_niger_psra.xlsx"),
                       output_dir = "/Users/michaelfive/Google Drive/NYU/3EA/test")

This function renders multiple reports at the same time.