t_test: 2 Sample t-Test

Description Usage Arguments Details Value Author(s) Examples

View source: R/t.test.stats.R

Description

Calculates and displays two sample t-test with intermediate calculations

Usage

1
2
3
4
5
6
7
t_test(xbar,sd,n,var.equal=F,alpha=0.05,alternative = c("two.sided", 
    "less", "greater"), method = c("p.value", "conf.int", "crit.val"))

S3 method for formula

t_test(formula,data,subset,var.equal=F,alpha=0.05,alternative = c("two.sided", 
    "less", "greater"), method = c("p.value", "conf.int", "crit.val"))

Arguments

xbar

vector containing the two sample means

sd

vector of two sample standard deviations

n

vector of sample size for both samples

formula

standard formula argument of the form response~group

data

data set to use for analysis

subset

vector specifying the observations to be used

var.equal

logical specifying whether to assume equality of variances

alpha

specification of the Type I error rate

alternative

string indicating whether to conduct a two-sided or a single sided alternative

method

string indicating whether to use the p-value, critical value, or confidence interval approach to carry out the test

Details

This function performs the standard two sample t-test but includes in the output all of the intermediate details including the critical values, the degrees of freedom, and the pooled standard deviation. The output is displayed using the Hypothesis testing logic/framework.

Value

t_test writes out the standard notation for the hypotheses for the population mean. Next it displays the appropriate decision rule for each of the different methods. Then the function returns the summary statistics and all the nescicary calculations. Finally, it states the statistical conclusion in terms of the hypotheses.

Author(s)

Timothy Hess hesst@ripon.edu

Examples

1
2
3
4
data(sleep)
t_test(extra~group,data=sleep)  # 2-sided p-value approach

t_test(extra~group,data=sleep,method="crit.val")  # 2-sided critical value approach

rsap documentation built on May 2, 2019, 4:53 p.m.

Related to t_test in rsap...