# [R] how to determine power in my analysis?

Bert Gunter gunter.berton at gene.com
Sat Nov 8 19:55:56 CET 2014

```Kristi:

Power is a prespecified property of the design, not a post hoc
property of the analysis (SAS procedures notwithstanding). So you're a
day late and a dollar short.

I suggest you consult with a local statistician about such matters, as
you appear to be out of your depth.

Cheers,
Bert

Bert Gunter
Genentech Nonclinical Biostatistics
(650) 467-7374

"Data is not information. Information is not knowledge. And knowledge
is certainly not wisdom."
Clifford Stoll

On Sat, Nov 8, 2014 at 3:49 AM, Kristi Glover <kristi.glover at hotmail.com> wrote:
> Hi R Users,
> I was trying to determine whether I have enough samples and power in my analysis. Would you mind to provide some hints?.  I found a several packages for power analysis but did not find any example data. I have two sites and each site has 4 groups. I wanted to test whether there was an effect of restoration activities and sites on the observed value. I used a two way factorial ANOVA and now I wanted to test the power of the analysis (whether the sample sizes are enough for the analysis? what are the alpha and power in the analysis using this data set? if it is not enough, how much samples should be collected for alpha 0.05 and power=0.8 and 0.9 for the analysis (two way factorial analysis).
> The example data:data<-structure(list(observedValue = c(0.08, 0.53, 0.14, 0.66, 0.37, 0.88, 0.84, 0.46, 0.3, 0.61, 0.75, 0.82, 0.67, 0.37, 0.95, 0.73, 0.74, 0.69, 0.06, 0.97, 0.97, 0.07, 0.75, 0.68, 0.53, 0.72, 0.34, 0.12, 0.49, 0.77, 0.45, 0.07, 0.97, 0.34, 0.68, 0.48, 0.65, 0.7, 0.57, 0.66, 0.4, 0.29, 0.88, 0.36, 0.68, 0.32, 0.8, 0, 0.11, 0.48, 0.85, 0.94, 0.12, 0.12, 0, 0.89, 0.66, 0.2, 0.57, 0.09, 0.27, 0.81, 0.53, 0.09, 0.5, 0.41, 0.89, 0.47, 0.39, 0.85, 0.71, 0.89, 0.01, 0.71, 0.42, 0.72, 0.62, 0.3, 0.56, 0.99, 0.97, 0.03, 0.09, 0.27, 0.27, 0.94, 0.23, 0.97, 0.81, 0.95), condition = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L), .Label = c("good", "!
>  medium", "poor", "verygood"), class = "factor"), areas = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L), .Label = c("Restored", "unrestored"), class = "factor")), .Names = c("observedValue", "condition", "areas"), class = "data.frame", row.names = c(NA, -90L))
> test= aov(observedValue~condition*areas,data=data)summary(test)
> power of the analysis?
> Sincerely, KG
>
>         [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help