I have a dataset that has a categorical variable(eg: crops) and continuous variables (e.g: yield, price,input costs). I want to summarize the continuous by each category of crop.
I currently use the below command
label define crops 1"Paddy" 2"Wheat" 3"Vegetables" 4"Trees"
label values crops crops
levelsof crop,local (crop)
foreach i in `crop'{
asdoc sum yield, ///
stat(N mean median min max iqr p25 p75 ) ///
label append save(DistributionsMainOutcomes_`today'.doc) ///
title( Yield: crop`i')
asdoc sum price, ///
stat(N mean median min max iqr p25 p75 ) ///
label append save(DistributionsMainOutcomes_`today'.doc) ///
title( Price: crop`i')```
The problem is the tables generated do not have the name of the crops, they just contain the code of the crops from the variable. Any help on how to get value labels on the table title?