Thanks Greg, I've actually been programming precisely what you suggest since sending the request this morning (though your email was indeed helpful; I've never seen 'replicate()' and will see if it's faster than a loop).
However, I was hoping that an analytic solution was extant and implemented somewhere. On 26-Jun-07, at 12:18 PM, Greg Snow wrote: > 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 > [EMAIL PROTECTED] > (801) 408-8111 > > > >> -----Original Message----- >> From: [EMAIL PROTECTED] >> [mailto:[EMAIL PROTECTED] 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@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. >> > -- 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@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.