Learn R Programming

fastrerandomize (version 0.3)

hotellingT2_R: Compute Hotelling's T-squared statistic in base R

Description

This function provides a base R implementation of Hotelling's T-squared balance measure, renamed with `_R` for clarity that it is the R-based analog to the JAX version in fastrerandomize.

Usage

hotellingT2_R(X, W)

Value

A numeric scalar: Hotelling's T-squared statistic for that assignment.

Arguments

X

A numeric matrix of covariates (observations in rows).

W

A 0/1 treatment assignment vector of the same length as nrow(X).