Additional options available in the jointVIP package

Setting up to demonstrate jointVIP

See the Get started with jointVIP vignette to get started on how to use jointVIP package. Using the same data sets, this vignette’s main purpose is to demonstrate other options that are available.

library(jointVIP)

# gentle reminder of how to create a new jointVIP object
new_jointVIP = create_jointVIP(treatment = treatment,
                               outcome = outcome,
                               covariates = covariates,
                               pilot_df = pilot_df,
                               analysis_df = analysis_df)

# gentle reminder of how to create a new post_jointVIP object
post_optmatch_jointVIP = create_post_jointVIP(new_jointVIP,
                                             post_analysis_df = optmatch_df)

Demonstration for additional options in summary() and print()

# # simplest usage
# summary(new_jointVIP)

summary(new_jointVIP, 
        smd = 'pooled', 
        use_abs = FALSE, 
        bias_tol = 0.005)
#> Max bias is 0.093
#> Min bias is -0.003
#> 4 variables are above the desired 0.005 absolute bias tolerance
#> 8 variables can be plotted

print(new_jointVIP, 
      smd = 'pooled', 
      use_abs = FALSE, 
      bias_tol = 0.005)
#>           bias
#> log_re75 0.093
#> log_re74 0.038
#> marr     0.007
#> nodegree 0.005

# not run
# get_measures(new_jointVIP, smd = 'cross-sample')

The summary() and print() functions have the same additional parameters and uses rounded numbers to the third decimal place.

Under the hood, get_measures() function is used to calculate. If the researcher wishes to save the measures calculated, perhaps get_measures() would be used; example is shown above. Only signed measures are presented as outputs for that function.

Demonstration for additional options in plot()

# # simplest usage
# plot(new_jointVIP)

plot(new_jointVIP, 
     smd = 'pooled', 
     use_abs = FALSE, 
     plot_title = 'Signed version of the jointVIP with pooled SMD')


plot(new_jointVIP, 
     bias_curve_cutoffs = c(0.005, 0.05, 0.10),
     text_size = 5, 
     label_cut_std_md = 0.1,
     max.overlaps = 15,
     plot_title = 'Increased text size and bias curve specifications',
     expanded_y_curvelab = 0.002
     #label_cut_outcome_cor = 0.2,
     #label_cut_bias = 0.1
     )


plot(new_jointVIP, 
     bias_curves = FALSE,
     add_var_labs = FALSE,
     plot_title = 'No bias curves or variable labels'
     )

There are many parameters for the plot() option. The smd and use_abs options functions the same as above. The other main parameter input is plot_title, which allows users to specify the title of the plot. Additional parameters not listed as a main parameter is explained and example usage is shown above.

Post-analysis parameters examples

The same variables are specified in the Get started with jointVIP vignette; here we choose a matching example to demonstrate the additional parameters.

Demonstration for additional options in summary() and print()

# get_post_measures(post_optmatch_jointVIP, smd = 'cross-sample')

summary(post_optmatch_jointVIP,
        use_abs = FALSE,
        bias_tol = 0.01,
        post_bias_tol = 0.001)
#> Max bias is 0.113
#> Min bias is -0.003
#> 2 variables are above the desired 0.01 absolute bias tolerance
#> 8 variables can be plotted
#> 
#> Max absolute post-bias is 0.005
#> Post-measure has 6 variable(s) above the desired 0.001 absolute bias tolerance

print(post_optmatch_jointVIP,
      bias_tol = 0.001)
#>           bias post_bias
#> log_re75 0.113     0.005
#> log_re74 0.045     0.003
#> marr     0.005     0.003
#> nodegree 0.005     0.004
#> black    0.003     0.002
#> age      0.002     0.003
#> educ     0.001     0.001
#> hisp     0.001     0.001

plot(post_optmatch_jointVIP, 
     plot_title = "Post-match jointVIP using rcbalance matching",
     smd = 'cross-sample',
     use_abs = FALSE,
     add_post_labs = TRUE,
     post_label_cut_bias = 0.001)

All of the options from above can be used; below will only address additional parameters or function outputs.