Learn R Programming

vannstats (version 1.6.1.08)

is.t: Simplified Independent Samples T-Test

Description

This function simplifies the call for the independent samples t-test (is.t) on a given data frame.

Usage

is.t(df, var1, var2, var.equal = TRUE, two.tailed = TRUE)

Value

This function returns the summary results table for an independent samples t-test, examining the mean differences of var1 (in data frame df) between groups in var2.

Arguments

df

data frame to read in.

var1

the dependent/outcome variable, \(Y\).

var2

the main independent/predictor variable, \(X\).

var.equal

logical (default set to T). When set to var.equal = F, will employ Welsh's correction to the t-test (for data that violate the equal variances assumption).

two.tailed

logical (default set to T). When set to two.tailed = F, will return results of a one-sided t-test.

Examples

Run this code
data <- mtcars

ttest <- is.t(data,mpg,am)
summary(ttest)

Run the code above in your browser using DataLab