power.testSC: Empirical power analysis for single-case data

Description Usage Arguments Author(s) See Also Examples

View source: R/deprecated_power.testSC.R

Description

!! This function is deprecated. Please use the power_testSC fucntion !! The power.testSC command conducts a Monte-Carlo study on the test-power and alpha-error of a randomization-test and a piecewise-regression model. The distribution values of the Monte-Carlo sample are either specified by the user or estimated based on actual data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
power.testSC(
  data = NULL,
  dvar,
  pvar,
  mvar,
  parameters = NULL,
  stat = c("rand.test", "plm"),
  test.parameter = c("level", "slope"),
  rand.test.stat = c("Mean B-A", "B"),
  cases = NULL,
  rtt = NULL,
  level = NULL,
  slope = NULL,
  MT = NULL,
  B.start = NULL,
  trend = NULL,
  n_sim = 100,
  limit = 5,
  m = NULL,
  s = NULL,
  startpoints = NA,
  extreme.p = 0,
  extreme.d = c(-4, -3),
  exclude.equal = "auto",
  alpha = 0.05,
  distribution = "normal",
  silent = TRUE
)

Arguments

data

A single-case data frame. See scdf to learn about this format.

dvar

Character string with the name of the dependent variable. Defaults to the attributes in the scdf file.

pvar

Character string with the name of the phase variable. Defaults to the attributes in the scdf file.

mvar

Character string with the name of the measurement time variable. Defaults to the attributes in the scdf file.

parameters

-

stat

Defines the tests the power analysis is computed for. The default stat = c("rand.test","plm") computes a power analysis for the randSC and the plm analyses. Further possibilities are "hplm" for a hierarchiacal linear regression model and "plm.poisson" for a generalized piecewise-regression model under the assumption of poisson distributed errors.

test.parameter

Indicates whether the power and alpha error for a level effect, a slope effect, or both effects should be estimated. The default setting test.parameter = c("level", "slope") requests both.

rand.test.stat

Defines the statistic the randomization test is based on. The first values stipulates the statistic for the level-effect computation and the second value for the slope-effect computation. Default is rand.test.stat = c("Mean B-A","B"). Please see randSC for more information on the test statistics.

cases

Number of cases per study.

rtt

Reliability of the underlying simulated measurements. Default is rtt = 0.8.

level

Defines the level increase (effect size d) at the beginning of phase B.

slope

Defines the increase in scores - starting with phase B - expressed as effect size d per MT. slope = .1 generates an incremental increase of 0.1 standard deviations per MT for all phase B measurements.

MT

Number of measurements (in each study).

B.start

Phase B starting point. A single value (e.g., B.start = 6) defines B.start for all studies and cases. A vector of starting values is given with the chain command (e.g., B.start = c(6, 7, 8)). A value between 0 and 1 is interpreted as a proportion (e.g., B.start = c(0.3, 0.5, 0.8) would start phase B at 30, 50, and 80% of the MTs).

trend

Defines the effect size d of a trend per MT added across the whole data-set.

n_sim

Number of sample studies created for the the Monte-Carlo study. Default is n = 100

limit

Minimal number of data points per phase in the sample. Default is limit = 5.

m

Mean of the sample distribution the data are drawn from.

s

Standard deviation of the sample distribution the data are drawn from.

startpoints

Alternative to the limit parameter start points exactly defines the possible start points of phase B (e.g., startpoints = 4:9 restricts the phase B start points to measurements 4 to 9. startpoints overruns the limit parameter.

extreme.p

Probability of extreme values. extreme.p = .05 gives a five percent probability of an extreme value. Default is extreme.p = 0.

extreme.d

Range for extreme values, expressed as effect size d. extreme.d = c(-7,-6) uses extreme values within a range of -7 and -6 standard deviations. Caution: the first value must be smaller than the second, otherwise the procedure will fail. Default is extreme.d = c(-4,-3).

exclude.equal

If set to exclude.equal = FALSE, random distribution values equal to the observed distribution are counted as null-hypothesis conform. That is, they decrease the probability of rejecting the null-hypothesis (increase the p-value). Default is exclude.equal = "auto", which means FALSE for multiple baseline designs and TRUE for one single-case.

alpha

Alpha level used to calculate the proportion of significant tests. Default is alpha = 0.05.

distribution

Indicates whether the random sample is based on a "normal" or a "poisson" distribution. Default is distribution = "normal".

silent

If set TRUE, the results are not printed after computation. Default is silent = FALSE.

Author(s)

Juergen Wilbert

See Also

plm, randSC

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Assume you want to conduct a single-case study with 15 MTs, using a highly reliable test,
## an expected level effect of \eqn{d = 1.4}, and randomized start points between MTs 5
## and 12 can you expect to identify the effect using plm or randomization test?
mc_par <- list(
  n_cases = 1, mt = 15, B.start = round(runif (300,5,12)), 
  rtt = 0.8, level = 1.4
)
res <- power.testSC(
  parameters = mc_par, 
  stat = c("rand.test","hplm"), 
  test.parameter = "level",
  startpoints = 5:12,
  n_sim = 100
)
## Would you achieve higher power by setting up a MBD with three cases?
mc_par <- list(
  n_cases = 3, mt = 15, B.start = round(runif (300,5,12)), 
  rtt = 0.8, level = 1.4
)
power.testSC(
  parameters = mc_par, 
  stat = c("rand.test","hplm"), 
  test.parameter = "level", 
  startpoints = 5:12,
  n_sim = 10
)

scan documentation built on Feb. 12, 2021, 3:01 a.m.