[R] Generating data when mean and 95% CI are known

Mark Leeds markleeds2 at gmail.com
Thu Sep 8 04:36:46 CEST 2011


Hi: I don't know if this is what you meant but here's a way to cheat and do it.

1) back out the [sigma over sqrt root of n]  from the 95 % CI and call it X.

2) then generate data using rnorm(n*, known mean, sigma*)

where sigma*/sqrt(n*) = X is satisfied.

3) there will be many solutions to 2) so you could make up a sigma*
and then back out the n* that makes it hold.











On Wed, Sep 7, 2011 at 10:22 PM, Rolf Turner <rolf.turner at xtra.co.nz> wrote:
> On 08/09/11 09:51, Tyler Hicks wrote:
>>
>> Is there a function in R that will generate data from a known mean and 95%
>> CI? I do not know the distribution or sample size of the original data.
>
> No.  R is wonderful, but it cannot work magic.
>
>    cheers,
>
>        Rolf Turner
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list