Bài tập ngày 1

Việc 1

Việc 2: cài đặt

ob = read.csv("/Users/thuy/Documents/00000000000 100  tập huấn NCKH/ngày 21-10/thầy Thạch/Obesity data.csv")
dim(ob)
## [1] 1217   13
head(ob)
##   id gender height weight  bmi age WBBMC wbbmd   fat  lean pcfat hypertension
## 1  1      F    150     49 21.8  53  1312  0.88 17802 28600  37.3            0
## 2  2      M    165     52 19.1  65  1309  0.84  8381 40229  16.8            1
## 3  3      F    157     57 23.1  64  1230  0.84 19221 36057  34.0            1
## 4  4      F    156     53 21.8  56  1171  0.80 17472 33094  33.8            1
## 5  5      M    160     51 19.9  54  1681  0.98  7336 40621  14.8            0
## 6  6      F    153     47 20.1  52  1358  0.91 14904 30068  32.2            1
##   diabetes
## 1        1
## 2        0
## 3        0
## 4        0
## 5        0
## 6        0
tail(ob)
##        id gender height weight  bmi age WBBMC wbbmd   fat  lean pcfat
## 1212 1222      F    153     50 21.4  59  1309  0.87 18328 29147  37.6
## 1213 1223      F    150     44 19.6  44  1474  0.95 12906 28534  30.1
## 1214 1224      F    148     51 23.3  58  1522  0.97 14938 33931  29.6
## 1215 1225      F    149     50 22.5  57  1409  0.93 16777 30598  34.4
## 1216 1226      F    144     49 23.6  67  1266  0.90 20094 27272  41.3
## 1217 1227      F    141     45 22.6  58  1228  0.91 14567 28111  33.2
##      hypertension diabetes
## 1212            1        0
## 1213            0        1
## 1214            0        0
## 1215            1        0
## 1216            1        0
## 1217            0        0
ob$obese[ob$bmi<18.5] = "Thiếu cân"
ob$obese[ob$bmi>=18.5 & ob$bmi<=25] = "Bình thường"
ob$obese[ob$bmi>25 & ob$bmi<30] = "thừa cân"
ob$obese[ob$bmi>=30] = "béo phì"

#Bài tập ngày 2 auther Thuyxd > ob = read.csv(“/Users/thuy/Documents/00000000000 100 tập huấn NCKH/ngày 21-10/thầy Thạch/Obesity data.csv”) > head(ob)

## Việc 2. Mô tả đặc điểm