t_test: R function to perform a "tidy" t-test

Description Usage Arguments Details Value Examples

Description

R function to perform a "tidy" t-test

Usage

1
t_test(df, dv, group)

Arguments

df

data frame with the dependent and group variable

dv

raw (unquoted) name of the dependent variable

group

raw (unquoted) name of the grouping variable

Details

R function to compare two means using a t-test; returns the group means, test statistic and associated p-value, and effect size (Cohen's D).

Value

A data frame containing the group means, test statistic and associated p-value, and effect size (Cohen's D)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(dplyr)
storms %>%
    filter(status %in% c("tropical depression", "tropical storm")) %>%
    mutate(category = as.integer(category)) %>%
    t_test(dv = category, group = status)

storms_ss <- storms %>%
    filter(status %in% c("tropical depression", "tropical storm")) %>%
    mutate(category = as.integer(category))

t_test_df <- t_test(storms_ss, dv = category)
t_test_df

jrosen48/tidyttest documentation built on May 25, 2019, 6:25 p.m.