tests_t: Performs One Sample and Two Sample T-tests on a given dataset

Description Usage Arguments Value See Also Examples

Description

Performs One Sample and Two Sample T-tests on a given dataset. The data can be a mixture of numric and factor variables. The results are outputed as a data frame. Furthermore the results an be saved as .csv file to a specified directory.

Usage

1
2
3
tests_t(dataset, y_index = NULL, y_name = NULL, mu = NULL,
  alternative = c("two.sided", "greater", "less"), conf.level = 0.95,
  paired = FALSE, var.equal = FALSE, file_name = NULL, directory = NULL)

Arguments

dataset

A dataset on which T-tests are performed.

y_index

An integer value, the column index of the response variable, the default is NULL.

y_name

A character value, the column name of the response variable, the default is NULL.

mu

An numeric value specifying the mean.

alternative

The type of hypothesis being tested; two.sided, greater, less. The default is "two.sided"

conf.level

The level of confidence used in the t-test, default is 0.95

paired

Logical value indicating a paired t-test

var.equal

Logical value indicating the two tested variables have equal variance

file_name

A character object indicating the file name when saving the data frame. The default is NULL. The name must include the .csv suffixs.

directory

A character object specifying the directory where the data frame is to be saved as a .csv file. The default is NULL.

Value

Outputs the T-test information as a data frame.

See Also

tests_chisq, tests_cors, tests_ks, tests_norm, tests_proptest, tests_var, tests_wilcoxon

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#-- Example Lung Capacity Data --#

# Perform T-tests on the entire dataset
tests_t(dataset = lungcap)

# Perform T-tests in relation to the second column
tests_t(dataset = lungcap, y_index = 2)

# Perform T-tests in relation to the 'Age' column
tests_t(dataset = lungcap, y_name = "Age")

oislen/BuenaVista documentation built on May 16, 2019, 8:12 p.m.