Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Calculate Confidence Interval

I'm attempting to calculate confidence interval the same way Excel does with CONFIDENCE.NORM, which is calculating a confidence interval for a population mean using normal distribution.  In this case the confidence level is 90%.  Is there a formula or function that would work in such a case?  I looked over the TTest functions but none really caught my eye.

2 Replies
Frank_Hartmann
Master II
Master II

search for

TTest_lower, TTest_upper and TTest_conf:


Qlikview HELP:

TTest_lower ( [set_expression] [ total [<fld {,fld}>] group, value [, sig = 0.025 [, eq_var = true]])

returns the aggregated value for the lower end of the confidence interval for two independent series of values iterated over the chart dimension(s). See the TTest_t ([set_expression][ total [<fld {,fld}>] group, value [, eq_var = true]) and TTest_conf ([set_expression][ total [<fld {,fld}>] group, value [, sig = 0.025 [, eq_var = true]]) functions for argument descriptions.

The same limitations with regard to nested aggregation as those listed under the chi2test_p ([set_expression][ total [<fld {,fld}>] col, row, observed_value [, expected_value]) function apply. This function supports the total qualifier in the same manner as described under the chi2test_p ([set_expression][ total [<fld {,fld}>] col, row, observed_value [, expected_value]) function.

Examples:

ttest_lower( Group, Value )

ttest_lower( Group, Value, false )

TTest_conf ([set_expression][ total [<fld {,fld}>] group, value [, sig = 0.025 [, eq_var = true]])

returns the aggregated t value for two independent series of values iterated over the chart dimension(s). The two-tailed level of significance can be specified in sig. If omitted sig will be set to 0.025, resulting in a 95% confidence interval. See the TTest_t ([set_expression][ total [<fld {,fld}>] group, value [, eq_var = true]) function for descriptions of the other arguments.

The same limitations with regard to nested aggregation as those listed under the chi2test_p ([set_expression][ total [<fld {,fld}>] col, row, observed_value [, expected_value]) function apply. This function supports the total qualifier in the same manner as described under the chi2test_p ([set_expression][ total [<fld {,fld}>] col, row, observed_value [, expected_value]) function.

Examples:

ttest_conf( Group, Value )

ttest_conf( Group, Value, false )

TTest_upper ([set_expression][ total [<fld {,fld}>] group, value [, sig = 0.025 [, eq_var = true]])

returns the aggregated value for the upper end of the confidence interval for two independent series of values iterated over the chart dimension(s). See the TTest_t ([set_expression][ total [<fld {,fld}>] group, value [, eq_var = true]) and TTest_conf ([set_expression][ total [<fld {,fld}>] group, value [, sig = 0.025 [, eq_var = true]]) functions for argument descriptions.

The same limitations with regard to nested aggregation as those listed under the chi2test_p ([set_expression][ total [<fld {,fld}>] col, row, observed_value [, expected_value]) function apply. This function supports the total qualifier in the same manner as described under the chi2test_p ([set_expression][ total [<fld {,fld}>] col, row, observed_value [, expected_value]) function.

Examples:

ttest_upper( Group, Value )

ttest_upper( Group, Value, false )

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

TTest_conf (group, value [, sig = 0.025 [, eq_var = true]])

returns the aggregated t value for two independent series of values iterated over a number of records as defined by a group by clause. The two-tailed level of significance can be specified in sig. If omitted sig will be set to 0.025, resulting in a 95% confidence interval. See the TTest_t (group, value [, eq_var = true]) function for descriptions of the other arguments.

Example:

Load Year, ttest_conf(Group, Value) as X from abc.csv group by Year;

TTest_lower (group, value [, sig = 0.025 [, eq_var = true]])

returns the aggregated value for the lower end of the confidence interval for two independent series of values iterated over a number of records as defined by a group by clause. See the TTest_t (group, value [, eq_var = true]) and TTest_conf (group, value [, sig = 0.025 [, eq_var = true]]) functions for argument descriptions.

Example:

Load Year, ttest_lower(Group, Value) as X from abc.csv group by Year;

TTest_upper (group, value [, sig = 0.025 [, eq_var = true]])

returns the aggregated value for the upper end of the confidence interval for two independent series of values iterated over a number of records as defined by a group by clause. See the TTest_t (group, value [, eq_var = true]) and TTest_conf (group, value [, sig = 0.025 [, eq_var = true]]) functions for argument descriptions.

Example:

Load Year, ttest_upper(Group, Value) as X from abc.csv group by Year;

Anonymous
Not applicable
Author

Thanks for the reply!  In the end I found an equation that worked.

In case anyone else comes across this, I was able to apply the Z score for normal distrubtion for 90% as follows..

=1.6448536 *(stddev(range of values)/sqrt(population size))