[R] 95% CI of a IQR and more

David Winsemius dwinsemius at comcast.net
Sun Dec 12 19:11:17 CET 2010


On Dec 12, 2010, at 10:13 AM, Beckie wrote:

>
> Hi guys!
>
> I have to calculate the 95% CI for the IQR. I have 100samples with
> continuous numbers using a compute-intensive method.
> 1)I can calculate the 95%CI and the IQR, but I don't know how to  
> calculate
> the CI of the IQR, does anybody have any idea, which method will be
> appropriate?

You could bootstrap  the distribution of the 25th and 75th order  
statistics in your sample or you could look up the analytical  
distribution in David's "Order Statistics". I can assure you that the  
first option will be easier. Come to think of it that would not  
actually answer the question, but it should point you to a particular  
class of tools.

> 2)I have a 2x2 table with gender vs blue eyes or not.

Making this sound even very much more like homework. (HW not generally  
encouraged on R-help. Suggest you read the Posting Guide.)

> How do I calculate the
> expected two-by-two contingency tables? Do I assume that half the  
> people are
> female and half are males. And assume some random chance of your  
> eyecolor
> being blue?

Doesn't sound right to me. You might want to look at the documentation  
and code for fisher.test().

> 3) I have to use a permutation test, to calculate whether there is a
> difference in the median of two samples. - How do I do that? I thought
> permutation test only was for categorical data?

Check out the coin package.

-- 
David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list