Stata Class Activity
Stata Class Activity
3. Visualize results.
a. Construct a single graph showing boxplots of wage for each of the grade4
categories. Moreover, there should be two sets of boxplots to compare the wages
of those who live in the South and those who do not. Hint: look for the
“group_options” in the boxplot command. Your graph should have the following
characteristics:
i. Boxplots should be horizontal, that is, wage should be on x-axis.
ii. Treat grade4 as the y-variable. Hint: Lookup “asyvars”.
iii. The legend should have value labels for each level of grade4.
iv. The markers for extreme values of wages for those without high school
education should be large hollow circles, that is, they should have a large
size and the symbol should be a hollow circle. Hint: Look up “marker”
Export the graph as a png file and paste it below. [5 marks]
b. Make a single graph of boxplots showing wages of different occupations.
Moreover, your graph should have two sets of boxplots to compare those who
completed college with those who did not. Using the collgrad variable, your graph
should have the following characteristics:
i. The bars are vertical and have a color intensity of 40 percent.
ii. The y-axis is on the right-hand side.
iii. The y-axis scale runs from 5 to 45.
iv. The markers for extreme values of wages should be very large and as
follows: Management (hollow triangles), Sales (hollow circles),
Clerical/Unskilled (hollow diamonds)
v. The boxplot for professionals has a thick black line containing a white fill.
vi. The legend is stacked in two rows above the boxplots.
vii. There is no grid showing in the background of the boxplots.
viii. The legend has corrected labels for Professional and Management
categories. [10 marks]
Note: The final output is pasted below but you need to write the code to produce it
in STATA. Paste your graph below for comparison.
4. Replicate
a. Create a fully functional DO file of all the commands used in this exercise. Your
DO file should include group number, names of members, date, title, and
comments for each command so that it can be easily read by others. [4 marks]
Have fun!