[R] Power curves

Adaikalavan Ramasamy ramasamy at cancer.org.uk
Mon Nov 15 12:52:01 CET 2004


What do you mean by "power curves" ? Is it the power of a study as the
effect size varies or power output of a machine with some other
parameter ?

I usually generate a sequence of numbers (for the x-axis) that spans the
range of interest and calculate its output. 

# Example 1
f <- function(x) sin(x)
x <- seq(0, 10, by=0.01)
y <- f(x)
plot(x, y, type="l")

Or you can call
plot(f, xlim=c(0, 10) )

# Example 2
plot(2:100, power.t.test(2:100, delta=1, sd=1, sig.level=0.05)$power)

Regards, Adai

On Mon, 2004-11-15 at 01:19, Duncan Harris wrote:
> How do I draw/calculate power curves in R?
> 
> Cheers,
> 
> Duncan.
> 
> ______________________________________________
> 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




More information about the R-help mailing list