arcaldwell49 / Superpower

Simulation-Based Power Analysis
Other
65 stars 18 forks source link

Add examples for typical use cases #12

Open paulsharpeY opened 4 years ago

paulsharpeY commented 4 years ago

I installed Superpower as I'm not aware of any other R package which can do a power calculation for a 2x2 mixed ANOVA. My use case is to reproduce the following power calculation:

A priori power analysis revealed a sample size of 52 would adequately power ([1-β] = 0.80; ⍺ = 0.05, two-tailed) an effect size of f = 0.27 for a 2 (group) by 2 (time) mixed repeated- measures ANOVA interaction term (Faul et al. 2009). This effect size was based on a meta-analytic data for our variables of interest (i.e., cognition, attention, and self-reported mindfulness; Eberth and Sedlmeier 2012).

Having read the Superpower docs, I don't appear to have some of the numbers (means, SDs) required.

  1. Given the information I have, can I calculate the n required to reliably measure this interaction? I want to check the n=52 claim. If so, how do I do that?
  2. Could the docs be updated to reflect the answer to the previous question, as I suspect that this is a common use case.
Lakens commented 4 years ago

Hi,

The problem is you are trying to check an inadequate power analysis. That being said, I recognize this is a common use case, and we can think about how to accommodate it. The problem is the original authors performed a mindless power analysis – plugging in a number (f = 0.27) that does not mean much. One thing you can do is to create means and SD that would yield a f = 0.27 for a 2x2 mixed interaction. I think writing a convenience function for this would be useful. For now, you can enter means and sd, and then simply change 1 mean in the design until f = 0.27 (as indicated by ANOVA_exact.

Does that help?

Daniel

paulsharpeY commented 4 years ago

Maybe. Do I also need to invent a correlation value for the w/s factor? If so, what should I use? Can I try out this 'empirical replication approach' using the shiny app?

Here's my story, which I suspect is an instance of a common use case (hence the inadequate power calculation cited!):

Some examples that talk to this (anti) pattern would help. Finding a reliable effect size always seems difficult. Perhaps using cell means, common SD and w/s correlations is easier, but an example pattern would be useful to indicate how you might approach finding reliable estimates for these numbers.

:)

Lakens commented 4 years ago

How did you get the f value? What was your starting point? Maybe we can explain how to ignore the f and define what you predict in means, sd and r. The philosophy of Superpower is that f values are typically not a good starting point. If you feel you need to 'invent' the r, you might not be ready to test a hypothesis.


From: paulsharpeY notifications@github.com Sent: Thursday, February 27, 2020 1:41:52 PM To: arcaldwell49/Superpower Superpower@noreply.github.com Cc: Lakens, D. D.Lakens@tue.nl; Comment comment@noreply.github.com Subject: Re: [arcaldwell49/Superpower] Add examples for typical use cases (#12)

Maybe. Do I also need to invent a correlation value for the w/s factor? If so, what should I use? Can I try out this 'empirical replication approach' using the shiny apphttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Farcstats.io%2Fshiny%2Fanova-power%2F&data=02%7C01%7Cd.lakens%40tue.nl%7Ce6fd92fd11e44ebc308e08d7bb826d0f%7Ccc7df24760ce4a0f9d75704cf60efc64%7C1%7C0%7C637184041158264577&sdata=%2F6A%2BpGfdepYrJyatNc1t0TJGSYIYdJAZa3T%2FN45459Q%3D&reserved=0?

Here's my story, which I suspect is an instance of a common use case (hence the inadequate power calculation cited!):

Some examples that talk to this (anti) pattern would help. Finding a reliable effect size always seems difficult. Perhaps using cell means, common SD and w/s correlations is easier, but an example pattern would be useful to indicate how you might approach finding reliable estimates for these numbers.

:)

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Farcaldwell49%2FSuperpower%2Fissues%2F12%3Femail_source%3Dnotifications%26email_token%3DABRQPYIOUDOCDK6FUTP3SPLRE6YJBA5CNFSM4K4ZIL62YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENEHHCQ%23issuecomment-591950730&data=02%7C01%7Cd.lakens%40tue.nl%7Ce6fd92fd11e44ebc308e08d7bb826d0f%7Ccc7df24760ce4a0f9d75704cf60efc64%7C1%7C0%7C637184041158274534&sdata=MNiCz69tJJ1fSkwl5H2vSzPAZLVvzML7RMVasKbK7I0%3D&reserved=0, or unsubscribehttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FABRQPYJ73EL452DPX4SPVZLRE6YJBANCNFSM4K4ZIL6Q&data=02%7C01%7Cd.lakens%40tue.nl%7Ce6fd92fd11e44ebc308e08d7bb826d0f%7Ccc7df24760ce4a0f9d75704cf60efc64%7C1%7C0%7C637184041158274534&sdata=7Q4Ad2XY9fgFQ6fWNqGYSfRR%2Bbw85JfQO4lomaqLK0s%3D&reserved=0.

paulsharpeY commented 4 years ago

The f came from a paper I was reading (see direct quote above). I thought "I don't trust that power calculation, let's try to replicate it.". All I had to go on was what was in the paper :-/.

arcaldwell49 commented 4 years ago

Just to make sure @paulsharpeY, you have seen our chapter on mixed ANOVAs correct?

I would agree with Daniel, that you can setup a design with means, SD and the within-subject correlation based on the underlying measurement. My suggestion would be this: create at least three different scenarios where the correlation is small, moderate, or large, and then find the mean difference required to produce that effect. Then you can gauge how reasonable the original effect size is based on the required difference/variance/correlation that would be needed to produce such an effect.

But let me see if I can help a little bit.

In a quick examination of the meta-analysis, it appears the "effect" is around 0.5 SD (Cohen's d = .5). From that I can setup a 2b*2w design in Superpower.

sample_design = ANOVA_design("2b*2w", n=52, r=.6, mu = c(1,1.5,1,1), sd = 1)

When this design is passed onto ANOVA_exact it provides the interaction with a power of ~80%.

This can be accomplished in our ANOVA_exact Shiny app as well (link here).

image

However you will notice the SD and means are for convenience and do not reflect "real" values that would be collected in a study.

paulsharpeY commented 4 years ago

Hi Aaron/Daniel,

Thanks, this is helping. I have a few more questions. For context, is the d you refer to from Eberth and Sedlmeier (2012), i.e.

What have we learned about the effects of mindfulness meditation by now? In our meta-analysis, we found a weighted mean correlation of r = 0.27, which corresponds to d = 0.56 (for comparison with earlier summaries that mainly used d, we occasionally report both effect sizes).

arcaldwell49 commented 4 years ago

Again, these are relatively made up numbers. I do not know what values or underlying assumptions the paper you quoted in the first post made about their power analysis. I demonstrated what it could look like if implemented in Superpower.

Also, if you are planning a 2b*2w randomized design I would suggest considering an ANCOVA (baseline as a co-variate) for the final analysis https://doi.org/10.1016/j.jclinepi.2006.02.007