[Skip Global Navigation]

SPSS Tech Tips

SPSS Direct Home

Confidence intervals for percentages and counts in SPSS charts

This is a complimentary tip available only to SPSS Direct subscribers.

Question

I see that SPSS will produce confidence intervals for percentages (and counts) for certain charts, such as bar charts and line charts. I don’t see a procedure that will produce these intervals. Is there a way to get the numbers shown for the confidence intervals from the charts?

Answer

There is no current SPSS procedure that will produce the confidence interval values for percentages or counts shown in SPSS charts, and there is no way to obtain the confidence interval bounds from the charts. However, it is fairly simple to compute these values.

We’ll illustrate how with an example. Below is a bar chart of the percentage of those respondents in the 1991 U.S. General Social Survey.sav file, which comes with SPSS, who reply that they are “very happy,” “pretty happy,” and ”not too happy.”


Figure 1: General happiness as recorded in the 1991 U.S. General Social Survey

If you run the FREQUENCIES procedure on the variable “happy,” you will see that the counts represented are 467, 872, and 165, respectively, for the three categories, with a total of 1,504 non-missing responses. The following commands may be run in an SPSS command syntax window to produce the confidence interval bounds shown in the chart:

DATA LIST FREE / happy number.
BEGIN DATA
1 467
2 872
3 165
END DATA.
COMPUTE total=1504.
COMPUTE alpha=.05.
COMPUTE pct=100*number/total.
COMPUTE lower=100*IDF.BETA(alpha/2,number+.5,total-number+.5).
COMPUTE upper=100*IDF.BETA(1-alpha/2,number+.5,total-number+.5).
EXECUTE.

The resulting data should look like the following file:

The intervals constructed here are individual confidence intervals for each response, using that count as a proportion of the total, with transformation to percentages via multiplication by 100 (for charts with counts, proportions are rescaled via multiplication by the total N across the categories; 1,504 for this example). Notice that the confidence interval bounds are not symmetric around the percentages.

The types of intervals computed are known as equal-tailed Jeffreys prior intervals. Although derived via Bayesian methods, they have also been shown to have excellent frequentist properties. For more information, see the references for the algorithms document, intervals_pct_counts.pdf, available on the SPSS CD and at http://support.spss.com/Tech/Products/SPSS/Documentation/
Statistics/algorithms/index.html