% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/between_smd.R, R/print-export-bcsmd.R
\name{between_smd}
\alias{between_smd}
\alias{print.sc_bcsmd}
\alias{export.sc_bcsmd}
\title{Between-Case Standardized Mean Difference}
\usage{
between_smd(
  data,
  method = c("REML", "MCMCglmm"),
  ci = 0.95,
  include_residuals = TRUE,
  ...
)

\method{print}{sc_bcsmd}(x, digits = 2, ...)

\method{export}{sc_bcsmd}(
  object,
  caption = NA,
  footnote = NA,
  filename = NA,
  digits = 2,
  round = 2,
  ...
)
}
\arguments{
\item{data}{Either an scdf or an object returned from the \code{\link[=hplm]{hplm()}} or
\code{\link[=bplm]{bplm()}} function.}

\item{method}{Either \code{"REML"} or "\verb{MCMglmm"}. This indicated which
statistical method is applied to calculate the model.}

\item{ci}{A numeric between 0 and 1 setting the width of the confidence
interval (when method is REML) or the credible interval (when method is
MCMCglmm). The default is \code{0.95} for a 95-percent interval.}

\item{include_residuals}{Logical. See details.}

\item{...}{Further arguments passed to the \code{\link[=hplm]{hplm()}} or \code{\link[=bplm]{bplm()}}function.}

\item{x}{An object returned by \code{baseline_smd()}.}

\item{digits}{The minimum number of significant digits to be use.
If set to "auto" (default), values are predefined.}

\item{object}{An scdf or an object exported from a scan function.}

\item{caption}{Character string with table caption. If left NA (default) a
caption will be created based on the exported object.}

\item{footnote}{Character string with table footnote. If left NA (default) a
footnote will be created based on the exported object.}

\item{filename}{String containing the file name. If a filename is given the
output will be written to that file.}

\item{round}{Integer passed to the digits argument used to round values.}
}
\value{
An object of class sc_bcsmd. It is a list containing the following
elements:
\itemize{
\item \code{models}: A list of data frames containing the BC-SMD results for each
model calculated.
\item \code{ci}: The width of the confidence/credible interval.
\item \code{method}: The method used for model estimation.
}
}
\description{
Calculates a standardized mean difference from a multilevel model as
described in Pustejovsky et al. (2014)
}
\details{
The BC-SMD is calculate as \verb{BC-SMD = Phase difference / sqrt(residual + random_intercept)}. This is most closely related to Cohen's \emph{d}. If you want
to have the most exact estimation based on the between case variance, you
have to exclude the residual variance by setting the argument
\code{include_residuals = FALSE} you get \verb{BC-SMD = Phase difference / sqrt(random_intercept)}. The 'base' model only includes the phase level as a
predictor like originally proposed by Hedges et al. Whereas the 'Full plm'
model includes the trend and the phase slope as additional predictors.
}
\section{Functions}{
\itemize{
\item \code{print(sc_bcsmd)}: Print results

\item \code{export(sc_bcsmd)}: export results

}}
\examples{
## Create a example scdf:
des <- design(
  n = 150,
  phase_design = list(A1 = 10, B1 = 10, A2 = 10, B2 = 10, C = 10),
  level = list(B1 = 1, A2 = 0, B2 = 1, C = 1),
  rtt = 0.7,
  random_start_value = TRUE
)
study <- random_scdf(des)

## Standard BC-SMD return:
between_smd(study)

## Specify the model and provide an hplm object:
model <- hplm(study, contrast_level = "preceding", slope = FALSE,  trend = FALSE)
between_smd(model)

## excluding the residuals gives a more accurate estimation:
between_smd(model, include_residuals = FALSE)

}
\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(5), 368–393. https://doi.org/10.3102/1076998614547577
}
\author{
Juergen Wilbert
}
