[R] chi-square and error bars?

Dan Bolser dmb at mrc-dunn.cam.ac.uk
Tue Jan 18 18:16:46 CET 2005


This may sound crazy but...

I have data like this...

> results.matrix
     [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12]
[1,]  949   93    2   11   26   20    7    6   10     5     0     3
[2,] 1233  124   24   35   58   57   17   21   31    19    11    21


Which is the result of binning (summing) the response variables of an
underlying (nearly) continious range of predictor variable into 12 bins.

I can see that each row is not drawn from the same underlying population
using chisq.test.

What I would like to do is plot each proportion from each row with a
confidence interval which represents the results of the chisq.test,
i.e. put confidence intervals on each proportion.

I thought about doing the arcsine transformation on the proportions and
then I can use the binomial distribution to get the variance and hence 95%
confidence interval (then back transformation).

Clearly confidence in latter points is weaker (fewer observations), but I
can't seem to find a plot to capture this fact.




More information about the R-help mailing list