Skip to content

RMeDPower2

Design and Modeling for Repeated Measures Studies

v1.0.1 · May 7, 2026 · GPL-3

Description

Provides complete functionality to analyse data from repeated measures experiments with hierarchical or crossed experimental designs. Supports testing modeling assumptions, identifying outlier observations and experimental units, estimating statistical power, and performing sample size calculations. Uses linear mixed effects models via 'lme4' and simulation-based power analysis via 'simr'. Handles both normal and non-normal error distributions including binomial and Poisson families. For more details see Shin et al. (2022) <doi:10.1101/2022.07.18.500490>, Bates et al. (2015) <doi:10.18637/jss.v067.i01>, Green and MacLeod (2016) <doi:10.1111/2041-210X.12504>, Hartig (2024) <doi:10.32614/CRAN.package.DHARMa>, Nieuwenhuis et al. (2012) <doi:10.32614/RJ-2012-011>, Millard (2013) <doi:10.1007/978-1-4614-8456-1> and Kuznetsova et al. (2017) <doi:10.18637/jss.v082.i13>.

Downloads

256

Last 30 days

10967th

256

Last 90 days

256

Last year

CRAN Check Status

6 ERROR
7 OK
Show all 13 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang ERROR
r-devel-linux-x86_64-debian-gcc ERROR
r-devel-linux-x86_64-fedora-clang ERROR
r-devel-linux-x86_64-fedora-gcc ERROR
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 OK
r-patched-linux-x86_64 ERROR
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 ERROR
Check details (6 non-OK)
ERROR r-devel-linux-x86_64-debian-clang

tests

Running ‘testthat.R’ [175s/216s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warnings during testing
  > 
  > test_check("RMeDPower2")
  Saving _problems/test-model-building-63.R
  Power for predictor 'condition_column', (95% confidence interval):
        100.0% (69.15, 100.0)
  
  Test: Likelihood ratio
  
  Based on 10 simulations, (0 errors, 1 warning, 9 messages)
  
  Time elapsed: 0 h 0 m 3 s
  
  nb: result might be an observed power calculation
  Saving _problems/test-utilities-155.R
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-model-building.R:61:3'): diagnoseDataModel handles non-normal distributions ──
  Error in `log(total_column)`: non-numeric argument to mathematical function
  Backtrace:
       ▆
    1. ├
...[truncated]...
ct, nsim = nsim, ...)
   14.             │ └─base::eval(mc, parent.frame(1L))
   15.             │   └─base::eval(mc, parent.frame(1L))
   16.             └─lme4::.simulateFun(object = object, nsim = nsim, re.form = ..1)
   17.               ├─stats::predict(...)
   18.               └─lme4:::predict.merMod(...)
   19.                 └─lme4::mkNewReTrms(...)
   20.                   ├─stats::model.frame(...)
   21.                   └─stats::model.frame.default(...)
   22.                     └─base::eval(predvars, data, env)
   23.                       └─base::eval(predvars, data, env)
   24.                         └─stats::offset(log(total_column))
  ── Failure ('test-utilities.R:153:3'): diagnoseDataModel handles different model types ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘testthat.R’ [106s/121s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warnings during testing
  > 
  > test_check("RMeDPower2")
  Saving _problems/test-model-building-63.R
  Power for predictor 'condition_column', (95% confidence interval):
        100.0% (69.15, 100.0)
  
  Test: Likelihood ratio
  
  Based on 10 simulations, (0 errors, 1 warning, 9 messages)
  
  Time elapsed: 0 h 0 m 1 s
  
  nb: result might be an observed power calculation
  Saving _problems/test-utilities-155.R
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-model-building.R:61:3'): diagnoseDataModel handles non-normal distributions ──
  Error in `log(total_column)`: non-numeric argument to mathematical function
  Backtrace:
       ▆
    1. ├
...[truncated]...
ct, nsim = nsim, ...)
   14.             │ └─base::eval(mc, parent.frame(1L))
   15.             │   └─base::eval(mc, parent.frame(1L))
   16.             └─lme4::.simulateFun(object = object, nsim = nsim, re.form = ..1)
   17.               ├─stats::predict(...)
   18.               └─lme4:::predict.merMod(...)
   19.                 └─lme4::mkNewReTrms(...)
   20.                   ├─stats::model.frame(...)
   21.                   └─stats::model.frame.default(...)
   22.                     └─base::eval(predvars, data, env)
   23.                       └─base::eval(predvars, data, env)
   24.                         └─stats::offset(log(total_column))
  ── Failure ('test-utilities.R:153:3'): diagnoseDataModel handles different model types ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

tests

Running ‘testthat.R’ [5m/13m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warnings during testing
  > 
  > test_check("RMeDPower2")
  Saving _problems/test-model-building-63.R
  Power for predictor 'condition_column', (95% confidence interval):
        100.0% (69.15, 100.0)
  
  Test: Likelihood ratio
  
  Based on 10 simulations, (0 errors, 1 warning, 9 messages)
  
  Time elapsed: 0 h 0 m 10 s
  
  nb: result might be an observed power calculation
  Saving _problems/test-utilities-155.R
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-model-building.R:61:3'): diagnoseDataModel handles non-normal distributions ──
  Error in `log(total_column)`: non-numeric argument to mathematical function
  Backtrace:
       ▆
    1. ├─b
...[truncated]...
ct, nsim = nsim, ...)
   14.             │ └─base::eval(mc, parent.frame(1L))
   15.             │   └─base::eval(mc, parent.frame(1L))
   16.             └─lme4::.simulateFun(object = object, nsim = nsim, re.form = ..1)
   17.               ├─stats::predict(...)
   18.               └─lme4:::predict.merMod(...)
   19.                 └─lme4::mkNewReTrms(...)
   20.                   ├─stats::model.frame(...)
   21.                   └─stats::model.frame.default(...)
   22.                     └─base::eval(predvars, data, env)
   23.                       └─base::eval(predvars, data, env)
   24.                         └─stats::offset(log(total_column))
  ── Failure ('test-utilities.R:153:3'): diagnoseDataModel handles different model types ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

tests

Running ‘testthat.R’ [281s/421s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warnings during testing
  > 
  > test_check("RMeDPower2")
  Saving _problems/test-model-building-63.R
  Power for predictor 'condition_column', (95% confidence interval):
        100.0% (69.15, 100.0)
  
  Test: Likelihood ratio
  
  Based on 10 simulations, (0 errors, 1 warning, 9 messages)
  
  Time elapsed: 0 h 0 m 7 s
  
  nb: result might be an observed power calculation
  Saving _problems/test-utilities-155.R
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-model-building.R:61:3'): diagnoseDataModel handles non-normal distributions ──
  Error in `log(total_column)`: non-numeric argument to mathematical function
  Backtrace:
       ▆
    1. ├
...[truncated]...
ct, nsim = nsim, ...)
   14.             │ └─base::eval(mc, parent.frame(1L))
   15.             │   └─base::eval(mc, parent.frame(1L))
   16.             └─lme4::.simulateFun(object = object, nsim = nsim, re.form = ..1)
   17.               ├─stats::predict(...)
   18.               └─lme4:::predict.merMod(...)
   19.                 └─lme4::mkNewReTrms(...)
   20.                   ├─stats::model.frame(...)
   21.                   └─stats::model.frame.default(...)
   22.                     └─base::eval(predvars, data, env)
   23.                       └─base::eval(predvars, data, env)
   24.                         └─stats::offset(log(total_column))
  ── Failure ('test-utilities.R:153:3'): diagnoseDataModel handles different model types ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-patched-linux-x86_64

tests

Running ‘testthat.R’ [167s/199s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warnings during testing
  > 
  > test_check("RMeDPower2")
  Saving _problems/test-model-building-63.R
  Power for predictor 'condition_column', (95% confidence interval):
        100.0% (69.15, 100.0)
  
  Test: Likelihood ratio
  
  Based on 10 simulations, (0 errors, 1 warning, 9 messages)
  
  Time elapsed: 0 h 0 m 2 s
  
  nb: result might be an observed power calculation
  Saving _problems/test-utilities-155.R
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-model-building.R:61:3'): diagnoseDataModel handles non-normal distributions ──
  Error in `log(total_column)`: non-numeric argument to mathematical function
  Backtrace:
       ▆
    1. ├
...[truncated]...
ct, nsim = nsim, ...)
   14.             │ └─base::eval(mc, parent.frame(1L))
   15.             │   └─base::eval(mc, parent.frame(1L))
   16.             └─lme4::.simulateFun(object = object, nsim = nsim, re.form = ..1)
   17.               ├─stats::predict(...)
   18.               └─lme4:::predict.merMod(...)
   19.                 └─lme4::mkNewReTrms(...)
   20.                   ├─stats::model.frame(...)
   21.                   └─stats::model.frame.default(...)
   22.                     └─base::eval(predvars, data, env)
   23.                       └─base::eval(predvars, data, env)
   24.                         └─stats::offset(log(total_column))
  ── Failure ('test-utilities.R:153:3'): diagnoseDataModel handles different model types ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-release-windows-x86_64

tests

Running 'testthat.R' [141s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warnings during testing
  > 
  > test_check("RMeDPower2")
  Saving _problems/test-model-building-63.R
  Power for predictor 'condition_column', (95% confidence interval):
        100.0% (69.15, 100.0)
  
  Test: Likelihood ratio
  
  Based on 10 simulations, (0 errors, 1 warning, 9 messages)
  
  Time elapsed: 0 h 0 m 2 s
  
  nb: result might be an observed power calculation
  Saving _problems/test-utilities-155.R
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-model-building.R:61:3'): diagnoseDataModel handles non-normal distributions ──
  Error in `log(total_column)`: non-numeric argument to mathematical function
  Backtrace:
       ▆
    1. ├─base
...[truncated]...
ct, nsim = nsim, ...)
   14.             │ └─base::eval(mc, parent.frame(1L))
   15.             │   └─base::eval(mc, parent.frame(1L))
   16.             └─lme4::.simulateFun(object = object, nsim = nsim, re.form = ..1)
   17.               ├─stats::predict(...)
   18.               └─lme4:::predict.merMod(...)
   19.                 └─lme4::mkNewReTrms(...)
   20.                   ├─stats::model.frame(...)
   21.                   └─stats::model.frame.default(...)
   22.                     └─base::eval(predvars, data, env)
   23.                       └─base::eval(predvars, data, env)
   24.                         └─stats::offset(log(total_column))
  ── Failure ('test-utilities.R:153:3'): diagnoseDataModel handles different model types ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted

Check History

ERROR 10 OK · 0 NOTE · 0 WARNING · 3 ERROR · 0 FAILURE Jun 2, 2026
ERROR r-devel-linux-x86_64-debian-gcc

tests

Running ‘testthat.R’ [108s/134s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress wa
...[truncated]...
 ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-fedora-clang

tests

Running ‘testthat.R’ [5m/13m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress warni
...[truncated]...
 ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
ERROR r-devel-linux-x86_64-fedora-gcc

tests

Running ‘testthat.R’ [281s/421s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # Load necessary libraries
  > library(testthat)
  > library(RMeDPower2)
  > 
  > # Set up testing environment
  > options(warn = -1)  # Suppress wa
...[truncated]...
 ──
  Expected `suppressWarnings(...)` not to throw any errors.
  Actually got a <simpleError> with message:
    non-numeric argument to mathematical function
  
  [ FAIL 2 | WARN 0 | SKIP 0 | PASS 143 ]
  Error:
  ! Test failures.
  Execution halted
OK 6 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE May 8, 2026

Dependency Network

Dependencies Reverse dependencies lme4 dplyr simr magrittr ggplot2 ggtext quantreg tibble lmerTest DHARMa influence.ME EnvStats jsonlite RMeDPower2

Version History

new 1.0.1 May 7, 2026