Skip to content

Instantly share code, notes, and snippets.

View ConnorEsterwood's full-sized avatar

Connor Esterwood ConnorEsterwood

View GitHub Profile
EI_forest<-plot_forest(out)
p <- plot_forest(EI_forest)$forest$`analysis id: 1`$moderated$individual_correction$ts
data_forest <- EI_forest$forest$`analysis id: 1`$moderated$individual_correction$ts$data
data_sorted <- data_forest %>%
arrange(yi)
# x is the RSA output from the RSA package
Shanock <- function(x) {
#Extract the necessary parameters
p10 <- getPar(x)[getPar(x)$label == "p10",]
p11 <- getPar(x)[getPar(x)$label == "p11",]
#######################################################################################
## This is based on Figure 3 from #
## Humberg, S., Nestler, S., & Back, M. D. (2019). #
## Response surface analysis in personality and social psychology: #
## Checklist and clarifications for the case of congruence hypotheses. #
## Social Psychological and Personality Science, 10(3), 409-419. #
#######################################################################################
require("RSA")
@ConnorEsterwood
ConnorEsterwood / power_tau.R
Created July 27, 2020 18:59 — forked from bwiernik/power_tau.R
Power function for testing τ = 0 for random effects meta-analyses
# Based on methods described by Hedges and Pigott, https://doi.org/10.1037/1082-989X.9.4.426, p. 438
# Written 2019-10-25 by Brenton M. Wiernik
# Licensed GPL v3.0
power_curve <- function(object, tau, level = .95) {
if (! inherits(object, "rma.uni")) stop("'object' must be an object of class 'rma.uni'")
tau2 <- tau^2
obs_tau2 <- object$tau2
obs_tau <- sqrt(obs_tau2)
obs_H2 <- object$H2