pst: Generate Output for Paired Samples t-test

View source: R/pst.R

pstR Documentation

Generate Output for Paired Samples t-test

Description

This function will generate the output for a paired samples t-test.

Usage

pst(x, y = NULL, z = NULL, tails = 2)

Arguments

x

A data frame column with the first variable to compare, a formula can also be passed in (~Var or Var~1)

y

A data frame column with the second variable to compare (~Var or Var~1), if a formula is passed in a data frame will be accepted

z

A data frame if formulas are used in x and y and data is not piped in

tails

an integer indicating whether the test is one-tailed '1' or two-tailed '2'

Value

A list of output for reporting $analysis_type, $results, $descriptive_statistics

Examples

pst_results <- pst_data %>% pst(~scones, ~tea)
pst_results <- pst(pst_data$black_tea, pst_data$green_tea, tails = 1)
pst_results <- pst(pst_data, ~scones, ~tea)
pst_results <- pst(~scones, ~tea, pst_data)
pst_results <- pst(pst_data$black_tea, pst_data$green_tea)
pst_results <- pst(scones ~ tea, pst_data_tall)

ECO230/eco230r documentation built on Feb. 26, 2025, 2:45 p.m.