run_statistical_tests: Run Statistical Tests

View source: R/run_statistical_tests.R

run_statistical_testsR Documentation

Run Statistical Tests

Description

Summary function to run multiple hypothesis tests over a survey dataset in line with IMPACT Quantitative Data Analysis Guidelines for Significance Testing

Usage

run_statistical_tests(
  df = df,
  aggregation = NULL,
  svy_weights = NULL,
  strata = NULL,
  sample_design = NULL,
  cluster = NULL,
  categorical_vars = NULL,
  numerical_vars = NULL,
  regression_outcome = NULL,
  regression_predictors = NULL
)

Arguments

df

Inputs the dataset

aggregation

Inputs a character value specifying the column name of the variable for the groups you want to compare.

svy_weights

Inputs a character value specifying the column name of the survey weights column, if applicable.

strata

Inputs a character value specifying the column name of the survey strata column, if applicable.

sample_design

Inputs a character value specifying the overall survey design. Options include 'srs' for simple random sampling, 'two_stage_cluster', 'two_stage_stratified', and 'two_stage_stratified_cluster'.

cluster

Inputs a character value specifying the column name of hte survey cluster column, if applicable.

categorical_vars

Inputs a character vector of the column names of all the binary or categorical variables to test for differences across the specified group/aggregation.

numerical_vars

Inputs a character vector of the column names of all the numerical variables to test for differences across the specified group/aggregation.

regression_outcome

Inputs a character value of the column name of the variable you want to treat as a regression outcome.

regression_predictors

Inputs a character vector of the column names of the variables you want to treat as a regression predictors.

Value

Returns a summary dataframe of the comparisons made, tests run, and p-values.

Examples

## Not run: run_statistical_tests(df = mydata, aggregation = "sex_hoh", sample_design = "srs",
 categorical_vars = c("hhs_severe", "improved_water_source"))
## End(Not run)

SaeedR1987/healthyr documentation built on July 4, 2023, 11:17 p.m.