t_test_overlap function

Test for differences in means/percentages between two potentially overlapping groups

Test for differences in means/percentages between two potentially overlapping groups

t_test_overlap( survey_design, y_vars, na.rm = TRUE, status, group_1, group_2, null_difference = 0, alternative = "unequal", degrees_of_freedom = survey::degf(survey_design) - 1 )

Arguments

  • survey_design: A survey design object created with the survey package.

  • y_vars: Names of dependent variables for tests. For categorical variables, percentages of each category are tested.

  • na.rm: Whether to drop cases with missing values for a given dependent variable.

  • status: The name of the variable representing response/eligibility status.

  • group_1: Vector of values of status variable representing the first group

  • group_2: Vector of values of status variable representing the second group

  • null_difference: The hypothesized difference between the groups' means. Default is 0.

  • alternative: Can be one of the following:

    • 'unequal': two-sided test of whether difference in means is equal to null_difference
    • 'less': one-sided test of whether difference is less than null_difference
    • 'greater': one-sided test of whether difference is greater than null_difference
  • degrees_of_freedom: The degrees of freedom to use for the test's reference distribution. Unless specified otherwise, the default is the design degrees of freedom minus one, where the design degrees of freedom are estimated using the survey package's degf method.

Returns

A data frame describing the difference in group means/percentages and the statistics from the t-test

  • Maintainer: Ben Schneider
  • License: GPL (>= 3)
  • Last published: 2023-11-21

Useful links