[R] Code modification for post-hoc power

Marc Schwartz m@rc_@chw@rtz @end|ng |rom me@com
Mon Aug 26 14:42:33 CEST 2019

> On Aug 26, 2019, at 6:24 AM, CHATTON Anne via R-help <r-help using r-project.org> wrote:
> Hello everybody,
> I am trying to accommodate the R codes provided by Donohue for sample size calculation in the package "longpower" with lmmpower function to estimate the post-hoc power (asked by a reviewer) of a binary GEE model with a three-way interaction (time x condition x continuous predictor) given a fixed sample size. In other words instead of the sample size I would like to estimate the power of my study. 
> Could anyone please help me to modify these codes as to obtain the power I'm looking for. 
> I would really appreciate receiving any feedback on this subject.
> Yours sincerely,
> Anne


Three comments:

1. Don't calculate post hoc power. Do a Google search and you will find a plethora of papers and discussions on why not, including these:

  The Abuse of Power: The Pervasive Fallacy of Power Calculations for Data Analysis
  The American Statistician, February 2001, Vol. 55, No. 1

  Post Hoc Power: Tables and Commentary

  Observed power, and what to do if your editor asks for post-hoc power analyses

  Retraction Watch:
  Statisticians clamor for retraction of paper by Harvard researchers they say uses a “nonsense statistic”

  PubPeer Comments on the paper cited in the above RW post:

  A discussion on Frank's Data Methods forum also related to the same paper cited above:
  "Observed Power" and other "Power" Issues

2. If you are still compelled (voluntarily or involuntarily), you may want to review the vignette for the longpower package which may have some insights, and/or contact the package maintainer for additional guidance on how to structure the code. See the vignette here:


3. Don't calculate post hoc power.


Marc Schwartz

More information about the R-help mailing list