Skip to content

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

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

setgree/BLPlabtools

Repository files navigation

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

It draws from four projects:

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

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

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages