ttest_1samp
- hana_ml.algorithms.pal.stats.ttest_1samp(data, col=None, mu=0, test_type='two_sides', conf_level=0.95)
Performs the t-test to determine whether a sample of observations could have been generated by a process with a specific mean.
- Parameters:
- dataDataFrame
DataFrame containing the data.
- colstr, optional
Name of the column for sample.
If not given, it defaults to the first column.
- mufloat, optional
Hypothesized mean of the population underlying the sample.
Defaults to 0.
- test_type{'two_sides', 'less', 'greater'}, optional
The alternative hypothesis type.
Defaults to 'two_sides'.
- conf_levelfloat, optional
Confidence level for alternative hypothesis confidence interval.
Defaults to 0.95.
- Returns:
- DataFrame
Statistics results.
Examples
>>> df.collect() X1 0 1.0 1 2.0 2 4.0 3 7.0 4 3.0
Perform One Sample T-Test:
>>> ttest_1samp(data=df).collect() STAT_NAME STAT_VALUE 0 t-value 3.302372 1 degree of freedom 4.000000 2 p-value 0.029867 3 _PAL_MEAN_X1_ 3.400000 4 confidence level 0.950000 5 lowerLimit 0.541475 6 upperLimit 6.258525