Skip to contents

Obtains a summary post_jointVIP object

Usage

# S3 method for post_jointVIP
summary(
  object,
  ...,
  smd = "cross-sample",
  use_abs = TRUE,
  bias_tol = 0.01,
  post_bias_tol = 0.005
)

Arguments

object

a post_jointVIP object

...

not used

smd

specify the standardized mean difference is cross-sample or pooled

use_abs

TRUE (default) for absolute measures

bias_tol

numeric 0.01 (default) any bias above the absolute bias_tol will be summarized

post_bias_tol

numeric 0.005 (default) any bias above the absolute bias_tol will be summarized

Value

no return value

Examples

data <- data.frame(year = rnorm(50, 200, 5),
                   pop = rnorm(50, 1000, 500),
                   gdpPercap = runif(50, 100, 1000),
                   trt = rbinom(50, 1, 0.5),
                   out = rnorm(50, 1, 0.2))
# random 20 percent of control as pilot data
pilot_sample_num = sample(which(data$trt == 0),
                          length(which(data$trt == 0)) *
                          0.2)
pilot_df = data[pilot_sample_num, ]
analysis_df = data[-pilot_sample_num, ]
treatment = "trt"
outcome = "out"
covariates = names(analysis_df)[!names(analysis_df)
                                %in% c(treatment, outcome)]
new_jointVIP = create_jointVIP(treatment = treatment,
                               outcome = outcome,
                               covariates = covariates,
                               pilot_df = pilot_df,
                               analysis_df = analysis_df)

## at this step typically you may wish to do matching or weighting
## the results after can be stored as a post_data
## the post_data here is not matched or weighted, only for illustrative purposes
post_data <- data.frame(year = rnorm(50, 200, 5),
                        pop = rnorm(50, 1000, 500),
                        gdpPercap = runif(50, 100, 1000),
                        trt = rbinom(50, 1, 0.5),
                        out = rnorm(50, 1, 0.2))
post_dat_jointVIP = create_post_jointVIP(new_jointVIP, post_data)
summary(post_dat_jointVIP)
#> Max absolute bias is 0.358
#> 3 variables are above the desired 0.01 absolute bias tolerance
#> 3 variables can be plotted
#> 
#> Max absolute post-bias is 0.382
#> Post-measure has 3 variable(s) above the desired 0.005 absolute bias tolerance