Simulates Power for single case analyses, here the nonoverlap methods. Based on effect size (ES) referring to a bivariate correlation, effect size due to a weekend effect (wES), effect size due to an intervention (iES), number of assessments per day (nbeep) , number of days (ndays), and autocorrelation (ar) alpha level can be corrected for number of tests (ntest) by Bonferroni correctie

simPowerSCA(H0result = NULL, nbeep = 1, ndays, ES, iES = NULL,
  wES = NULL, phase0Perc = NULL, corPredictors = NULL, ar,
  prewith = FALSE, ntest = 1, maxiter = 1000)

Arguments

H0result

results from H0 simulation

nbeep

number of assessments per day

ndays

number of days

ES

effect size referring to a bivariate correlation

iES

effect size due to an intervention

wES

ffect size due to a weekend effect (seasonal)

phase0Perc

percentage of the observations in first phase (default = 0.5)

corPredictors

correlations between predictors

ar

autocorrelation

prewith

boolean indicating whether prewithening must be used

ntest

correction for number of test (default = 1, no correction)

maxiter

number of replications

Value

Mainly, this function computes the power estimates, it returns an object containing three lists:

input

The arguments specified when calling the function

intermediate

Intermediat objects and values

output

The results such as the power.

Details

uses functions: lagESM or makeCorrelatedData

See also

Examples

res <- simPowerSCA(ndays = 50, ES = 0.40, iES = 0.50, wES = 0.10, phase0Perc = .40, ar = 0.2, prewith = FALSE, maxiter = 1000)
#> [1] "ndays: 50" #> [1] "ar: 0.2" #> [1] "ES: 0.4"