Welcome to ClientVPS Mirrors

Help for package baselinr

Package {baselinr}


Title: WWC-Aligned Baseline Equivalence Tables for Education Impact Evaluations
Version: 0.5.0
Description: Produces report-ready baseline equivalence tables for impact evaluations in education research, following the conventions of the What Works Clearinghouse (WWC). Computes standardized mean differences (Hedges' g) between treatment and comparison groups for continuous covariates and classifies each covariate into the WWC baseline-equivalence categories (satisfied, satisfied with statistical adjustment, or not satisfied).
License: MIT + file LICENSE
Encoding: UTF-8
Language: en-US
Imports: rlang, stats
Suggests: ggplot2, gt, knitr, rmarkdown, testthat (≥ 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
URL: https://github.com/zl1212-ship-it/baselinr, https://zl1212-ship-it.github.io/baselinr/
BugReports: https://github.com/zl1212-ship-it/baselinr/issues
Config/roxygen2/version: 8.0.0
Depends: R (≥ 3.5)
LazyData: true
NeedsCompilation: no
Packaged: 2026-06-24 20:07:52 UTC; yuxialiang
Author: Yuxia Liang ORCID iD [aut, cre]
Maintainer: Yuxia Liang <zl1212@uw.edu>
Repository: CRAN
Date/Publication: 2026-06-30 19:00:07 UTC

baselinr: WWC-aligned baseline equivalence for education impact evaluations

Description

baselinr produces report-ready baseline equivalence tables for impact evaluations in education research, following the conventions of the What Works Clearinghouse (WWC). It takes a data frame, a treatment indicator, and a set of covariates, and reports — for each covariate — the appropriate standardized effect size (Hedges' g for continuous covariates, the Cox index for binary covariates) together with the WWC baseline-equivalence category.

Author(s)

Maintainer: Yuxia Liang zl1212@uw.edu (ORCID)

Authors:

See Also

Useful links:


Overall and differential attrition

Description

Computes overall and differential sample attrition for a two-group design, the inputs to the What Works Clearinghouse (WWC) attrition standard. Differential attrition is the absolute difference between the treatment and comparison attrition rates.

Usage

attrition(treatment, retained, na.rm = TRUE)

Arguments

treatment

Vector identifying group membership; exactly two unique non-missing values (the larger is treated as the treatment group, as in hedges_g()).

retained

Logical (or 0/1) the same length as treatment: TRUE/1 for cases retained in the analytic sample, FALSE/0 for those lost.

na.rm

Logical; drop rows where treatment or retained is NA. Default TRUE.

Details

This function reports the attrition rates; it does not classify them. Compare the overall and differential rates against the WWC attrition boundary for your chosen response assumption (cautious or optimistic) in the Procedures Handbook.

Value

A one-row data frame with columns attrition_overall, attrition_treatment, attrition_comparison, and differential_attrition (all proportions).

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

set.seed(1)
g <- rep(c(1, 0), each = 100)
kept <- rbinom(200, 1, ifelse(g == 1, 0.9, 0.8))
attrition(g, kept)


Baseline equivalence table for an impact evaluation

Description

Builds a report-ready baseline-equivalence table for a set of covariates, reporting group sample sizes, summaries, the appropriate standardized effect size, and the corresponding What Works Clearinghouse (WWC) equivalence category for each covariate. Continuous covariates use Hedges' g; binary covariates use the Cox index.

Usage

baseline_equivalence(data, treatment, covariates = NULL)

Arguments

data

A data frame.

treatment

String naming the column in data that identifies group membership. Must have exactly two unique non-missing values (see hedges_g() for how the treatment group is determined).

covariates

Character vector of column names to evaluate. Defaults to all numeric, logical, and factor columns in data other than treatment.

Details

A covariate with exactly two unique non-missing values is treated as binary; any other numeric covariate is treated as continuous. A non-numeric covariate with more than two categories is not supported and raises an error.

Value

A data frame with one row per covariate and the columns: covariate; type ("continuous" or "binary"); n_treatment, n_comparison; mean_treatment, mean_comparison (group means for continuous covariates, event proportions for binary ones); sd_treatment, sd_comparison; effect_size (Hedges' g or Cox index, per type); and wwc_category.

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

df <- data.frame(
  treat = c(1, 1, 1, 0, 0, 0),
  pretest = c(5, 6, 7, 4, 5, 6),
  female = c(1, 0, 1, 0, 0, 1)
)
baseline_equivalence(df, treatment = "treat")


Cox index for a binary covariate

Description

Computes the What Works Clearinghouse (WWC) Cox index, a standardized effect size for a binary (dichotomous) covariate. The Cox index places the difference between two proportions on a scale comparable to Hedges' g, so it can be classified with the same baseline-equivalence thresholds.

Usage

cox_index(x, treatment, na.rm = TRUE)

Arguments

x

A binary covariate (numeric 0/1, logical, two-level factor, or any vector with exactly two unique non-missing values). The larger value (e.g. 1, TRUE, or the second sorted level) is treated as the "event".

treatment

Vector the same length as x identifying group membership; exactly two unique non-missing values (see hedges_g()).

na.rm

Logical; drop rows where x or treatment is NA. Default TRUE.

Details

The index is d_{Cox} = (\mathrm{logit}(p_t) - \mathrm{logit}(p_c)) / 1.65, where p_t and p_c are the proportions in the "event" category for the treatment and comparison groups.

Value

A single numeric value: the Cox index. Returns NA (with a warning) when a group proportion is exactly 0 or 1, where the index is undefined.

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

x <- c(1, 1, 1, 1, 0, 1, 0, 0)
g <- c(1, 1, 1, 1, 0, 0, 0, 0)
cox_index(x, g)


Format a baseline equivalence table with gt

Description

Renders the result of baseline_equivalence() as a formatted gt table with rounded statistics and readable column labels. Requires the gt package.

Usage

gt_baseline(equivalence, decimals = 2)

Arguments

equivalence

A data frame returned by baseline_equivalence().

decimals

Number of decimal places for the numeric columns. Default 2.

Value

A gt_tbl object.

Examples

if (requireNamespace("gt", quietly = TRUE)) {
  df <- data.frame(
    treat = c(1, 1, 1, 0, 0, 0),
    pretest = c(5, 6, 7, 4, 5, 6),
    female = c(1, 0, 1, 0, 0, 1)
  )
  tbl <- gt_baseline(baseline_equivalence(df, "treat"))
}


Hedges' g standardized mean difference

Description

Computes the standardized mean difference (Hedges' g) between a treatment and a comparison group for a single numeric covariate, using the pooled within-group standard deviation and the small-sample correction factor used by the What Works Clearinghouse (WWC).

Usage

hedges_g(x, treatment, na.rm = TRUE)

Arguments

x

Numeric vector of covariate values.

treatment

Vector the same length as x identifying group membership. Must have exactly two unique non-missing values. The larger value (e.g. 1, TRUE, or the second sorted level) is treated as the treatment group; the other as the comparison group.

na.rm

Logical; drop rows where x or treatment is NA. Default TRUE.

Details

The correction factor is \omega = 1 - 3 / (4N - 9), where N = n_{treatment} + n_{comparison}.

Value

A single numeric value: Hedges' g. Positive when the treatment group mean exceeds the comparison group mean.

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

x <- c(5, 6, 7, 4, 5, 6)
g <- c(1, 1, 1, 0, 0, 0)
hedges_g(x, g) # 0.8


Love plot of standardized effect sizes

Description

Plots the standardized effect size for each covariate from baseline_equivalence(), with reference lines at the What Works Clearinghouse (WWC) thresholds (0.05 and 0.25) and points coloured by WWC category. Requires the ggplot2 package.

Usage

love_plot(equivalence, signed = FALSE)

Arguments

equivalence

A data frame returned by baseline_equivalence().

signed

Logical. If FALSE (default), plot absolute effect sizes with reference lines at 0.05 and 0.25. If TRUE, plot signed effect sizes with symmetric reference lines and a line at zero.

Value

A ggplot object.

Examples

if (requireNamespace("ggplot2", quietly = TRUE)) {
  df <- data.frame(
    treat = c(1, 1, 1, 0, 0, 0),
    pretest = c(5, 6, 7, 4, 5, 6),
    female = c(1, 0, 1, 0, 0, 1)
  )
  love_plot(baseline_equivalence(df, "treat"))
}


Simulated tutoring program evaluation

Description

A small, simulated (not real) dataset for demonstrating baseline equivalence assessment in a quasi-experimental education evaluation. It represents 400 students: 200 who received a tutoring program and 200 comparison students who did not, with baseline covariates measured before the program and an outcome measured after. The treatment group is mildly positively selected, so the covariates span all three What Works Clearinghouse equivalence categories.

Usage

tutoring

Format

A data frame with 400 rows and 8 variables:

treat

Treatment indicator: 1 = received tutoring, 0 = comparison.

pretest

Baseline reading score (continuous).

attendance

Baseline attendance rate, 0-1 (continuous).

age

Age in years at baseline (continuous).

female

1 = female, 0 = not (binary).

frpl

Eligible for free or reduced-price lunch: 1 = yes (binary).

ell

English language learner: 1 = yes (binary).

posttest

Reading score after the program (continuous outcome).

Source

Simulated for package examples with data-raw/tutoring.R; not real student data.


Classify baseline equivalence under WWC standards

Description

Maps standardized effect sizes to the three What Works Clearinghouse baseline-equivalence categories. Sign is ignored; classification uses the absolute value of the effect size.

Usage

wwc_classify(es)

Arguments

es

Numeric vector of standardized effect sizes (e.g. values returned by hedges_g() or cox_index()).

Value

A character vector the same length as es:

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

wwc_classify(c(0.03, 0.12, 0.80))


Overall WWC baseline-equivalence verdict

Description

Summarizes a baseline_equivalence() table into a one-row overall assessment: how many covariates fall in each What Works Clearinghouse (WWC) category, the largest absolute effect size, and an overall verdict.

Usage

wwc_summary(equivalence)

Arguments

equivalence

A data frame returned by baseline_equivalence().

Details

The overall verdict follows the logic of the categories: if any covariate is "not_satisfied", baseline equivalence cannot be established ("not_satisfied"); otherwise, if any covariate requires adjustment, the verdict is "satisfied_with_adjustment" (equivalence holds only if those covariates are adjusted for in the impact model); otherwise "satisfied".

Value

A one-row data frame with columns n_covariates, n_satisfied, n_satisfied_with_adjustment, n_not_satisfied, max_abs_effect, and overall.

References

What Works Clearinghouse (2022). Procedures Handbook (Version 5.0). U.S. Department of Education.

Examples

df <- data.frame(
  treat = c(1, 1, 1, 0, 0, 0),
  pretest = c(5, 6, 7, 4, 5, 6),
  female = c(1, 0, 1, 0, 0, 1)
)
wwc_summary(baseline_equivalence(df, "treat"))

Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.

This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.