Introductory Stata 38: Graphs For Single Continuous Variable (Box plot)
Автор: Dr. Bob Wen (Stata, Economics, Econometrics)
Загружено: 2022-02-17
Просмотров: 443
The box plot highlights several statistics of the distribution of a single continuous variable. The median is the line inside the box. The 25 percentile and the 75 percentile are at the edge of the box. At the end of the whiskers are the minimum or maximum values. But if there are outliers in the data, it would be the adjacent value. It is 1.5 times the interquartile range away from the edge of the box.
Let's continue to use the dataset for the US workers. You can download it from the link below.
https://drive.google.com/file/d/1kAve...
#Boxplot #IntroductoryStata
***************
*38. Box Plot *
***************
capture log close
log using box.log, text replace
set showbaselevels on
*Use the dataset I created for US workers
use "https://134997773-924437014403349320....", clear
describe
summarize
*Boxplots
graph box hwage
graph box hwage, nooutsides
graph hbox hwage, nooutsides
*Boxplots over groups
recode schooling (0/11=1) (12=2) (13/15=3) (16/17=4), generate(educ)
tabulate educ
label define educlabel 1 "Not HS" 2 "HS Grad" 3 "Some Coll" 4 "Coll Grad"
label values educ educlabel
graph box hwage, over(educ) nooutsides
generate hwage0=hwage if gender==0
generate hwage1=hwage if gender==1
graph box hwage0 hwage1, over(educ) nooutsides legend(label (1 "Female") label (2 "Male"))
*Histogram with Boxplot
histogram hwage, saving(his.gph, replace)
graph hbox hwage,saving(box.gph,replace)
graph combine his.gph box.gph, col(1)
log close
Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: