Calculate constants associated with the fixed effect parameters and the variance component parameters of the hierarchical model in order to calculate the BC-SMD effect size.

calc_consts(
  method,
  design,
  center = 0,
  FE_base = 0,
  RE_base = 0,
  RE_base_2 = NULL,
  FE_trt = 0,
  RE_trt = NULL,
  RE_trt_2 = NULL,
  corStruct = "AR1",
  varStruct = "hom",
  A,
  B
)

Arguments

method

Character string indicating the estimation method. Options are "RML" or "Bayes".

design

Character string to specify whether data comes from a treatment reversal ("TR"), multiple baseline across participants ("MBP"), replicated multiple baseline across behaviors ("RMBB"), or clustered multiple baseline across participants ("CMB").

center

Numeric value for the centering value for session. Default is 0.

FE_base

Vector of integers specifying which fixed effect terms to include in the baseline phase. Setting FE_base = 0 includes only a level. Setting FE_base = c(0,1) includes a level and a linear time trend.

RE_base

Vector of integers specifying which random effect terms to include in the baseline phase. Setting RE_base = 0 includes only levels (i.e., random intercepts). Setting RE_base = c(0,1) includes random levels and random linear trends.

RE_base_2

Vector of integers specifying which random effect terms to include in the baseline phase for the cluster level in clustered multiple baseline design across participants or for the case level in replicated multiple baseline across behaviors. Setting RE_base_2 = 0 includes only levels (i.e., random intercepts). Setting RE_base_2 = c(0,1) includes random levels and random linear trends.

FE_trt

Vector of integers specifying which fixed effect terms to include in the treatment phase. Setting FE_trt = 0 includes only a change in level. Setting FE_trt = c(0,1) includes a change in level and a treatment-by-linear time trend.

RE_trt

Vector of integers specifying which random effect terms to include in the treatment phase. Setting RE_trt = 0 includes only random changes in level. Setting RE_trt = c(0,1) includes random changes in level and random treatment-by-linear time trends.

RE_trt_2

Vector of integers specifying which random effect terms to include in the treatment phase for the cluster level in clustered multiple baseline design across participants or for the case level in replicated multiple baseline across behaviors. Setting RE_trt_2 = 0 includes only random changes in level. Setting RE_trt_2 = c(0,1) includes random changes in level and random treatment-by-linear time trends.

corStruct

(Optional) character string indicating the correlation structure of session-level errors. Options are "AR1" (default), "MA1", or "IID".

varStruct

(Optional) character string indicating the heteroscedasticity structure of session-level errors. Options are "hom" (default) or "het", which allows for the session-level error variances to differ by phase.

A

The time point immediately before the start of treatment in the hypothetical between-group design.

B

The time point at which outcomes are measured in the hypothetical between-group design.

Value

A list of constants associated with the fixed effect parameters and the variance component parameters of the hierarchical model for calculating the effect size.

Examples


calc_consts(method = "RML", design = "MBP", center = 4, 
            FE_base = c(0,1), RE_base = c(0),
            FE_trt = c(0,1), RE_trt = c(1),
            corStruct = "IID", varStruct = "hom",
            A = 4, B = 10) 
#> $p_const
#> [1] 0 0 1 6
#> 
#> $r_const
#> [1] 1 0 0 1
#> 


calc_consts(method = "Bayes", design = "MBP", center = 4,
            FE_base = c(0,1), RE_base = c(0,1), RE_base_2 = NULL,
            FE_trt = c(0,1), RE_trt = NULL, RE_trt_2 = NULL,
            corStruct = "AR1", varStruct = "hom",
            A = 4, B = 10)
#> $p_const
#> [1] 0 0 1 6
#> 
#> $r_const
#> [1]  1 36 12  1
#> 
#> $rconst_base_var_index
#> [1] 1
#>