[EpiData-list] BoxPlot with 3 variables

epidata-list at lists.umanitoba.ca epidata-list at lists.umanitoba.ca
Wed Mar 23 05:25:42 CDT 2011


> Dear EpiData users,
> How to make a Boxplot when I have one
quantitative variable and two qualitatives variablesThanks


say you have: age and wish to look at this by sex and
social class 

Variables: age sex rank 

strategy one: 

box age /by=sex
/Ti="Age among those with low social class" if rank = 1
box age /by=sex
/Ti="Age among those with high social class" if rank = 2 

strategy two:

gen i level = 0
if (sex = 1) and (rank = 1) then level = 1
if (sex =
1) and (rank = 2) then level = 2
if (sex = 2) and (rank = 1) then level
= 3
if (sex = 2) and (rank = 2) then level = 4
labelvalue level
/O="Missing information" /1="Male low" /2="Male High" /3="Female Low"
/4="Female High" 

box age /by=level /ti="Boxplot of age by sex and
social class"
box age /by=level /ti="Boxplot of age by sex and social
class" if level > 0


Jens Lauritsen 

EpiData Association 

More information about the EpiData-list mailing list