Re: [R] Power calculation with measurement error

From: Greg Snow <Greg.Snow_at_intermountainmail.org>
Date: Tue, 26 Jun 2007 09:18:02 -0600


I don't know of a current package that does this (others may), but if you know what you expect your data to look like you can simulate it and calculate power that way.

Basically, write a function that will simulate data with the level of measurement error that you expect in the real data (or have the amount of measurement error passed in as a parameter so you can examine the effect of diffenent values). Then have the function compute the t test (or other test that you plan to do) and return the p-value from the test.

Then you can simulate the process with a command like:

> out1 <- replicate( 1000, myfunction(n=25, err=.1, diff=.5) )

And compute the power with:

> mean( out1 < 0.05 ) # or whatever alpha value you want.

Hope this helps,

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow_at_intermountainmail.org
(801) 408-8111
 
 


> -----Original Message-----
> From: r-help-bounces_at_stat.math.ethz.ch
> [mailto:r-help-bounces_at_stat.math.ethz.ch] On Behalf Of Mike Lawrence
> Sent: Tuesday, June 26, 2007 5:13 AM
> To: Rhelp
> Subject: [R] Power calculation with measurement error
>
> Hi all,
>
> Hopefully this will be quick, I'm looking for pointers to
> packages/ functions that would allow me to calculate the
> power of a t.test when the DV has measurement error. That is,
> I understand that, ceteris paribus, experiments using measure
> with more error (lower
> reliability) will have lower power.
>
> Mike
>
> --
> Mike Lawrence
> Graduate Student, Department of Psychology, Dalhousie University
>
> Website: http://memetic.ca
>
> Public calendar: http://icalx.com/public/informavore/Public
>
> "The road to wisdom? Well, it's plain and simple to express:
> Err and err and err again, but less and less and less."
> - Piet Hein
>
> ______________________________________________
> R-help_at_stat.math.ethz.ch 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.
> ______________________________________________ R-help_at_stat.math.ethz.ch 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.
Received on Tue 26 Jun 2007 - 15:47:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Tue 26 Jun 2007 - 16:32:20 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.