ANOVA
Description
The td_anova_sqle()
function performs one-way td_anova_sqle (Analysis of Variance) on
a data set with two or more groups. td_anova_sqle is a statistical test that
analyzes the difference between the means of more than two groups.
The null hypothesis (H0) of td_anova_sqle is that there is no difference among
group means. However, if any one of the group means is significantly
different from the overall mean, then the null hypothesis is rejected.
You can use one-way Anova when you have data on an independent variable
with at least three levels and a dependent variable.
For example, assume that your independent variable is insect spray type, and you have data on spray type A, B, C, D, E, and F. You can use one-way td_anova_sqle to determine whether there is any difference in the dependent variable, insect count based on the spray type used.
Usage
td_anova_sqle (
data = NULL,
group.columns = NULL,
alpha = 0.05,
...
)
Arguments
data |
Required Argument. |
group.columns |
Optional Argument. |
alpha |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. Below volatile: Function allows the user to partition, hash, order or local order the input data. These generic arguments are available for each argument that accepts tbl_teradata as input and can be accessed as:
Note: |
Value
Function returns an object of class "td_anova_sqle"
which is a named list containing object of class "tbl_teradata".
Named list member(s) can be referenced directly with the "$" operator
using the name(s):result
Examples
# Get the current context/connection.
con <- td_get_context()$connection
# Load the example data.
loadExampleData("tdplyr_example", "insect_sprays")
# Create tbl_teradata object.
insect_sprays <- tbl(con, "insect_sprays")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1 : Perform one-way anova analysis on a data set with
# two or more groups.
ANOVA_out_1 <- td_anova_sqle(data = insect_sprays,
alpha = 0.05)
# Print the result.
print(ANOVA_out_1$result)
# Example 2 : Perform one-way anova analysis on a data set with more
# than two groups and group.columns argument specified.
ANOVA_out_2 <- td_anova_sqle(data = insect_sprays,
group.columns=colnames(insect_sprays)[3:5],
alpha = 0.05)
# Print the result.
print(ANOVA_out_2$result)