Skip to main content

solow_gee/
lib.rs

1//! # solow-gee
2//!
3//! Generalized estimating equations (GEE) for clustered / longitudinal data.
4//! Mean parameters are estimated by Fisher scoring on the estimating
5//! equations under a *working* within-cluster correlation ([`CovStruct`]);
6//! inference uses the cluster-robust sandwich covariance (with a model-based
7//! "naive" covariance also exposed).  Supports the Gaussian, Poisson, and
8//! Binomial families with Independence and Exchangeable working correlation.
9//! Validated against an authoritative reference.
10//!
11//! ```
12//! use ndarray::array;
13//! use solow_gee::{CovStruct, Gee};
14//! use solow_glm::Family;
15//!
16//! let x = array![
17//!     [1.0, 0.0], [1.0, 1.0], [1.0, 2.0],
18//!     [1.0, 3.0], [1.0, 4.0], [1.0, 5.0],
19//! ];
20//! let y = array![1.0, 2.0, 3.0, 5.0, 8.0, 13.0];
21//! let groups = [0i64, 0, 1, 1, 2, 2];
22//! let res = Gee::new(y, x, &groups, Family::Poisson, CovStruct::Exchangeable)
23//!     .unwrap()
24//!     .fit()
25//!     .unwrap();
26//! assert!(res.converged);
27//! ```
28
29mod categorical;
30mod gee;
31
32pub use categorical::{CategoricalCov, CategoricalGeeResults, NominalGee, OrdinalGee};
33pub use gee::{CovStruct, Gee, GeeResults};