Font Size:
A Stata implementation of cluster weighted models: the cwmglm package
Last modified: 2023-06-14
Abstract
The Cluster-Weighted Model (CWM) is a member of the family of the Mixtures of Regression Models and it is referred as Mixture of Regression with Random Covariates. Currently, software for estimating these models is R package flexcwm. The aim of this article is to introduce a new software component, the Stata package cwmglm which allows to estimate CWMs based on the most common generalized linear models. Our software extends to Stata users the possibility of estimating parsimonious models of Gaussian distributions with alternative specifications of the variance matrix. Cwmglm also calculates the the generalized coefficients of determination and bootstrap standard errors that are not currently available in flexcwm. We illustrate the use of cwmglm with real data on Covid-19 admissions.