ZTest
Description
td_ztest_sqle()
function tests the equality of two means under the assumption that the
population variances are known. For large samples, sample variances
approximate population variances, so it uses sample variances
instead of population variances in the test statistic.
Usage
td_ztest_sqle (
data = NULL,
alpha = 0.5,
first.sample.column = NULL,
second.sample.column = NULL,
alternate.hypothesis = "two-tailed",
first.sample.variance = NULL,
second.sample.variance = NULL,
mean.under.h0 = NULL,
...
)
Arguments
data |
Required Argument. |
alpha |
Optional Argument. |
first.sample.column |
Required Argument. |
second.sample.column |
Optional Argument. |
alternate.hypothesis |
Optional Argument.
Default Value: "two-tailed" |
first.sample.variance |
Required Argument. |
second.sample.variance |
Optional Argument. |
mean.under.h0 |
Optional Argument. |
... |
Specifies the generic keyword arguments SQLE functions accept. 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_ztest_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", "titanic")
# Create tbl_teradata object.
titanic_data <- tbl(con, "titanic")
# Check the list of available analytic functions.
display_analytic_functions()
# Example 1: Perform Ztest analysis on input data column that
# contains data for the first sample population and
# variance of the first sample population.
obj <- td_ztest_sqle(data=titanic_data,
first.sample.column='age',
first.sample.variance=5)
# Print the result.
print(obj$result)
# Example 2: Perform Ztest analysis on input data column that
# contains data for the first and second sample
# population and variance of the first and second sample
# population by specifying data.partition.column as ANY.
# To partition data using ANY, one must import 'PartitionKind' module first,
# then pass PartitionKind$ANY as input to "data.partition.column" argument.
obj <- td_ztest_sqle(data=titanic_data,
alpha=0.5,
data.partition.column=PartitionKind$new("ANY"),
data.order.column='pclass',
first.sample.column='age',
second.sample.column='parch',
alternate.hypothesis='two-tailed',
first.sample.variance=5,
second.sample.variance=8,
mean.under.h0=0)
# Print the result.
print(obj$result)