This file contains hidden or 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
# Meta-Analysis Function -------------------------------------------------- | |
## Summary Effect Size and its Standard Error using DL method (Eqs. 1-3) | |
mw_est <- function(yi, | |
vi, | |
data, | |
lab, | |
method = c("DL", "DL2"), | |
ci = .95, | |
Q.profile = FALSE, | |
pi = FALSE, |
This file contains hidden or 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
SDadjP.lm <- function(model, B = 10000, seed = 1, rob = FALSE) { | |
# Stop if model not 'lm' object | |
stopifnot(class(model)[1] == "lm") | |
# Set seed for reproducibility | |
set.seed(seed) | |
# Set robust estimator | |
est <- ifelse(rob == TRUE, "HC3", "const") | |
# Set covariance matrix | |
covMat <- vcovHC(model, est) | |
# Get observed t-values |
This file contains hidden or 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 the shiny and longpower packages | |
library(shiny) | |
library(longpower) | |
# UI ---------------------------------------------------------------------- | |
ui <- fluidPage( | |
# Add title | |
titlePanel("Linear Mixed Model Sample Size Calculations"), | |
This file contains hidden or 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
# Import 'protest' data and convert 'protest' to 'labelled' | |
protest <- read.csv("protest.csv", header = TRUE) %>% | |
mutate( | |
protest = labelled( | |
protest, | |
c( | |
"No protest" = 0, | |
"Individual protest" = 1, | |
"Collective protest" = 2 | |
) |
This file contains hidden or 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 | |
# ------------------------------------------------------------------------- |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
# ------------------------------------------------------------------------- |
NewerOlder