t="C:\\Users\\pc\\Downloads\\CAC NGHIEN CUU\\BAI GIANG CAC MON\\GS TUAN\\BG 12.6.19\\Hoa hau Vietnam.csv"
#reading data
hh=read.csv(t)
head(hh)
## Group Name Name.Viet City Region Crown.Year
## 1 Hoa Hau Bich Phuong B\235i BÍch Ph__ng Hanoi North 1988
## 2 Hoa Hau Dieu Hoa Nguy_n Di_u Hoa Hanoi North 1990
## 3 Hoa Hau Kieu Anh Hš Ki_u Anh Hanoi North 1992
## 4 Hoa Hau Thuy Thuy Nguy_n Thu Th_y Hanoi North 1995
## 5 Hoa Hau Thien Nga Nguy_n Thi\220n Nga Saigon South 1996
## 6 Hoa Hau Ngoc Khanh Nguy_n Th_ Ng_c Kh\210nh Saigon South 1998
## Year DoB Age Height Bust Waist Hip Weight
## 1 15/8/88 21/6/71 17.2 158 86 60 88 50
## 2 15/8/90 18/6/69 21.2 158 81 61 84 NA
## 3 15/8/92 7/7/76 16.1 169 85 62 87 NA
## 4 15/8/95 20/6/76 19.2 169 78 58 88 NA
## 5 15/8/96 25/6/75 21.2 170 87 64 92 NA
## 6 15/8/98 22/6/76 22.2 171 87 64 92 54
#coding
#analysis of data
library(ggplot2)
library(ggExtra)
## Warning: package 'ggExtra' was built under R version 3.5.3
library(ggthemes)
## Warning: package 'ggthemes' was built under R version 3.5.3
p=ggplot(data=hh,aes(x=Crown.Year, y=Height, fill=Group, col=Group))
p+geom_point()
p+geom_point()+geom_smooth(method="lm", formula = y~x+I(x^2))
p+theme_bw()
#so sanh chieu cao hoa hau va a hau
p=ggplot(data=hh,aes(x=Group, y=Height, fill=Group))
p+geom_boxplot()+geom_jitter(alpha= 0.3)+theme_economist()