find_test_stat {Counternull}R Documentation

Calculate Observed Test Statistic

Description

Finds observed test statistic using treatment and control outcomes

Usage

find_test_stat(y, w, test_stat = NULL, fun = NULL)

Arguments

y

Vector of observed outcomes

w

Vector indicating treatment assignments

test_stat

Name of built in test statistic function. Provide "diffmeans" for difference of means, "t" for t test, "paired-t" for paired t test, and "cohens-d" for cohen's d test (optional)

fun

Test statistic function (optional)

Details

Assignments must be indicated in argument "w" using numeric 1 or 0.

One of either argument "test_stat" or "fun" must be specified.

Argument "fun" must take in two parameters (treated outcomes and control outcomes) and returns a numeric test statistic value (scalar).

Value

Observed test statistic (numeric)

Examples

find_test_stat(sample_data$turn_angle, sample_data$w,
test_stat = c("diffmeans"))

find_test_stat(sample_data$turn_angle, sample_data$w,
 test_stat = c("t"))

[Package Counternull version 0.2.12 Index]