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
## Functions to draw samples from distributions implied by lm() models | |
## | |
## Arguments for simulate_model correspond to arguments in: | |
## a) stats::predict.lm(); | |
## b) stats::simulate(); | |
## c) nsamples is an alias for nsim; | |
## d) dist_type specifies the type of distribution to sample from | |
## 1) "ml"; from the maximum likelihood distribution; | |
## the distribution implied by estimated model parameters; | |
## (equivalent to stats::simulate()); |
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
<?xml version="1.0" encoding="utf-8"?> | |
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="display-and-sort" page-range-format="chicago"> | |
<info> | |
<title>Chicago Manual of Style 17th edition (author-date)</title> | |
<id>http://www.zotero.org/styles/chicago-author-date</id> | |
<link href="http://www.zotero.org/styles/chicago-author-date" rel="self"/> | |
<link href="http://www.chicagomanualofstyle.org/tools_citationguide.html" rel="documentation"/> | |
<author> | |
<name>Julian Onions</name> | |
<email>julian.onions@gmail.com</email> |
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
# 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 |
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
>>===== MODE =====>> | |
bibliography | |
<<===== MODE =====<< | |
>>===== DESCRIPTION =====>> | |
set delimiter | |
<<===== DESCRIPTION =====<< | |
>>===== RESULT =====>> | |
<div class="csl-bib-body"> |
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
>>===== MODE =====>> | |
bibliography | |
<<===== MODE =====<< | |
>>===== DESCRIPTION =====>> | |
limit-day-ordinals-to-day-1 with date ranges | |
<<===== DESCRIPTION =====<< | |
>>===== RESULT =====>> | |
<div class="csl-bib-body"> |
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
alpha_stratified <- function(x, a, na.rm = TRUE) { | |
v <- diag(var(x, na.rm = na.rm)) | |
vt <- sum(var(x, na.rm = na.rm)) | |
ev <- sum((1 - a) * v) | |
return(list(strat.alpha = c(1 - ev/vt), scores = rowMeans(x, na.rm = TRUE))) | |
} |
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
alpha_stratified <- function(x, a, na.rm = TRUE) { | |
v <- diag(var(x, na.rm = na.rm)) | |
vt <- sum(var(x, na.rm = na.rm)) | |
ev <- sum((1 - a) * v) | |
return(list(strat.alpha = c(1 - ev/vt), scores = rowMeans(x, na.rm = TRUE))) | |
} |
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
<?xml version="1.0" encoding="utf-8"?> | |
<style xmlns="http://purl.org/net/xbiblio/csl" class="note" version="1.0" demote-non-dropping-particle="never" page-range-format="expanded"> | |
<info> | |
<title>American Psychological Association 7th edition (full note, annotations)</title> | |
<title-short>APA (full note, annote)</title-short> | |
<summary>APA style, with citations formatted as full notes and standalone annotations entered in the `annote` field of patent items.</summary> | |
<id>http://www.zotero.org/styles/apa-fullnote-annotations</id> | |
<link href="https://raw.githubusercontent.com/bwiernik/zotero-tools/master/apa-fullnote-annotations.csl" rel="self"/> | |
<link href="http://www.zotero.org/styles/apa" rel="template"/> | |
<link href="https://apastyle.apa.org/style-grammar-guidelines/references/examples" rel="documentation"/> |
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
' Functions to format numbers and estimates with confidence intervals in an APA-like format | |
' | |
' Author: Brenton M. Wiernik | |
' Date: 2020-05-12 | |
' | |
' License: CC0 | |
' | |
' Usage examples: | |
' Single number: | |
' =apanum(value, lead_zero, pos_sign, neg_sign, big_sep) |
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
# Script to meta-analyze results of lavaan sem models | |
# | |
# Author: Brenton M. Wiernik | |
# Date: 2020-04-24 | |
# License: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/) | |
# | |
# This script will meta-analyze the results of lavaan sem models. It assumes | |
# that the exact same lavaan model is specified for each sample and is | |
# not robust to differences in model specfications.# |