TD_FTest Function | Hypothesis Testing | Teradata Vantage - TD_FTest - Teradata® Database

Database Analytic Functions

Product
Teradata® Database
Release Number
17.10
Published
July 2021
Language
English (United States)
Last Update
2021-07-28
dita:mapPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/wnd1589838592459.ditamap
dita:ditavalPath
Teradata_Vantage™___Advanced_SQL_Engine_Analytic_Functions.withLogo_upload_July2021/ayr1485454803741.ditaval
dita:id
B035-1206
lifecycle
previous
Product Category
Teradata Vantage™

TD_FTest performs an F-test, for which the test statistic follows an F-distribution under the Null hypothesis.

TD_FTest compares the variances of two independent populations. If the variances are significantly different, TD_FTest rejects the Null hypothesis, indicating that the variances may not come from the same underlying population.

Use TD_FTest to compare statistical models that have been fitted to a data set, to identify the model that best fits the population from which the data were sampled.

Assumptions

  • Populations from which samples are drawn are normally distributed.
  • Populations are independent of each other.
  • Data is numeric.

Test Type

  • One-tailed (lower and upper-tailed) or two-tailed (your choice)
  • Two-sample
  • Unpaired

Computational Method

The F-test is used to test the Null hypothesis σ2 = sigma0_sq in various applications. For example, you might need to test the variability in the measurement of the thickness of a manufactured part in a factory. If the thickness is not equal to a certain thickness (sigma0_sq ) then you can conclude that the manufacturing process is uncontrolled. The types of hypothesis are as follows:

H0: σ2 = sigma0_sq

versus

H1: σ2 > sigma0_sq (upper-tailed)

or

H1: σ2 < sigma0_sq (lower-tailed)

or

H1: σ2sigma0_sq (two-tailed)

Let x1, x2,....xn be a random sample. To test the above hypotheses, the test statistic is calculated as:


F-Test formula

where s2_formula

The statistic χ2 follows an F distribution with n-1 degrees of freedom.

For the one-sided upper-tailed test σ2 > sigma0_sq the Null hypothesis H0 is rejected if H0_onesided_right_tailed_test.

For the one-sided lower-tailed test σ2 < sigma0_sq, the Null hypothesis H0 is rejected if H0_onesided_left_tailed_rejection.

For the two-sided alternative σ2sigma0_sq, the Null hypothesis H0 is rejected if


2_sided_null_hypothesis_rejected
Also, the F-test is used to test if the variances of two populations are equal. The F-test can have the following tests:
  • One-tailed test: The test is used to determine if the variance of one population is either greater than (upper-tailed) or less than (lower-tailed) the variance of another population.
  • Two-tailed test: The test is used to determine significant differences in variances of the two populations and tests the Null hypothesis (H0) against the alternative hypothesis (H1) to find out if the variances are not equal.
Let x1, x2,....xn1 ~Ɲ (µ1, σ2) and y1, y2,....yn2 ~Ɲ (µ2, σ2) be random samples from two independent populations. The corresponding sample means and variances are as follows:
  • Sample Means Formula: sample_means_x_formula
  • Sample Variance Formula: sample_variance_y_formula
  • Sample Variance Formula for s1_square and s2_square: sample_variance_s1_formula and sample_variance_s2_formula

In the following calculation, assume that sample 1 has a larger variance than sample 2. If sample 2 has a larger variance than sample 1, switch the samples and apply the same formula.

H0: sigma1_sq = sigma2_sq

versus

H1: sigma1_sq > sigma2_sq

or

sigma1_sq < sigma2_sq

The test statistic for the one-sided upper tailed test (sigma1_sq > sigma2_sq) is calculated as:


1_sided_right_tailed_test

where: n1-1 and n2-1 are degrees of freedom corresponding to sample 1 and sample 2.

The Null hypothesis H0 is rejected if 1_sided_right_tailed_test_H0_rejected.

The test statistic for the one-sided lower-tailed test (sigma1_sq < sigma2_sq) is calculated as:


1_sided_left_tailed_test_stats

The Null hypothesis H0 is rejected if 1_sided_left_tailed_test_stats_H0_rejected.

For the two-sided hypothesis test:

H0: sigma1_sq = sigma2_sq

versus

H1: sigma1_sqsigma2_sq

The Null hypothesis H0 is rejected if:


H0_rejected_2_sided_test

The two-tailed test is based on the upper tail of the F-distribution.