one_sample_mean: Calculate the one-sample problem test statistic

View source: R/test_stats.R

one_sample_meanR Documentation

Calculate the one-sample problem test statistic

Description

This function takes a data frame, and group and outcome column names as input and returns the mean of the product of the outcome and group. This test statistic is used for the one-sample problem.

Usage

one_sample_mean(df, group_col, outcome_col)

Arguments

df

A data frame

group_col

The name of the column in df that corresponds to the group label

outcome_col

The name of the column in df that corresponds to the outcome variable

Value

The one-sample problem test statistic: the mean of the product of the outcome and group

Examples

data <- data.frame(group = c(rep(1, 4), rep(2, 4)),
                   outcome = c(rep(3, 4), rep(5, 4)))

one_sample_mean(df = data,
              group_col = "group",
              outcome_col = "outcome")


permutest documentation built on Sept. 26, 2024, 5:07 p.m.