absorb.reorg: Absorb Fixed Effects and Reorder Data

View source: R/hypothesis_test.r

absorb.reorgR Documentation

Absorb Fixed Effects and Reorder Data

Description

This function reorganizes the data by cluster and fixed effect, absorbing group fixed effects and applying weights.

Usage

absorb.reorg(data, x.names, cluster.id, weights, fe.id, crve, y.name = NULL)

Arguments

data

Data frame or matrix containing all outcomes, covariates, and group ids

x.names

Vector of covariate names

cluster.id

Name of cluster id variable

weights

Name of weight variable, if applicable

fe.id

Name of fixed effect group id variable (defaults to cluster.id)

crve

Type of cluster-robust variance estimator (CR0, CR1, CR2, CR3)

Value

A list containing: Xdw.h (covariates by cluster), XTX.inv (inverse squared design matrix), A.h (adjustment matrices by cluster), Ydw.h (outcomes by cluster, if applicable)


akiva-yonah-meiselman/clubsoda documentation built on Feb. 3, 2025, 1:34 p.m.