Hi everyone
I have two variables:
1. Nutritional status (clas_nut) with the categories 1. underweight, 2. normal, 3. overweight and 4. obese.
2. Age_group (final_age) with the categories 1.18-34 years, 2.35-54 years and, 3.55 years or more.
I am trying to make a separate bar chart by age group, then using the combine command put together the graphs by age plus a graph of the nutritional status for the total population. The problem I have is that for the age groups 18-34 and 35-54 I have no underweight subjects, so I only get three bars.
How can I make the space and the underweight category appear in both graphs?
I have two variables:
1. Nutritional status (clas_nut) with the categories 1. underweight, 2. normal, 3. overweight and 4. obese.
2. Age_group (final_age) with the categories 1.18-34 years, 2.35-54 years and, 3.55 years or more.
I am trying to make a separate bar chart by age group, then using the combine command put together the graphs by age plus a graph of the nutritional status for the total population. The problem I have is that for the age groups 18-34 and 35-54 I have no underweight subjects, so I only get three bars.
How can I make the space and the underweight category appear in both graphs?
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float(clas_nut edad_final) 3 1 3 3 3 1 3 1 4 1 4 3 2 3 2 3 2 3 4 2 2 1 4 3 3 3 3 2 3 1 2 1 2 1 2 1 3 1 4 2 4 1 4 2 2 3 3 2 2 2 3 1 2 3 4 3 4 1 4 2 4 2 2 1 4 1 3 3 4 1 1 3 3 1 4 1 3 2 4 2 4 3 3 2 3 3 3 2 2 3 3 3 4 2 2 2 4 2 2 1 4 3 4 2 3 2 4 2 4 2 3 1 4 3 3 2 4 2 4 2 3 2 4 2 4 1 2 3 3 3 3 2 3 2 4 1 3 2 4 3 4 3 3 2 4 3 4 2 4 2 4 2 4 2 4 2 4 3 3 3 4 3 3 1 3 2 3 1 3 2 3 1 4 2 4 1 3 3 4 2 4 2 3 2 3 1 3 1 3 2 4 3 3 2 3 1 4 2 4 3 end label values clas_nut clas label def clas 1 "Bajo Peso", modify label def clas 2 "Normal", modify label def clas 3 "Sobrepeso", modify label def clas 4 "Obeso", modify label values edad_final eda label def eda 1 "18-34 años", modify label def eda 2 "35-54 años", modify label def eda 3 "55 años o más", modify
Comment