View source: R/run_statistical_tests.R
run_statistical_tests | R Documentation |
Summary function to run multiple hypothesis tests over a survey dataset in line with IMPACT Quantitative Data Analysis Guidelines for Significance Testing
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
)
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. |
Returns a summary dataframe of the comparisons made, tests run, and p-values.
## Not run: run_statistical_tests(df = mydata, aggregation = "sex_hoh", sample_design = "srs",
categorical_vars = c("hhs_severe", "improved_water_source"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.