Skip to content

About

Tools for meta-analysis and experimental data from the BLP Lab at Princeton

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

115 Commits

Folders and files

Repository files navigation

editor_options
markdown
wrap
80

BLPlabtools

Lifecycle: experimental License: MIT

BLPlabtools documents the BLP lab's approach to conducting meta-analyses and analyzing experimental data.

Installation & getting started

remotes::install_github('setgree/BLPlabtools', build_vignettes = TRUE)
browseVignettes(package = "BLPlabtools")

The overview vignette previews the remainder.

This package contains

A few quick examples:

Calculate effect sizes

library(BLPlabtools)

# Example: Convert difference in means to Cohen's d
d <- d_calc(stat_type = "d_i_m", stat = 0.7, sample_sd = 0.75)
# Result: d = 0.933

# Calculate variance of the effect size
variance <- var_d_calc(d = d, n_t = 21, n_c = 21)
# Result: variance = 0.092

Run a meta-analysis

library(BLPlabtools)
library(dplyr, warn.conflicts = FALSE)

# Use built-in sexual violence prevention data
sv_data |> map_robust() 

This prints:

# A tibble: 1 × 5
  N_observations N_studies Delta     se pval     
           <int>     <int> <dbl>  <dbl> <noquote>
1            489       295 0.283 0.0251 <.0001   

Calculate cluster-robust standard errors

library(BLPlabtools)
data(contact_data)

# basic model:
model <- lm(d ~ days_delay + publish, data = contact_data)

# Add cluster-robust SEs by unique_study_id and
robust_se(model, cluster = contact_data$unique_study_id)[[2]] 

This prints

t test of coefficients:

               Estimate  Std. Error t value Pr(>|t|)   
(Intercept)  0.49606110  0.14650011  3.3861  0.00244 **
days_delay  -0.00020262  0.00036177 -0.5601  0.58061   
publish     -0.04319455  0.10299523 -0.4194  0.67867   
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Evolution of the project

The very first draft of this work was done to prepare for The contact hypothesis re-evaluated, whose code is preserved on Code Ocean.

Then, while preparing Prejudice Reduction: Progress and Challenges -- code and data here -- John-Henry and I came up with the first drafts of PaluckMetaSOP (meta-analysis functions) and blpl (table formatting tools). We refined those further while preparing Preventing Sexual Violence —A Behavioral Problem Without a Behaviorally-Informed Solution.

Finally, I (Seth Green) adapted these tools further for Meaningfully reducing consumption of meat and animal products is an unsolved problem: A meta-analysis, whose code and data is here.

This package represents the culmination and synthesis of those many earlier efforts.

For BLP Lab members

To contribute:

  1. Clone this package (git clone https://github.com/setgree/BLPlabtools.git);
  2. Add or amend functions and vignettes
  3. Open a pull request

See R packages for guidance. Or just use Claude Code 😃

About

Tools for meta-analysis and experimental data from the BLP Lab at Princeton

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages