svy_cohen_d_pair: t.test for survey object with Cohen's d

View source: R/stat_tests.R

svy_cohen_d_pairR Documentation

t.test for survey object with Cohen's d

Description

This function calculates a t.test() for two groups in a srvyr survey object. It is particularly helpful when the grouping variable has more than two levels and you just want to compare two of them.

Usage

svy_cohen_d_pair(df, dv, iv, pair, ttest = T)

Arguments

df

A dataframe

dv

Character. Name of the dependent variable for the t.test (numeric)

iv

Character. Name of the grouping variable for the t.test (factor)

pair

Character vector of length 2. Levels of iv to be compared in t.test

ttest

Logical. Should t.test be run and displayed? Otherwise, only Cohen's d is calculated. Defaults to TRUE.

Value

Invisibly returns a list including the t.test() output and Cohen's d


LukasWallrich/rNuggets documentation built on Aug. 26, 2022, 11:03 a.m.