graph_SCD: Graph Single Case Design Data

Description Usage Arguments Value Note Examples

View source: R/graphing-functions.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
graph_SCD(
  case,
  phase,
  session,
  outcome,
  design,
  treatment_name = NULL,
  model_fit = NULL,
  data = NULL
)

Arguments

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.

design

Character string to specify whether data comes from a treatment reversal, "TR", or multiple baseline, "MB", design.

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.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
data(Anglesea)
graph_SCD(case=case, phase=condition, 
          session=session, outcome=outcome, 
          design="TR", treatment_name = "treatment", 
          data=Anglesea)
          
data(BartonArwood)
graph_SCD(case=case, phase=condition, 
          session=session, outcome=outcome, 
          design="MB", treatment_name = "B",  
          data=BartonArwood)

scdhlm documentation built on Jan. 13, 2021, 7:10 p.m.