Package 'scdhlm'

Title: Estimating Hierarchical Linear Models for Single-Case Designs
Description: Provides a set of tools for estimating hierarchical linear models and effect sizes based on data from single-case designs. Functions are provided for calculating standardized mean difference effect sizes that are directly comparable to standardized mean differences estimated from between-subjects randomized experiments, as described in Hedges, Pustejovsky, and Shadish (2012) <DOI:10.1002/jrsm.1052>; Hedges, Pustejovsky, and Shadish (2013) <DOI:10.1002/jrsm.1086>; Pustejovsky, Hedges, and Shadish (2014) <DOI:10.3102/1076998614547577>; and Chen, Pustejovsky, Klingbeil, and Van Norman (2023) <DOI:10.1016/j.jsp.2023.02.002>. Includes an interactive web interface.
Authors: James Pustejovsky [aut, cre], Man Chen [aut], Bethany Hamilton [aut]
Maintainer: James Pustejovsky <[email protected]>
License: GPL-3
Version: 0.7.3
Built: 2025-02-19 03:59:49 UTC
Source: https://github.com/jepusto/scdhlm

Help Index


Alber-Morgan, et al. (2007)

Description

Data from a multiple baseline design conducted by Alber-Morgan, Ramp, Anderson, & Martin (2007). The variables are as follows:

  • case Participant identifier

  • condition Factor identifying the phase of the design (baseline or treatment)

  • session Measurement occasion

  • outcome Number of words read correctly per minute

Format

A data frame with 119 rows and 4 variables

Source

Alber-Morgan, S. R., Ramp, E. M., Anderson, L. L., & Martin, C. M. (2007). Effects of repeated readings, error correction, and performance feedback on the fluency and comprehension of middle school students with behavior problems. Journal of Special Education, 41(1), 17-30. doi:10.1177/00224669070410010201


Example 2 from Hedges, Pustejovsky, & Shadish (2012)

Description

Data from an ABAB design conducted by Anglesea, Hoch, & Taylor (2008). The variables are as follows:

  • case Case identifier.

  • condition Factor indicating baseline or treatment condition

  • phase Study phase (including both control and treatment condition)

  • session Measurement occasion

  • outcome Total seconds of eating time

Format

A data frame with 55 rows and 5 variables

Source

Anglesea, M. M., Hoch, H., & Taylor, B. A. (2008). Reducing rapid eating in teenagers with autism: Use of a pager prompt. Journal of Applied Behavior Analysis, 41(1), 107-111. doi:10.1901/jaba.2008.41-107

References

Hedges, L. V., Pustejovsky, J. E., & Shadish, W. R. (2012). A standardized mean difference effect size for single case designs. Research Synthesis Methods, 3, 224-239. doi:10.1002/jrsm.1052


Barton-Arwood, Wehby, & Falk (2005)

Description

Data from a multiple baseline design conducted by Barton-Arwood, Wehby, and Falk (2005). The variables are as follows:

  • case Participant identifier

  • condition Factor identifying the phase of the design (A or B)

  • session Measurement occasion

  • outcome Oral reading fluency score (words per minute)

Format

A data frame with 143 rows and 4 variables

Source

Barton-Arwood, S. M., Wehby, J. H., & Falk, K. B. (2005). Reading instruction for elementary-age students with emotional and behavioral disorders: Academic and behavioral outcomes. Exceptional Children, 72(1), 7-27. doi:10.1177/001440290507200101


A convenience function for calculating multiple design-comparable effect sizes from a dataset that compiles data from multiple single-case design studies

Description

Calculates standardized mean difference effect sizes for a data set including one or multiple single-case design studies using the same design (treatment reversal, multiple baseline/probe across participants, replicated multiple baseline across behaviors, or clustered multiple baseline across participants).

Usage

batch_calc_BCSMD(
  data,
  design,
  grouping,
  case,
  phase,
  session,
  outcome,
  cluster = NULL,
  series = NULL,
  center = 0,
  round_session = TRUE,
  treatment_name = NULL,
  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 = NULL,
  B = NULL,
  D = NULL,
  cover = 95,
  bound = 35,
  symmetric = TRUE,
  ...
)

Arguments

data

A data frame containing SCD data for which design-comparable effect sizes will be calculated.

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").

grouping

A variable name or list of (unquoted) variable names that uniquely identify each study.

case

A variable name (unquoted) that identifies unique cases within each grouping variable.

phase

A variable name (unquoted) that identifies unique treatment phases.

session

A variable name (unquoted) that contains the measurement times for each data series.

outcome

A variable name (unquoted) that contains the outcome measurements for each data series.

cluster

(Optional) variable name (unquoted) that identifies the unique clusters of cases for CMB designs.

series

(Optional) variable name (unquoted) that identifies the unique data series for RMBB designs.

center

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

round_session

Logical indicating whether to round session to the nearest integer. Defaults to TRUE.

treatment_name

(Optional) character string corresponding to the name of the treatment phase.

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.

D

Numerical indicating the treatment duration across cases. Note that B = A + D and it is not allowed to specify both B and D.

cover

Confidence level.

bound

Numerical tolerance for non-centrality parameter in qt.

symmetric

If TRUE (the default), use a symmetric confidence interval. If FALSE, use a non-central t approximation to obtain an asymmetric confidence interval.

...

further arguments.

Value

A data frame containing the design-comparable effect size estimate, standard error, confidence interval, and other information, for each unique category of grouping variable(s).

Examples

data(Thiemann2001)
data(Thiemann2004)
datThiemann <- rbind(Thiemann2001, Thiemann2004)

# Change-in-levels model with a fixed treatment effect
batch_calc_BCSMD(data = datThiemann,
                 grouping = Study_ID,
                 design = "RMBB",
                 case = case, series = series, phase = treatment,
                 session = time, outcome = outcome,
                 FE_base = 0, RE_base = 0,
                 RE_base_2 = 0, FE_trt = 0)

# Models with linear time trends in baseline and treatment phase,
# random baseline slope at series level, fixed treatment effects
batch_calc_BCSMD(data = datThiemann,
                 grouping = Study_ID,
                 design = "RMBB",
                 case = case, series = series, phase = treatment,
                 session = time, outcome = outcome,
                 FE_base = c(0,1), RE_base = c(0,1),
                 RE_base_2 = 0, FE_trt = c(0,1))

Bryant et al. (2018)

Description

Data from a clustered multiple baseline across participants design conducted by Bryant et al. (2018). The variables are as follows:

  • Study_ID. Study identifier.

  • school. School identifier.

  • group. Group identifier.

  • case. Student identifier.

  • treatment. Indicator for treatment phase.

  • session. Measurement occasion.

  • session_trt. Measurement occasion times treatment phase.

  • outcome. Texas Early Mathematics Inventory (TEMI-Aim Check) scores.

  • session_c. Measurement occasion centered at the follow-up time.

Format

A data frame with 536 rows and 8 variables

Source

Bryant, D. R., Bryant, B. R., Sorelle-Miner, D. A., Falcomata, T. S. & Nozari, M. (2018). Tier 3 intensified intervention for second grade students with severe mathematics difficulties. Archives of Psychology, 2(11), 1-24. doi:10.31296/aop.v2i11.86


A convenience function for calculating design comparable effect sizes

Description

In one call, 1) clean single-case design data for treatment reversal and multiple baseline designs, 2) fit a multi-level model using restricted maximum likelihood estimation, and 3) estimate a standardized mean difference effect size.

Usage

calc_BCSMD(
  design,
  case,
  phase,
  session,
  outcome,
  cluster = NULL,
  series = NULL,
  center = 0,
  round_session = TRUE,
  treatment_name = NULL,
  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 = NULL,
  B = NULL,
  D = NULL,
  cover = 95,
  bound = 35,
  symmetric = TRUE,
  summary = TRUE,
  data = NULL,
  ...
)

Arguments

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").

case

vector of case indicators or name of a character or factor vector within data indicating unique cases.

phase

vector of treatment indicators or name of a character or factor vector within data indicating unique treatment phases.

session

vector of measurement occasions or name of numeric vector within data of measurement times.

outcome

vector of outcome data or name of numeric vector of outcome data within data.

cluster

(Optional) vector of cluster indicators or name of a character or factor vector within data indicating clusters.

series

(Optional) vector of series indicators or name of a character or factor vector within data indicating series.

center

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

round_session

Logical indicating whether to round session to the nearest integer. Defaults to TRUE.

treatment_name

(Optional) character string corresponding to the name of the treatment phase.

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.

D

Numerical indicating the treatment duration across cases. Note that B = A + D and it is not allowed to specify both B and D.

cover

Confidence level.

bound

Numerical tolerance for non-centrality parameter in qt.

symmetric

If TRUE (the default), use a symmetric confidence interval. If FALSE, use a non-central t approximation to obtain an asymmetric confidence interval.

summary

Logical indicating whether to return a data frame with effect size estimates and other information. If TRUE (default), return a data.frame containing the effect size estimate, standard error, confidence interval, and other information. If FALSE, return a list with effect size estimate, degrees of freedom, and other information.

data

(Optional) dataset to use for analysis. Must be a data.frame.

...

further arguments.

Value

If summary == TRUE, a data frame containing the design-comparable effect size estimate, standard error, confidence interval, and other information. If summary == FALSE, a list containing all elements of a 'g_mlm()' object, plus the fitted 'lme()' model.

Examples

data(Laski)

# Change-in-levels model with fixed treatment effect
calc_BCSMD(design = "MBP",
           case = case, phase = treatment,
           session = time, outcome = outcome,
           FE_base = 0, RE_base = 0, FE_trt = 0,
           data = Laski)

# Model with linear time trends in baseline and treatment phases,
# random baseline slopes, fixed treatment effects
calc_BCSMD(design = "MBP",
           case = case, phase = treatment,
           session = time, outcome = outcome, center = 4,
           FE_base = c(0,1), RE_base = c(0,1), 
           FE_trt = c(0,1),
           data = Laski)


data(Anglesea)
calc_BCSMD(design = "TR",
           case = case, phase = condition,
           session = session, outcome = outcome,
           treatment_name = "treatment",
           FE_base = 0, RE_base = 0, 
           FE_trt = 0,
           data = Anglesea)


data(Thiemann2001)
calc_BCSMD(design = "RMBB",
           case = case, series = series, phase = treatment,
           session = time, outcome = outcome,
           FE_base = 0, RE_base = 0, RE_base_2 = 0, 
           FE_trt = 0,
           data = Thiemann2001)


data(Bryant2018)
calc_BCSMD(design = "CMB",
           cluster = group, case = case, phase = treatment,
           session = session, outcome = outcome, center = 49,
           treatment_name = "treatment",
           FE_base = c(0,1), RE_base = 0, RE_base_2 = 0,
           FE_trt = c(0,1), RE_trt = NULL, RE_trt_2 = NULL,
           data = Bryant2018)

Carson (2008)

Description

Data from a BAB design conducted by Carson, Gast, & Ayres (2008). The variables are as follows:

  • case Participant identifier

  • treatment Factor describing the treatment condition

  • phase Numeric describing the phase of the study design for each case

  • outcome Outcome scores

  • time Measurement occasion

Format

A data frame with 47 rows and 5 variables

Source

Carson, K. D., Gast, D. L., & Ayres, K. M. (2008). Effects of a photo activity schedule book on independent task changes by students with intellectual disabilities in community and school job sites. European Journal of Special Needs Education, 23, 269-279.


Case, Harris, and Graham (1992)

Description

Data from a multiple baseline design conducted by Case, Harris, and Graham (1992). The variables are as follows:

  • case. Participant identifier.

  • session. Measurement occasion.

  • condition. Factor identifying the phase of the design (baseline or treatment).

  • outcome. Number of subtraction equations and answers correct on each word problem probe.

Format

A data frame with 56 rows and 4 variables

Source

Case, L. P., Harris, K. R., & Graham, S. (1992). Improving the mathematical problem-solving skills of students with learning disabilities: Self-regulated strategy development. The Journal of Special Education, 26(1), 1-19. doi:10.1177/002246699202600101


Calculates a confidence interval for a standardized mean difference effect size

Description

Calculates a confidence interval given a g_REML, a g_HPS, or a g_mlm object using either a central t distribution (for a symmetric interval) or a non-central t distribution (for an asymmetric interval).

Arguments

g

an estimated effect size object of class g_REML, class g_HPS, or class g_mlm.

cover

confidence level

bound

numerical tolerance for non-centrality parameter in qt.

symmetric

If TRUE (the default), use a symmetric confidence interval. If FALSE, use a non-central t approximation to obtain an asymmetric confidence interval.

Value

A vector of upper and lower confidence bounds.

Examples

data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment,
                 random = ~ 1 | case,
                 correlation = corAR1(0, ~ time | case),
                 data = Laski)
Laski_g_REML <- suppressWarnings(
  g_REML(Laski_RML, p_const = c(0,1), 
         r_const = c(1,0,1), returnModel = FALSE)
)
CI_g(Laski_g_REML, symmetric = TRUE)
CI_g(Laski_g_REML, symmetric = FALSE)

Laski_HPS <- with(Laski, effect_size_MB(outcome, treatment, case, time))
CI_g(Laski_HPS, symmetric = FALSE)

Laski_g_mlm <- g_mlm(mod = Laski_RML, p_const = c(0,1), r_const = c(1,0,1))
CI_g(Laski_g_mlm, symmetric = FALSE)

Run simulation comparing REML and HPS estimates

Description

Simulates data from a simple linear mixed effects model, then calculates REML and HPS effect size estimators as described in Pustejovsky, Hedges, & Shadish (2014).

Usage

compare_RML_HPS(iterations, beta, rho, phi, design, m, n, MB = TRUE)

Arguments

iterations

number of independent iterations of the simulation

beta

vector of fixed effect parameters

rho

intra-class correlation parameter

phi

autocorrelation parameter

design

design matrix. If not specified, it will be calculated based on m, n, and MB.

m

number of cases. Not used if design is specified.

n

number of measurement occasions. Not used if design is specified.

MB

If true, a multiple baseline design will be used; otherwise, an AB design will be used. Not used if design is specified.

Value

A matrix reporting the mean and variance of the effect size estimates and various associated statistics.

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577

Examples

compare_RML_HPS(iterations=10, beta = c(0,1,0,0), rho = 0.3, 
                 phi = 0.5, design=design_matrix(m=3,n=8))

Datchuk (2016)

Description

Data from a multiple baseline design conducted by Datchuk (2016). The variables are as follows:

  • case. Participant identifier.

  • session. Measurement occasion.

  • condition. Factor identifying the phase of the design (baseline or treatment).

  • outcome. Correct word sequences per minute.

Format

A data frame with 74 rows and 4 variables

Source

Datchuk, S. M. (2016). Writing simple sentences and descriptive paragraphs: Effects of an intervention on adolescents with writing difficulties. Journal of Behavioral Education, 25(2), 166-188. doi:10.1007/s10864-015-9236-x


Calculate default initial treatment time and follow-up time.

Description

Calculate the default initial treatment time and follow-up time that are used to define and estimate the between-case standardized mean differences for multiple baseline designs and variations.

Usage

default_times(
  design,
  case,
  phase,
  session,
  cluster = NULL,
  series = NULL,
  treatment_name = NULL,
  data = NULL
)

Arguments

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").

case

vector of case indicators or name of a character or factor vector within data indicating unique cases.

phase

vector of treatment indicators or name of a character or factor vector within data indicating unique treatment phases.

session

vector of measurement occasions or name of numeric vector within data of measurement times.

cluster

(Optional) vector of cluster indicators or name of a character or factor vector within data indicating clusters.

series

(Optional) vector of series indicators or name of a character or factor vector within data indicating series.

treatment_name

(Optional) character string corresponding to the name of the treatment phase.

data

(Optional) dataset to use for analysis. Must be a data.frame.

Value

A list of time range, default initial treatment time, and default follow-up time.

Note

If treatment_name is left null, it will choose the second level of the phase variable to be the treatment phase.

Examples

data(Laski)
default_times(design = "MBP", 
              case = case, phase = treatment, session = time, 
              data = Laski)

data(Thiemann2001)
default_times(design = "RMBB", 
              case = case, series = series, 
              phase = treatment, session = time, 
              data = Thiemann2001)

data(Bryant2018)
default_times(design = "CMB", 
              cluster = group, case = case, 
              phase = treatment, session = session, 
              data = Bryant2018)

Delemere & Dounavi (2018)

Description

Data from a multiple baseline design conducted by Delemere & Dounavi (2018). The variables are as follows:

  • intervention. Type of intervention received: bedtime fading or positive routines.

  • case. Participant identifier.

  • session. Measurement occasion.

  • condition. Factor identifying the phase of the design (baseline or treatment).

  • outcome. Total sleep onset latency in minutes across nights.

Format

A data frame with 187 rows and 5 variables

Source

Delemere, E., & Dounavi, K. (2018). Parent-implemented bedtime fading and positive routines for children with autism spectrum disorders. Journal of Autism and Developmental Disorders, 48(4), 1002-1019. doi:10.1007/s10803-017-3398-4


Create a design matrix for a single-case design

Description

Create a design matrix containing a linear trend, a treatment effect, and a trend-by-treatment interaction for a single-case design with m cases and n measurement occasions.

Usage

design_matrix(m, n, treat_times = n/2 + 1, center = 0)

Arguments

m

number of cases

n

number of time points

treat_times

(Optional) vector of length m listing treatment introduction times for each case.

center

centering point for time trend.

Value

A design matrix

Examples

design_matrix(3, 16, c(5,9,13))

Calculates HPS effect size

Description

Calculates the HPS effect size estimator based on data from an (AB)^k design, as described in Hedges, Pustejovsky, & Shadish (2012). Note that the data must contain one row per measurement occasion per subject.

Usage

effect_size_ABk(
  outcome,
  treatment,
  id,
  phase,
  time,
  data = NULL,
  phi = NULL,
  rho = NULL
)

Arguments

outcome

vector of outcome data or name of variable within data. May not contain any missing values.

treatment

vector of treatment indicators or name of variable within data. Must be the same length as outcome.

id

factor vector indicating unique cases or name of variable within data. Must be the same length as outcome.

phase

factor vector indicating unique phases (each containing one contiguous control condition and one contiguous treatment condition) or name of variable within data. Must be the same length as outcome.

time

vector of measurement occasion times or name of variable within data. Must be the same length as outcome.

data

(Optional) dataset to use for analysis. Must be data.frame.

phi

(Optional) value of the auto-correlation nuisance parameter, to be used in calculating the small-sample adjusted effect size

rho

(Optional) value of the intra-class correlation nuisance parameter, to be used in calculating the small-sample adjusted effect size

Value

A list with the following components

M_a Matrix reporting the total number of time points with data for all ids, by phase and treatment condition
M_dot Total number of time points used to calculate the total variance (the sum of M_a)
D_bar numerator of effect size estimate
S_sq sample variance, pooled across time points and treatment groups
delta_hat_unadj unadjusted effect size estimate
phi corrected estimate of first-order auto-correlation
sigma_sq_w corrected estimate of within-case variance
rho estimated intra-class correlation
theta estimated scalar constant
nu estimated degrees of freedom
delta_hat corrected effect size estimate
V_delta_hat estimated variance of the effect size

Note

If phi or rho is left unspecified (or both), estimates for the nuisance parameters will be calculated.

References

Hedges, L. V., Pustejovsky, J. E., & Shadish, W. R. (2012). A standardized mean difference effect size for single case designs. Research Synthesis Methods, 3, 224-239. doi:10.1002/jrsm.1052

Examples

data(Lambert)
effect_size_ABk(outcome = outcome, treatment = treatment, id = case, 
                phase = phase, time = time, data = Lambert)
   
data(Anglesea)
effect_size_ABk(outcome = outcome, treatment = condition, id = case, 
                phase = phase, time = session, data = Anglesea)

Calculates HPS effect size

Description

Calculates the HPS effect size estimator based on data from a multiple baseline design, as described in Hedges, Pustejovsky, & Shadish (2013). Note that the data must contain one row per measurement occasion per subject.

Usage

effect_size_MB(
  outcome,
  treatment,
  id,
  time,
  data = NULL,
  phi = NULL,
  rho = NULL
)

Arguments

outcome

vector of outcome data or name of variable within data. May not contain any missing values.

treatment

vector of treatment indicators or name of variable within data. Must be the same length as outcome.

id

factor vector indicating unique cases or name of variable within data. Must be the same length as outcome.

time

vector of measurement occasion times or name of variable within data. Must be the same length as outcome.

data

(Optional) dataset to use for analysis. Must be data.frame.

phi

(Optional) value of the auto-correlation nuisance parameter, to be used in calculating the small-sample adjusted effect size

rho

(Optional) value of the intra-class correlation nuisance parameter, to be used in calculating the small-sample adjusted effect size

Value

A list with the following components

g_dotdot total number of non-missing observations
K number of time-by-treatment groups containing at least one observation
D_bar numerator of effect size estimate
S_sq sample variance, pooled across time points and treatment groups
delta_hat_unadj unadjusted effect size estimate
phi corrected estimate of first-order auto-correlation
sigma_sq_w corrected estimate of within-case variance
rho estimated intra-class correlation
theta estimated scalar constant
nu estimated degrees of freedom
delta_hat corrected effect size estimate
V_delta_hat estimated variance of delta_hat

Note

If phi or rho is left unspecified (or both), estimates for the nuisance parameters will be calculated.

References

Hedges, L. V., Pustejovsky, J. E., & Shadish, W. R. (2013). A standardized mean difference effect size for multiple baseline designs across individuals. Research Synthesis Methods, 4(4), 324-341. doi:10.1002/jrsm.1086

Examples

data(Saddler)
effect_size_MB(outcome = outcome, treatment = treatment, id = case, 
               time = time, data = subset(Saddler, measure=="writing quality"))

data(Laski)
effect_size_MB(outcome = outcome, treatment = treatment, id = case, 
               time = time, data = Laski)

Calculates adjusted REML effect size

Description

Estimates a design-comparable standardized mean difference effect size based on data from a multiple baseline design, using adjusted REML method as described in Pustejovsky, Hedges, & Shadish (2014). Note that the data must contain one row per measurement occasion per case.

Usage

g_REML(
  m_fit,
  p_const,
  r_const,
  X_design = model.matrix(m_fit, data = m_fit$data),
  Z_design = model.matrix(m_fit$modelStruct$reStruct, data = m_fit$data),
  block = nlme::getGroups(m_fit),
  times = attr(m_fit$modelStruct$corStruct, "covariate"),
  returnModel = TRUE
)

Arguments

m_fit

Fitted model of class lme, with AR(1) correlation structure at level 1.

p_const

Vector of constants for calculating numerator of effect size. Must be the same length as fixed effects in m_fit.

r_const

Vector of constants for calculating denominator of effect size. Must be the same length as the number of variance component parameters in m_fit.

X_design

(Optional) Design matrix for fixed effects. Will be extracted from m_fit if not specified.

Z_design

(Optional) Design matrix for random effects. Will be extracted from m_fit if not specified.

block

(Optional) Factor variable describing the blocking structure. Will be extracted from m_fit if not specified.

times

(Optional) list of times used to describe AR(1) structure. Will be extracted from m_fit if not specified.

returnModel

(Optional) If true, the fitted input model is included in the return.

Value

A list with the following components

p_beta Numerator of effect size
r_theta Squared denominator of effect size
delta_AB Unadjusted (REML) effect size estimate
nu Estimated denominator degrees of freedom
kappa Scaled standard error of numerator
g_AB Corrected effect size estimate
V_g_AB Approximate variance estimate
cnvg_warn Indicator that model did not converge
sigma_sq Estimated level-1 variance
phi Estimated autocorrelation
Tau Vector of level-2 variance components
I_E_inv Expected information matrix

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577

Examples

data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment, 
                 random = ~ 1 | case, 
                 correlation = corAR1(0, ~ time | case), 
                 data = Laski)
summary(Laski_RML)
g_REML(Laski_RML, p_const = c(0,1), r_const = c(1,0,1), returnModel=FALSE)

data(Schutte)
Schutte$trt.week <- with(Schutte, unlist(tapply((treatment=="treatment") * week, 
         list(treatment,case), function(x) x - min(x))) + (treatment=="treatment"))
Schutte$week <- Schutte$week - 9
Schutte_RML <- lme(fixed = fatigue ~ week + treatment + trt.week, 
                   random = ~ week | case, 
                   correlation = corAR1(0, ~ week | case), 
                   data = subset(Schutte, case != 4))
summary(Schutte_RML)
Schutte_g <- g_REML(Schutte_RML, p_const = c(0,0,1,7), r_const = c(1,0,1,0,0))
summary(Schutte_g)

Graph Single Case Design Data

Description

Graphs single case design data for treatment reversal and multiple baseline designs.

Usage

graph_SCD(
  design,
  case,
  phase,
  session,
  outcome,
  cluster = NULL,
  series = NULL,
  treatment_name = NULL,
  model_fit = NULL,
  data = NULL,
  newdata = NULL
)

Arguments

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").

case

vector of case indicators or name of a character or factor vector within data indicating unique cases.

phase

vector of treatment indicators or name of a character or factor vector within data indicating unique treatment phases.

session

vector of measurement occasions or name of numeric vector within data of measurement times.

outcome

vector of outcome data or name of numeric vector of outcome data within data.

cluster

(Optional) vector of cluster indicators or name of a character or factor vector within data indicating clusters.

series

(Optional) vector of series indicators or name of a character or factor vector within data indicating series.

treatment_name

(Optional) character string corresponding to the name of the treatment phase.

model_fit

(Optional) lme fitted model that adds predicted values to graph

data

(Optional) dataset to use for analysis. Must be a data.frame.

newdata

(Optional) dataset to use for calculating predicted values based on model_fit. Must be a data.frame.

Value

A ggplot graph

Note

If treatment_name is left null it will choose the second level of the phase variable to be the treatment phase.

Examples

if (requireNamespace("ggplot2", quietly = TRUE)) {

data(Anglesea)
graph_SCD(design="TR",
          case=case, phase=condition,
          session=session, outcome=outcome,
          treatment_name = "treatment",
          data=Anglesea)

data(BartonArwood)
graph_SCD(design="MBP",
          case=case, phase=condition,
          session=session, outcome=outcome,
          treatment_name = "B",
          data=BartonArwood)

data(Thiemann2001)
graph_SCD(design="RMBB",
          case=case, series = series, phase=treatment,
          session=time, outcome=outcome,
          treatment_name = "treatment",
          data=Thiemann2001)

data(Bryant2018)
graph_SCD(design="CMB",
          cluster=group, case=case, phase=treatment,
          session=session, outcome=outcome,
          treatment_name = "treatment",
          data=Bryant2018)

}

Gunning & Espie (2003)

Description

Data from a multiple baseline design conducted by Gunning & Espie (2003). The variables are as follows:

  • case. Participant identifier.

  • session. Measurement occasion.

  • condition. Factor identifying the phase of the design (baseline or treatment).

  • outcome. Sleep onset latency in minutes.

Format

A data frame with 301 rows and 4 variables

Source

Gunning, M. J., & Espie, C.A. (2003). Psychological treatment of reported sleep disorder in adults with intellectual disability using a multiple baseline design. Journal of Intellectual Disability Research, 47(3), 191-202. doi:10.1046/j.1365-2788.2003.00461.x


Calculate expected information matrix

Description

Calculates the expected information matrix from a fitted linear mixed effects model with AR(1) correlation structure in the level-1 errors.

Usage

Info_Expected_lmeAR1(m_fit)

Arguments

m_fit

Fitted model of class lme, with AR(1) correlation structure at level 1.

Value

Expected Information matrix corresponding to variance components of m_fit.

Examples

data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment, 
                 random = ~ 1 | case, 
                 correlation = corAR1(0, ~ time | case), 
                 data = Laski)
Info_Expected_lmeAR1(Laski_RML)

Example 1 from Hedges, Pustejovsky, & Shadish (2012)

Description

Data from an ABAB design conducted by Lambert, Cartledge, Heward, & Lo (2008). The variables are as follows:

  • measure. Outcome measure description (disruptive behavior or academic response).

  • case. Student identifier.

  • treatment. Factor indicating treatment or control condition. SSR = single-subject responding. RC = response cards.

  • phase. Study phase (including both control and treatment condition)

  • time. Measurement occasion.

  • outcome. Outcome scores.

Format

A data frame with 461 rows and 6 variables

Source

Lambert, M. C., Cartledge, G., Heward, W. L., & Lo, Y. (2006). Effects of response cards on disruptive behavior and academic responding during math lessons by fourth-grade urban students. Journal of Positive Behavior Interventions, 8(2), 88-99. doi:10.1177/10983007060080020701

References

Hedges, L. V., Pustejovsky, J. E., & Shadish, W. R. (2012). A standardized mean difference effect size for single case designs. Research Synthesis Methods, 3, 224-239. doi:10.1002/jrsm.1052


Example 2 from Hedges, Pustejovsky, & Shadish (2013)

Description

Data from a multiple baseline design conducted by Laski, Charlop, & Schreibman (1988). The variables are as follows:

  • case. Child identifier.

  • outcome. Frequency of child vocalization, as measured by a partial interval recording procedure with 60 ten-second intervals per session.

  • time. Measurement occasion.

  • treatment. Indicator for treatment phase.

Format

A data frame with 128 rows and 4 variables

Source

Laski, K. E., Charlop, M. H., & Schreibman, L. (1988). Training parents to use the natural language paradigm to increase their autistic children's speech. Journal of Applied Behavior Analysis, 21(4), 391-400. doi:10.1901/jaba.1988.21-391

References

Hedges, L. V., Pustejovsky, J. E., & Shadish, W. R. (2013). A standardized mean difference effect size for multiple baseline designs across individuals. Research Synthesis Methods, 4(4), 324-341. doi:10.1002/jrsm.1086


lmeInfo

Description

Functions imported from the lmeInfo package.


MB1 simulation results

Description

Simulation results for model MB1 from Pustejovsky, Hedges, & Shadish (2014).

Format

A data frame

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577


MB1 simulation time

Description

MB1 simulation time

Format

A data frame


MB2 simulation results

Description

Simulation results for model MB2 from Pustejovsky, Hedges, & Shadish (2014).

Format

A data frame

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577


MB2 simulation time

Description

MB2 simulation time

Format

A data frame


MB4 simulation results

Description

Simulation results for model MB4 from Pustejovsky, Hedges, & Shadish (2014).

Format

A data frame

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577


MB4 simulation time

Description

MB4 simulation time

Format

A data frame


Musser (2001)

Description

Data from a multiple baseline design conducted by Musser, Bray, Kehle, and Jenson (2001). The variables are as follows:

  • student Participant identifier

  • session Measurement occasion

  • outcome Percentage of disruptive intervals

  • treatment Factor indicating baseline, treatment, or follow-up phase

Format

A data frame with 136 rows and 4 variables

Source

Musser, E. H., Bray, M. A., Kehle, T. J., & Jenson, W. R. (2001). Reducing disruptive behaviors in students with serious emotional disturbance. School Psychology Review, 30(2), 294-304.


Peltier et al. (2020)

Description

Data from a multiple baseline design conducted by Peltier, Sinclair, Pulos, & Suk (2020). The variables are as follows:

  • case. Participant identifier.

  • session. Measurement occasion.

  • condition. Factor identifying the phase of the design (baseline or treatment).

  • outcome. Mathematical problem-solving performance (percentage).

Format

A data frame with 232 rows and 4 variables

Source

Peltier, C., Sinclair, T. E., Pulos, J. M., & Suk, A. (2020). Effects of schema-based instruction on immediate, generalized, and combined structured word problems. The Journal of Special Education, 54(2), 101-112. doi:10.1177/0022466919883397


Calculate phase-pairs for a unique case

Description

Calculate phase-pairs based on phases and session numbering.

Usage

phase_pairs(phase, session = seq_along(phase))

Arguments

phase

vector of treatment indicators or a character or factor vector indicating unique treatment phases.

session

numeric vector of measurement occasions.

Examples

phases <- rep(c("A","B","A","B"), each = 4)
sessions <- 1:length(phases)

phase_pairs(phases, sessions)

phases <- rep(c("A","B","C","A","B","C","D"), each = 4)
phase_pairs(phases)

phases <- rep(c("B","A","C","B","A","B","C","A"), each = 4)
phase_pairs(phases)

Clean Single Case Design Data

Description

Clean single case design data for treatment reversal and multiple baseline designs.

Usage

preprocess_SCD(
  design,
  case,
  phase,
  session,
  outcome,
  cluster = NULL,
  series = NULL,
  center = 0,
  round_session = TRUE,
  treatment_name = NULL,
  data = NULL
)

Arguments

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").

case

vector of case indicators or name of a character or factor vector within data indicating unique cases.

phase

vector of treatment indicators or name of a character or factor vector within data indicating unique treatment phases.

session

vector of measurement occasions or name of numeric vector within data of measurement times.

outcome

vector of outcome data or name of numeric vector of outcome data within data.

cluster

(Optional) vector of cluster indicators or name of a character or factor vector within data indicating clusters.

series

(Optional) vector of series indicators or name of a character or factor vector within data indicating series.

center

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

round_session

Logical indicating whether to round session to the nearest integer. Defaults to TRUE.

treatment_name

(Optional) character string corresponding to the name of the treatment phase.

data

(Optional) dataset to use for analysis. Must be a data.frame.

Value

A cleaned SCD dataset that can be used for model fitting and effect size calculation.

Note

If treatment_name is left null it will choose the second level of the phase variable to be the treatment phase.

Examples

data(Laski)
preprocess_SCD(design = "MBP", 
               case = case, phase = treatment,
               session = time, outcome = outcome, 
               center = 4, data = Laski)
               
data(Anglesea) 
preprocess_SCD(design="TR",
               case=case, phase=condition,
               session=session, outcome=outcome,
               treatment_name = "treatment",
               data=Anglesea)
               
data(Thiemann2001)
preprocess_SCD(design = "RMBB", 
               case = case, series = series, phase = treatment, 
               session = time, outcome = outcome, 
               data = Thiemann2001)

Rodgers et al. (2021)

Description

Data from a multiple baseline design conducted by Rodgers, Datchuk, & Rila (2021). The variables are as follows:

  • case. Participant identifier.

  • session. Measurement occasion.

  • condition. Factor identifying the phase of the design (baseline or treatment).

  • outcome. The number of correct writing sequences in 1 minute.

Format

A data frame with 83 rows and 4 variables

Source

Rodgers, D. B., Datchuk, S. M., & Rila, A. L. (2021). Effects of a text-writing fluency intervention for postsecondary students with intellectual and developmental disabilities. Exceptionality, 29(4), 310-325. doi:10.1080/09362835.2020.1850451


Rodriguez & Anderson (2014)

Description

Data from a multiple baseline design conducted by Rodriguez and Anderson (2014). The variables are as follows:

  • case Participant identifier

  • condition Factor identifying the phase of the design (A or B)

  • session Measurement occasion

  • outcome Percentage of intervals with problem behavior

Format

A data frame with 148 rows and 4 variables

Source

Rodriguez, B. J., & Anderson, C. M. (2014). Integrating a social behavior intervention during small group academic instruction using a total group criterion intervention. Journal of Positive Behavior Interventions, 16(4), 234-245. doi:10.1177/1098300713492858


Romaniuk (2002)

Description

Data from a treatment reversal design conducted by Romaniuk and colleagues (2002). The variables are as follows:

  • case Participant identifier

  • phase Factor identifying the phase of the design

  • condition Factor identifying the treatment condition

  • session Measurement occasion

  • outcome Problem behavior

  • measurement Character string describing how problem behavior was measured

Format

A data frame with 148 rows and 4 variables

Source

Romaniuk, C., Miltenberger, R., Conyers, C., Jenner, N., Jurgens, M., & Ringenberg, C. (2002). The influence of activity choice on problem behaviors maintained by escape versus attention. Journal of Applied Behavior Analysis, 35(4), 349-62. doi:10.1901/jaba.2002.35-349


Ruiz, et al. (2020)

Description

Data from a multiple baseline design conducted by Ruiz, Luciano, Florez, Suarez-Falcon, & Cardona-Betancourt (2020). The variables are as follows:

  • case. Participant identifier.

  • measure. Outcome measure description (AAQ-II, ANXIETY, CFQ, DASS-TOTAL, DEPRESSION, PSWQ, PTQ, STRESS, VQ-OBSTRUCTION, or VQ-PROGRESS).

  • treatment Factor indicating baseline, treatment, post, or follow-up phase.

  • time. Measurement occasion.

  • outcome. Outcome scores.

Format

A data frame with 840 rows and 5 variables

Source

Ruiz, F., Luciano, C., Florez, C., Suarez-Falcon, J., & Cardona-Betancourt, V. (2020). A Multiple-Baseline Evaluation of Acceptance and Commitment Therapy Focused on Repetitive Negative Thinking for Comorbid Generalized Anxiety Disorder and Depression. Frontiers in Psychology, 11. doi:10.3389/fpsyg.2020.00356


Example 1 from Hedges, Pustejovsky, & Shadish (2013)

Description

Data from a multiple baseline design conducted by Saddler, Behforooz, & Asaro, (2008). The variables are as follows:

  • case Student identifier

  • measure Factor indicating the outcome measure (writing quality, T-unit length, number of constructions)

  • outcome Value of outcome measure.

  • time. Measurement occasion.

  • treatment. Factor indicating the treatment phase.

Format

A data frame with 124 rows and 5 variables

Source

Saddler, B., Behforooz, B., & Asaro, K. (2008). The effects of sentence-combining instruction on the writing of fourth-grade students with writing difficulties. The Journal of Special Education, 42(2), 79-90. doi:10.1177/0022466907310371

References

Hedges, L. V., Pustejovsky, J. E., & Shadish, W. R. (2013). A standardized mean difference effect size for multiple baseline designs across individuals. Research Synthesis Methods, 4(4), 324-341. doi:10.1002/jrsm.1086


Salazar, et al. (2020)

Description

Data from a multiple baseline design conducted by Salazar, Ruiz, Ramírez1, & Cardona-Betancourt (2020). The variables are as follows:

  • case. Participant identifier.

  • measure. Outcome measure description (AFQ-Y, PTQ-C, or GPQ-C).

  • treatment Factor indicating baseline, treatment, post, or follow-up phase.

  • time. Measurement occasion.

  • outcome. Outcome scores.

Format

A data frame with 324 rows and 5 variables

Source

Salazar, D., Ruiz, F., Ramírez, E., & Cardona-Betancourt, V. (2020). Acceptance and Commitment Therapy Focused on Repetitive Negative Thinking for Child Depression: A Randomized Multiple-Baseline Evaluation. The Psychological Record. doi:10.1007/s40732-019-00362-5


Example from Pustejovsky, Hedges, & Shadish (2014)

Description

Data from a multiple baseline design conducted by Schutte, Malouff, & Brown (2008). Case 4 is excluded because nearly all of these measurements are at the upper extreme of the scale. The variables are as follows:

  • case. Participant identifier.

  • week. Measurement occasion.

  • treatment. Factor indicating baseline or treatment phase.

  • fatigue. Fatigue severity scale scores.

Format

A data frame with 136 rows and 4 variables

Source

Schutte, N. S., Malouff, J. M., & Brown, R. F. (2008). Efficacy of an emotion-focused treatment for prolonged fatigue. Behavior Modification, 32(5), 699-713. doi:10.1177/0145445508317133

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577


Calculate session-by-treatment interactions for a unique case

Description

Calculate session-by-treatment interactions based on phases and session numbering.

Usage

session_by_treatment(phase, session, trt_phase)

Arguments

phase

vector of treatment indicators or a character or factor vector indicating unique treatment phases.

session

numeric vector of measurement occasions.

trt_phase

character string indicating the phase value corresponding to the treatment condition.


A shiny interface for the scdhlm package

Description

An interactive shiny interface for estimating design-comparable standardized mean difference effect sizes from single-case designs. Estimation methods for multiple baseline and treatment reversal designs are available.

Usage

shine_scd(dataset = NULL, ...)

Arguments

dataset

Optionally, a data.frame or path to a file from which to read data. If specified, the app will open with the data loaded. Default is NULL. If dataset is a data.frame, then it will be passed directly. If a file path with a .xlsx extension is specified, it will be read using read_excel. If a file path with a .csv extension is specified, it will be read using read.csv. If a file path with a different extension is specified, it will be read using read.table.

...

Further arguments passed to read_excel, read.csv, or read.table.

Examples

## Not run: 
shine_scd()
data(Laski)
shine_scd(dataset = Laski)
shine_scd(dataset = "SCD_data.xlsx", sheet = "Laski")
shine_scd(dataset = "Laski.csv") 

## End(Not run)

Simulate Model MB2 from Pustejovsky, Hedges, & Shadish (2014)

Description

Simulates data from a linear mixed effects model, then calculates REML effect size estimator as described in Pustejovsky, Hedges, & Shadish (2014).

Usage

simulate_MB2(
  iterations,
  beta,
  rho,
  phi,
  tau1_ratio,
  tau_corr,
  design,
  m,
  n,
  MB = TRUE
)

Arguments

iterations

number of independent iterations of the simulation

beta

vector of fixed effect parameters

rho

intra-class correlation parameter

phi

autocorrelation parameter

tau1_ratio

ratio of treatment effect variance to intercept variance

tau_corr

correlation between case-specific treatment effects and intercepts

design

design matrix. If not specified, it will be calculated based on m, n, and MB.

m

number of cases. Not used if design is specified.

n

number of measurement occasions. Not used if design is specified.

MB

If true, a multiple baseline design will be used; otherwise, an AB design will be used. Not used if design is specified.

Value

A matrix reporting the mean and variance of the effect size estimates and various associated statistics.

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577

Examples

set.seed(8)
simulate_MB2(iterations = 5, beta = c(0,1,0,0), rho = 0.4, phi = 0.5, 
             tau1_ratio = 0.5, tau_corr = -0.4, design = design_matrix(m=3, n=8))
             
set.seed(8)
simulate_MB2(iterations = 5, beta = c(0,1,0,0), rho = 0.4, phi = 0.5, 
             tau1_ratio = 0.5, tau_corr = -0.4, m = 3, n = 8, MB = FALSE)

Simulate Model MB4 from Pustejovsky, Hedges, & Shadish (2014)

Description

Simulates data from a linear mixed effects model, then calculates REML effect size estimator as described in Pustejovsky, Hedges, & Shadish (2014).

Usage

simulate_MB4(
  iterations,
  beta,
  rho,
  phi,
  tau2_ratio,
  tau_corr,
  p_const,
  r_const,
  design,
  m,
  n,
  MB = TRUE
)

Arguments

iterations

number of independent iterations of the simulation

beta

vector of fixed effect parameters

rho

intra-class correlation parameter

phi

autocorrelation parameter

tau2_ratio

ratio of trend variance to intercept variance

tau_corr

correlation between case-specific trends and intercepts

p_const

vector of constants for calculating numerator of effect size

r_const

vector of constants for calculating denominator of effect size

design

design matrix. If not specified, it will be calculated based on m, n, and MB.

m

number of cases. Not used if design is specified.

n

number of measurement occasions. Not used if design is specified.

MB

If true, a multiple baseline design will be used; otherwise, an AB design will be used. Not used if design is specified.

Value

A matrix reporting the mean and variance of the effect size estimates and various associated statistics.

References

Pustejovsky, J. E., Hedges, L. V., & Shadish, W. R. (2014). Design-comparable effect sizes in multiple baseline designs: A general modeling framework. Journal of Educational and Behavioral Statistics, 39(4), 211-227. doi:10.3102/1076998614547577

Examples

simulate_MB4(iterations = 5, beta = c(0,1,0,0), rho = 0.8, phi = 0.5, 
             tau2_ratio = 0.5, tau_corr = 0, 
             p_const = c(0,1,0,7), r_const = c(1,0,1,0,0), 
             design = design_matrix(3, 16, treat_times=c(5,9,13), center = 12))
             
simulate_MB4(iterations = 5, beta = c(0,1,0,0), rho = 0.8, phi = 0.5, 
             tau2_ratio = 0.5, tau_corr = 0, m = 6, n = 8)

Simulate data from a fitted g_REML object

Description

Simulates data from the linear mixed effects model used to estimate the specified standardized mean difference effect size. Suitable for parametric bootstrapping.

Usage

## S3 method for class 'g_REML'
simulate(object, nsim = 1, seed = NULL, parallel = FALSE, ...)

Arguments

object

a g_REML object

nsim

number of models to simulate

seed

seed value. See documentation for simulate

parallel

if TRUE, run in parallel using foreach backend.

...

additional optional arguments

Value

A matrix with one row per simulation, with columns corresponding to the output of g_REML.

Examples

data(Laski)
Laski_RML <- lme(fixed = outcome ~ treatment,
                 random = ~ 1 | case,
                 correlation = corAR1(0, ~ time | case), 
                 data = Laski)

suppressWarnings(
  Laski_g <- g_REML(Laski_RML, p_const = c(0,1), r_const = c(1,0,1))
)

if (requireNamespace("plyr", quietly = TRUE)) {
  simulate(Laski_g, nsim = 5)
}

Thiemann & Goldstein (2001)

Description

Data from a multiple baseline across behaviors design conducted by Thiemann & Goldstein (2001). The variables are as follows:

  • Study_ID. Study identifier.

  • case. Student identifier.

  • series. Series identifier.

  • outcome. Frequency of coded social communication skills, as measured by a direct observation coding system with 15-second intervals recording for the occurrence of any of the four social measures: contingent responses, securing attention, initiating comments, and initiating requests.

  • time. Measurement occasion.

  • treatment. Indicator for treatment phase.

  • trt_time. Measurement occasion times treatment phase.

  • time_c. Measurement occasion centered at the follow-up time.

Format

A data frame with 363 rows and 8 variables

Source

Thiemann, K.S., & Goldstein, H. (2001). Social stories, written text cues, and video feedback: effects on social communication of children with Autism. Journal of Applied Behavior Analysis, 34(4), 425-446. doi:10.1901/jaba.2001.34-425


Thiemann & Goldstein (2004)

Description

Data from a multiple baseline across behaviors design conducted by Thiemann & Goldstein (2004). The variables are as follows:

  • Study_ID. Study identifier.

  • case. Student identifier.

  • series. Series identifier.

  • outcome. Frequency of unprompted targeted social communication skills, as measured by a direct observation, paper and pencil coding system during the 10-minute social activity for each behavior for all sessions.

  • time. Measurement occasion.

  • treatment. Indicator for treatment phase.

  • trt_time. Measurement occasion times treatment phase.

  • time_c. Measurement occasion centered at the follow-up time.

Format

A data frame with 408 rows and 8 variables

Source

Thiemann, K.S., & Goldstein, H. (2004). Effects of peer training and written text cueing on social communication of school-age children with pervasive developmental disorder. Journal of Speech Language and Hearing Research, 47(1), 126-144. doi:10.1044/1092-4388(2004/012)


Thorne (2005)

Description

Data from an ABAB design conducted by Thorne and Kamps (2008). The variables are as follows:

  • case. Participant identifier.

  • measure. Outcome measure description (academic engagement or inappropriate verbalizations).

  • session. Measurement occasion.

  • phase_id. Categorical variable describing the phase of the study design for each case.

  • condition Categorical variable describing whether each phase is a baseline (A) phase or intervention (B) phase.

  • phase_indicator. Indicator variable equal to 1 during intervention phases.

  • outcome. Outcome scores

Format

A data frame with 776 rows and 7 variables

Source

Thorne, S., & Kamps, D. (2008). The effects of a group contingency intervention on academic engagement and problem behavior of at-risk students. Behavior Analysis in Practice, 1(2), 12-18. doi:10.1007/BF03391723