This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================================================= | |
# | |
# Analysis of repeated single-case data | |
# | |
# Mueser, K. T., Yarnold, P. R., & Foy, D. W. (1991). | |
# Statistical Analysis for Single-Case Designs Evaluating Outcome | |
# of Imaginal Exposure Treatment of Chronic PTSD. | |
# Behavior Modification, 15(2), 134-155. | |
# | |
# Coded by: Sam Mancuso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>qol.scores <- c(45, 80, 70, 70) # QoL data | |
>single.case(qol.scores, baseline = 1, level = .05) # Time.1 is baseline | |
Single-case data analysis | |
x dx z dz Sig | |
Time.1 45 Baseline -1.42 Baseline Baseline | |
Time.2 80 -35 0.92 -2.34 * | |
Time.3 70 -25 0.25 -1.67 * | |
Time.4 70 -25 0.25 -1.67 * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require(boot) | |
require(car) | |
require(MASS) | |
require(QuantPsyc) # lm.beta() function | |
#---- Bootstrap Mediation Function ---- | |
boot.med <- function(data, formula.m, formula.y, iv, mv, i) { | |
data.resamp <- data[i,] | |
reg.m <- lm(formula.m, data=data.resamp) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>med(data=rfe, iv = "SOQsos", dv = "MBASo", mv="REIappear", cv="AGE", reps=1000) | |
Independent Variable: SOQsos | |
Dependent Variable: MBASo | |
Mediator Variable: REIappear | |
IV (and CVs) on DV | |
Estimate SE Pr(>|z|) LL UL Beta | |
(Intercept) 3.69132749 0.199476668 3.154675e-40 3.300353220 4.082301760 NA | |
SOQsos 0.01914967 0.005112734 2.578910e-04 0.009128709 0.029170628 0.2940897 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------- | |
# Sample Size Estimation for Comparisons between Two Groups | |
# in Experimental Designs | |
# Coded by: Sam Mancuso | |
# Date: 03 March 2015 | |
# Version: 2.0 | |
# Revision Date: 05 March 2015 | |
# Blog: sammancuso.wordpress.com | |
# ------------------------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
********************************************************************** | |
* Project: Classification of Eating Disorders using EDE-Q | |
* Coded by: Sam Mancuso | |
* Version: 1.0 | |
* Date: 22 July 2014 | |
*********************************************************************** | |
** NB | |
* bmi_at_assessment = Clinician assessed BMI | |
* menstrual_status_on_admission = Clinician assessed menstrual status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------- | |
# Project: Bootstrap AN(C)OVA | |
# Coded by: Sam Mancuso | |
# Mail: sammancuso.wordpress.com | |
# Date: 18 May 2015 | |
# Version: 1.0 | |
# Revision Date: NA | |
# ------------------------------------------------------------------------- | |
# Load Libraries ---------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------- | |
# Project: Bootstrap AN(C)OVA with Posthoc Pairwise Comparisons | |
# Coded by: Sam Mancuso | |
# Mail: sammancuso.wordpress.com | |
# Date: 27 May 2015 | |
# Version: 2.0 | |
# Revision Date: 2 June 2015 | |
# ------------------------------------------------------------------------- | |
# Load Libraries ---------------------------------------------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load required packages -------------------------------------------------- | |
if (!require(pacman)) { | |
install.packages("pacman") | |
} | |
pacman::p_load(car, boot) | |
# Function ---------------------------------------------------------------- | |
nullboot.Anova <- function(null.model, full.model, | |
B = 1000, scaled = TRUE, seed = 1234, | |
ci = TRUE, cent = .95, dec = 5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ------------------------------------------------------------------------- | |
# Project: SF-12 v2.0 Scoring using Australian Population Weights | |
# | |
# Coded by: Sam Mancuso | |
# Web: sammancuso.com | |
# | |
# Date: 9 November 2017 | |
# Version: 2.00 | |
# Notes: Updated to use dplyr | |
# ------------------------------------------------------------------------- |
OlderNewer