147k views
1 vote
Lets say you had a dataset with two variabels age and sex. Write the stata code to get summary statistics on age. Write the stata code to get summary statistics on sex. Now, lets say you wanted to look at a boxplot of age but you wanted to compare women and men using the boxplot fuction. Write the stata code to generate a boxplot of the age variable, stratified by sex.

1 Answer

7 votes

Answer:

age.info()

sex.info()

df.boxplot(by ='age', column =['sex'], grid = False)

Explanation:use info() for strata statistics and the boxplot() with relevant arguments

User Haya
by
4.5k points