stata

Aggregate Data by Group using Collapse command in Stata

The collapse command in Stata is used to aggregate a dataset by collapsing it based on some summary statistics of a variable like mean, sum, median, percentile, standard error etc. To understand how a variable can be aggregated, let’s start by loading Stata’s built-in NLSW (1988) dataset. Download Example File sysuse nlsw88, clear We will …

Aggregate Data by Group using Collapse command in Stata Read More »

Nested Regression OR Hierarchical Regression in Stata

This article will go over how nested or hierarchical regressions are used in Stata. In many published academic papers, we see a single table representing results from various regression models run by the authors. Often, each subsequent regression adds one new variable to the list of covariates that an outcome variable is being regressed on. …

Nested Regression OR Hierarchical Regression in Stata Read More »