t_test_report {LorMe} | R Documentation |
Print Student's t-Test report
Description
Print Student's t-Test report
Usage
t_test_report(
data,
treatment_col,
value_col,
paired,
subject_col,
report = TRUE
)
Arguments
data |
Data frame containing the treatment, value and other information. |
treatment_col |
Numeric indicating where treatment locates (column number) in data. |
value_col |
Numeric indicating where treatment value (column number) in data. |
paired |
Logical indicating whether you want a paired t-test. |
subject_col |
Only meaningful when Pair is ture. Numeric indicating where subject of treatment (column number) in data. |
report |
Logical. If print report to console. Default:TRUE |
Value
t_test_report returns list containing:
data frame of basic data descrption
results of student's t-Test
Examples
{
### Data preparation ###
testdata <- data.frame(
treatment = c(rep("A", 6), rep("B", 6)),
subject = rep(c(1:6), 2),
value = c(rnorm(6, 2), rnorm(6, 1))
)
# Perform t-test (unpaired)
t_test_result <- t_test_report(
data = testdata,
treatment_col = 1,
value_col = 3
)
# Perform paired t-test
t_test_result <- t_test_report(
data = testdata,
treatment_col = 1,
value_col = 3,
paired = TRUE,
subject_col = 2
)
### Basic data description ###
print(t_test_result[[1]])
print(t_test_result$basicdata)
### T-test results ###
print(t_test_result[[2]])
print(t_test_result$t.test_results)
}
[Package LorMe version 1.2.1 Index]