Cross-Sectional Dependence Models
Overview
Provides estimators and utilities for large panel-data models with cross-sectional dependence, including mean group (MG), common correlated effects (CCE) and dynamic CCE (DCCE) estimators, and cross-sectionally augmented ARDL (CS-ARDL) specifications, plus related inference and diagnostics.
Version 2.0.0 expands the package's R model interfaces, adds new sample
controls, and improves estimator and diagnostic behavior. It also includes bug
fixes for edge cases involving irregular time indexes, missing observations,
cross-sectional averages, covariance calculations, and dependence tests. For
reproducibility, report the package version when comparing output across
releases.
Estimation and inference
- Add
fullsample = TRUEfor CCE-based models. Cross-sectional averages are then calculated variable by variable from all finite observations in the selected sample before dynamic lag trimming. - Construct model and cross-sectional-average lags by explicit time-grid matching, preventing lags from crossing gaps in a panel.
Show all changes in 2.0.0Hide the rest of the changes in 2.0.0
- Evaluate formulas, transformed cross-sectional-average variables, subsets, and missing-value policies consistently.
- Correct missing-value and leave-one-out cross-sectional averages.
- Use one eligible unit sample for mean-group coefficients and covariance, and require at least two eligible units.
- Correct fixed-weight mean-group covariance scaling and HC0--HC3 sandwich covariance calculations.
- Check structural identification after cross-sectional-average projection and report excluded units.
- Align CS-ARDL parameter components and covariance, and expose unit-level AR stability and long-run-ratio eligibility.
- Validate panel keys, retain original observation identity when sorting, and preserve named cross-sectional-average lag specifications.
Dependence diagnostics
- Remove time periods containing no estimated residuals before assessing CD sample balance, while retaining the selected policy for partially observed periods.
- Implement the paper-defined pooled-variance CDw statistic and the correlation-scale screening term used by CDw+ for balanced samples.
- Correct CD-star unit-specific residual scales and validate PCA rank.
- Make randomized diagnostics opt-in, preserve seeded RNG state, and use pairwise samples for the classical CD statistic.
- Validate clustered covariance inputs and make residual transformations explicit.
R interfaces
- Add standard extraction and update methods, original-row fitted and residual outputs, and stored-data model updates.
- Add
tidy(),glance(), andaugment()methods with inference and row-alignment checks. - Document
cross_sectional_avg()as a supported standalone data utility and distinguish it from averages configured bycsdm_csa(). - Retain evaluated subset, time-spacing, missing-value, and
pdata.frametime information when models are updated. - Reject unsupported model, trend, cross-sectional-average, long-run, and covariance specifications instead of silently storing or ignoring them.
Deprecations
- Deprecate
csdm_pooled()because pooled restrictions are not implemented. - Deprecate
get_residuals()in favor of the standardresiduals()method. - Deprecate
prepare_cd_input()because its transformations are not used bycd_test()and can change the hypothesis represented by the residuals. - Deprecate the exported
cluster_vcov(),sandwich_vcov(), andpooled_vcov()utilities. Existing calls continue to work with a migration warning.
Documentation and maintenance
- Rewrite the README, introductory vignette, and pkgdown navigation around the implemented API. Correct the description of
log_ngd, update the CDw/CDw+ explanations, and make the introductory examples runnable. - Add reference fixtures, statistical validation scripts, platform checks, and Codecov reporting.
- Share unit-regression and sample-bookkeeping code across the MG, CCE, and DCCE engines, and remove obsolete internal helpers and imports.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK14 OK2026-03-10
Documentation
- Help pages
- 24 (5 internal)
- Examples that run
- 100%7 run in a plain check
- Exported functions with examples
- 50%
- Documented parameters
- 97%
- Return-value docs
- 100%
- Help pages citing references
- 8% with a bibliography file
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- not measured
- Median days to close, 50 most recently updated closed PRs
- 0
Stars over time
Releases over time
PRs over time
Commits over time
10 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/macosso/csdm on 2026-10-25.
The R CMD check workflow runs on Linux and Windows
GitHub Pages site last deployed 2026-03-23 · The repository has a site deploy workflow
Show all practicesHide 2 practices
This repository shows signs of AI coding tools.
- GitHub Copilotfirst seen 2026-02-17Pull request: opened by its own accountCommits: 9 by its own account
- Copilot code reviewCommits: at least 10 accepting its review suggestions
Dependencies
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2026-02-20
- Total releases
- 3 / 1 yrs
- License
- GPL-3 OSI
- Minimum R
- ≥ 4.0.0
- Bundled data
- 53 KB / 1 file
- Download size
- 178 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("csdm")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.