ttestfordf | R Documentation |
Performs a t test on two groups within a dataframe based on a grouping variable and returns the p-value.
ttestfordf(
dataframe,
groupvar1,
groupvar2,
groupname_var,
value_var,
alternative_var,
round_var = 2,
sciformat_var = FALSE
)
dataframe |
A data frame containing the data. |
groupvar1 |
The first group to be compared. |
groupvar2 |
The second group to be compared. |
groupname_var |
The column name in dataframe that represents the grouping variable. |
value_var |
The column name in dataframe representing the values on which the t test is performed. |
alternative_var |
A character string specifying the alternative hypothesis, must be one of "two.sided" (default), "greater" or "less". |
A data frame with the p-value of the t test. If there's insufficient data for either group, the result will be "Insufficient data".
## Not run:
df <- data.frame(group = c("A", "A", "B", "B"), value = c(1,2,3,4))
wilcoxtestfordf(df, "A", "B", "group", "value", "less")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.