outreg2

Use of Compare command in Stata to compare variables

Oftentimes, we need to compare variables with each other in Stata. Stata’s compare command in Stata allows simple comparisons between variables to be made, which will be discussed further in this article. Download Example File The general syntax for this command is: compare variable1 variable2 [if] [in] After writing the command, the two variables to …

Use of Compare command in Stata to compare variables Read More »

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 »