ttest
Table of Contents
The ttest
function performs a two sided t-test on two random samples drawn from two queries. The ttest
function takes four parameters:
-
The numeric field on which to perform the t-test
-
The query for drawing the first sample
-
The query for drawing the second sample
-
The sample size for both samples
Sample syntax
select ttest(sepal_width_d, "species_s:versicolor", "species_s:virginica", 150) as t,
p_value
from iris
Result set
The result set for the ttest function contains one row with the results of the ttest. The ttest function returns the t statistic. The p_value field can be selected to return the p-value for the ttest.
Sample result set in Apache Zeppelin:
Visualization
Sample visualization of the ttest function using the Apache Zeppelin number visualization: