# [R] Mean from confidence intervals

David Winsemius dwinsemius at comcast.net
Sat Jan 29 22:48:04 CET 2011

```On Jan 29, 2011, at 9:39 AM, Peter Francis wrote:

> Dear all,
>
> The data is generated from 1000 random samples of a phylogenetic
> tree to calculate phylogenetic diversity. I sampled the tree 1000
> times at with various species communities (600) to get a random PD
> per community. I then want to test my observed PD with that of a
> random sample to test for significance.

Color me puzzled. I thought you already had a test (the p value) and
you wanted an estimate for a mean given that you had a 95% CI.

> However the script i used, output
>
> q0.005	q0.01 etc upto q0.995

Those look like names or labels for quantiles. This would move along a
lot faster if you gave a more complete listing of the output and the
code used to generate it.

--
David.
>
> But i wanted to know the mean PD value per community based on the
> output, and that is where i am struggling
>
> Thanks,
>
> Peter
> On 29 Jan 2011, at 02:16, Joshua Wiley wrote:
>
> Hi Peter,
>
> Do you know the formula used to calculate the confidence interval?  I
> suspect it is possible with minimal algebraic manipulation of the CI
> formula to find what the mean is.  Assuming a normal distribution (as
> David), then it is certainly possible to find.  This wikipedia page
> might help:
>
> http://en.wikipedia.org/wiki/Confidence_interval
>
> And no, this is not really the correct place to ask.  My basic rule of
> thumb is, "Does my question have anything to do with R?  If my answer
> is, "No." then I usually look for somewhere else to post.  Of course,
> for a comprehensive list, see the posting guide.
>
> If you are wondering if there is a function to do it for you, I am not
> sure, but it would be trivial to programme and if you show us the
> formula for it (the mean from the CI), we can certainly give you
> pointers for how to write your own :)
>
> Cheers,
>
> Josh
>
> On Fri, Jan 28, 2011 at 2:15 PM, Peter Francis <peterfrancis at me.com>
> wrote:
>> Dear List,
>>
>> I am not sure if A) this is possible or B) the correct place to ask.
>>
>> I am looking to find the mean - i have n, and the two-tailed
>> confidence intervals 0.95 & 0.25 with a  p-value of 0.05.
>>
>> Can i find the mean from this data ?
>>
>> Thanks
>>
>> Peter

David Winsemius, MD
West Hartford, CT

```