Below is the R code for conducting mediation analyses using the bootstrap method detailed in Preacher and Hayes (2004). Please note that my function uses the bias corrected and accelarated (BCa) confidence intervals, whereas their SPSS and SAS macros use the bias corrected (BC) confidence intervals. However, they should yield similar results.
This post presents an R function to implement the sample size estimation presented in Twisk (2013) for continuous outcomes.
Formula 11.1 is used when the researcher wants to compare two groups at one single point in time (e.g., placebo versus treatment at post-intervention), whereas Formula 11.3 is used when there is more than one follow-up measurement and the researcher is interested in comparing the two groups based on the average in the outcome variable over the total follow-up period.
I was recently asked to examine some single-case study data and ended up using the method described by Mueser, Yarnold, and Foy (1991). In order to use this method, your data must comprise a minimum of four assessment points at equally spaced intervals (e.g., baseline, 12-weeks, 24-weeks, and 36-weeks).
This method is based on classical test theory and the steps involved are as follows:
- Calculate ipsative z-scores for the participant
- Calculate the 1-lag autocorrelation factor
- Calculate the critical difference (CD)
- For each assessment point, we calculate the difference between the corresponding z-score and the z-score at baseline.
- If the absolute value of this difference score is greater than the CD value, then it is statistically significant.