Learn R Programming

dcce (version 0.4.2)

.build_global_csa: Build cross-sectional averages from a wider sample

Description

Computes cross-sectional means using full_panel (a broader sample) and merges them into panel (the estimation sample). Useful when the estimation sample is a subset of the available data.

Usage

.build_global_csa(panel, full_panel, vars, lags = 0L)

Value

panel with CSA columns appended (computed from full_panel).

Arguments

panel

A panel data.frame (estimation sample).

full_panel

A panel data.frame (wider sample for computing averages).

vars

Character vector of variable names.

lags

Integer or named integer vector of CSA lags.