library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(tidyr)
library(ggplot2)
## Warning: package 'ggplot2' was built under R version 4.3.2
library(summarytools)
library(moments)

# memanggil data
datauts = read.csv("C:/Users/Aqshal/Downloads/StudentsPerformance (1).csv")

# menambah total skor
total_score = datauts$math.score + datauts$reading.score + datauts$writing.score
datauts$total.score = as.numeric(total_score)
total_score
##    [1] 218 247 278 148 229 232 275 122 195 148 164 135 219 220 161 222 263  78
##   [19] 134 173 198 210 151 215 225 219 178 211 205 207 217 189 193 120 266 241
##   [37] 238 173 253 170 170 199 176 190 160 176 182 213 207 248 156 214 139 241
##   [55] 242 117 253 156 175  27 225 112 178 220 176 192 119 206 175 160 194 181
##   [73] 140 174 139 123  78 239 207 198 146 139 151 199 115 235 247 216 195 241
##   [91] 211  97 221 138 257 241 193 205 187 194 213 216 265 151 274 197 287 193
##  [109] 198 206 264 166 154 163 299 235 242 239 175 189 260 272 274 176 236 268
##  [127] 207 216 238 151 255 130 231 240 228 161 146 181 192 201 219 185 151 147
##  [145] 239  94 247 207 224 293 198 212 195 150 190 247 218 180 234 192 234 248
##  [163] 154 154 264 296 155 212 229 212 219 260 246 200 148 259 158 225 184 297
##  [181] 205 176 147 204 146 197 221 196 145 252 200 238 192 201 238 168 193 162
##  [199] 153 233 237 223 215 194 142 223 206 237 231 185 238  90 164 167 259 242
##  [217] 257 115 213 173 198 245 182 241 191 155 215 161 204 277 206 131 236 257
##  [235] 249 232 196 198 157 244 207 246 163 153 218 232 239 196 191 181 145 237
##  [253] 200 232 158 205 205 232 223 227 220 236 145 282 217 142 219 218 275 217
##  [271] 193 149 158 206 249 234 270 197 231 186 147 139 236 226 129 245 267 238
##  [289] 239 230 214 229 180 213 235 189 130 213 136 252 240 162 232 220 232 205
##  [307] 267 147 191 158 229 183 196 204 198 202 250 233 203 184 230 240 232 149
##  [325] 130 266 184  70 234 147 192 119 171 249 271 195 215 143  89 150 171 197
##  [343] 219 206 219 227 180 266 215 237 186 175 221 161 200 203 185 177 182 259
##  [361] 179 247 168  93 177 167 180 188 166 242 232 188 220 275 202 130 252 280
##  [379] 231 192 249 282 231 132 124 218 207 202 190 218 199 222 210 167 216 134
##  [397] 180 269 194 173 180 139 169 287 175 204 193 239 165 256 215 245 197 197
##  [415] 202 226 213 214 189 167 268 179 172 224 114 191 255 205 177 185 189 203
##  [433] 172 156 205 151 207 214 177 259 227 239 201 232 234 218 195 247 135 226
##  [451] 234 289 216 172 176 140 257 155 300 205 166 153 217 258 195 262  95 204
##  [469] 250 241 258 206 238 187 271 230 204 220 189 214 212 167 197 157 155 215
##  [487] 164 209 174 243 226 198 256 259 186 198 154 213 203 219 235 273 178 276
##  [505] 153 244 204 168 234 265 220 157 163 177 268 248 247 213 222 224 172 261
##  [523] 184 163 154 187 177 132 117 206 208 154 181 261 210 232 169 179 222 275
##  [541] 212 241 237 266 193 241 289 203 193 220 220 265 138 203 138 104 206 194
##  [559] 193 201 228 211 278 223 145 136 292 210 158 203 216 279 171 180 226 148
##  [577] 164 261 162 182 274 236 214 228 223 217 201 169 183 179 169 183 200 223
##  [595] 291 207  69 155 219 228 177  88 234 168 263 209 251 152 187 186 192 183
##  [613] 275 216 268 200 120 249 260 206 150 181 161 282 181 296 202 155 152 150
##  [631] 201 204 221 248 248 209 228 260 236 223 144 252 232 233 195 227 194 194
##  [649] 158 229 160 224 269 209 231 196 208 196 161 262 224 202 195 201 206 170
##  [667] 207 249 208 230 210 159 223 233 224 180 227 228 234 184 213 188 171 113
##  [685] 196 293 228 228 155 266 155 227 221 227 168 254 247 201 214 191 242 196
##  [703] 258 194 186 199 116 177 255 161 267 250 297 246 204 257 223 291 226 244
##  [721] 204 173 252 140 131 226 217 176 249 129 225 144 270 146 168 183 255 192
##  [739] 225 176 225 150 247 204 157 225 215 201 169 257 208 205 231 252 166 271
##  [757] 165 210 176 223 189 160 245 187 182 218 210 198 214 175 149 222 191 219
##  [775] 191 162 208 122 233 261 159 251 243 173 251 127 228  89 194 178 170 196
##  [793] 209 250 145 198 210 235 183 164 208 229 276 254 227 230 213 126 234 164
##  [811] 118 141 185 247 235 267 168 207 200 256 267 261 152 240 158 187 194 210
##  [829] 236 175 178 249 182 248 153 198 194 236 168 216 137 173 103 227 169 259
##  [847] 261 168 199 224 205 192 265 210 181 290 208 225 147 232 168 254 119 222
##  [865] 281 252 164 144 224 151 164 218 244 262 166 210 247 172 211 214 193 211
##  [883] 208 145 156 218 288 185 208 143 262 262 190 237 190 104  92 220 184 225
##  [901] 258 225 123 293 235 242 156 254 214 204 140 235 179 175 162 204 300 157
##  [919] 214 278 206 134 204 184 213 198 172 197 133 155 211 181 205 219 275 191
##  [937] 177 172 251 214 210 265 211 184 187 173 244 167 151 205 238 235 220 164
##  [955] 200 191 252 292 167 227 178 155 300 216 187 204 198 186 211 239 289 219
##  [973] 163 175 184 223 182 185 144 280  55 237 250 256 231 162 150 232 134 236
##  [991] 242 225 207 208 188 282 172 195 223 249
# menambahkan rata-rata
avg_score = (datauts$math.score + datauts$reading.score + datauts$writing.score)/3
datauts$avg.score = as.numeric(avg_score)
avg_score
##    [1]  72.66667  82.33333  92.66667  49.33333  76.33333  77.33333  91.66667
##    [8]  40.66667  65.00000  49.33333  54.66667  45.00000  73.00000  73.33333
##   [15]  53.66667  74.00000  87.66667  26.00000  44.66667  57.66667  66.00000
##   [22]  70.00000  50.33333  71.66667  75.00000  73.00000  59.33333  70.33333
##   [29]  68.33333  69.00000  72.33333  63.00000  64.33333  40.00000  88.66667
##   [36]  80.33333  79.33333  57.66667  84.33333  56.66667  56.66667  66.33333
##   [43]  58.66667  63.33333  53.33333  58.66667  60.66667  71.00000  69.00000
##   [50]  82.66667  52.00000  71.33333  46.33333  80.33333  80.66667  39.00000
##   [57]  84.33333  52.00000  58.33333   9.00000  75.00000  37.33333  59.33333
##   [64]  73.33333  58.66667  64.00000  39.66667  68.66667  58.33333  53.33333
##   [71]  64.66667  60.33333  46.66667  58.00000  46.33333  41.00000  26.00000
##   [78]  79.66667  69.00000  66.00000  48.66667  46.33333  50.33333  66.33333
##   [85]  38.33333  78.33333  82.33333  72.00000  65.00000  80.33333  70.33333
##   [92]  32.33333  73.66667  46.00000  85.66667  80.33333  64.33333  68.33333
##   [99]  62.33333  64.66667  71.00000  72.00000  88.33333  50.33333  91.33333
##  [106]  65.66667  95.66667  64.33333  66.00000  68.66667  88.00000  55.33333
##  [113]  51.33333  54.33333  99.66667  78.33333  80.66667  79.66667  58.33333
##  [120]  63.00000  86.66667  90.66667  91.33333  58.66667  78.66667  89.33333
##  [127]  69.00000  72.00000  79.33333  50.33333  85.00000  43.33333  77.00000
##  [134]  80.00000  76.00000  53.66667  48.66667  60.33333  64.00000  67.00000
##  [141]  73.00000  61.66667  50.33333  49.00000  79.66667  31.33333  82.33333
##  [148]  69.00000  74.66667  97.66667  66.00000  70.66667  65.00000  50.00000
##  [155]  63.33333  82.33333  72.66667  60.00000  78.00000  64.00000  78.00000
##  [162]  82.66667  51.33333  51.33333  88.00000  98.66667  51.66667  70.66667
##  [169]  76.33333  70.66667  73.00000  86.66667  82.00000  66.66667  49.33333
##  [176]  86.33333  52.66667  75.00000  61.33333  99.00000  68.33333  58.66667
##  [183]  49.00000  68.00000  48.66667  65.66667  73.66667  65.33333  48.33333
##  [190]  84.00000  66.66667  79.33333  64.00000  67.00000  79.33333  56.00000
##  [197]  64.33333  54.00000  51.00000  77.66667  79.00000  74.33333  71.66667
##  [204]  64.66667  47.33333  74.33333  68.66667  79.00000  77.00000  61.66667
##  [211]  79.33333  30.00000  54.66667  55.66667  86.33333  80.66667  85.66667
##  [218]  38.33333  71.00000  57.66667  66.00000  81.66667  60.66667  80.33333
##  [225]  63.66667  51.66667  71.66667  53.66667  68.00000  92.33333  68.66667
##  [232]  43.66667  78.66667  85.66667  83.00000  77.33333  65.33333  66.00000
##  [239]  52.33333  81.33333  69.00000  82.00000  54.33333  51.00000  72.66667
##  [246]  77.33333  79.66667  65.33333  63.66667  60.33333  48.33333  79.00000
##  [253]  66.66667  77.33333  52.66667  68.33333  68.33333  77.33333  74.33333
##  [260]  75.66667  73.33333  78.66667  48.33333  94.00000  72.33333  47.33333
##  [267]  73.00000  72.66667  91.66667  72.33333  64.33333  49.66667  52.66667
##  [274]  68.66667  83.00000  78.00000  90.00000  65.66667  77.00000  62.00000
##  [281]  49.00000  46.33333  78.66667  75.33333  43.00000  81.66667  89.00000
##  [288]  79.33333  79.66667  76.66667  71.33333  76.33333  60.00000  71.00000
##  [295]  78.33333  63.00000  43.33333  71.00000  45.33333  84.00000  80.00000
##  [302]  54.00000  77.33333  73.33333  77.33333  68.33333  89.00000  49.00000
##  [309]  63.66667  52.66667  76.33333  61.00000  65.33333  68.00000  66.00000
##  [316]  67.33333  83.33333  77.66667  67.66667  61.33333  76.66667  80.00000
##  [323]  77.33333  49.66667  43.33333  88.66667  61.33333  23.33333  78.00000
##  [330]  49.00000  64.00000  39.66667  57.00000  83.00000  90.33333  65.00000
##  [337]  71.66667  47.66667  29.66667  50.00000  57.00000  65.66667  73.00000
##  [344]  68.66667  73.00000  75.66667  60.00000  88.66667  71.66667  79.00000
##  [351]  62.00000  58.33333  73.66667  53.66667  66.66667  67.66667  61.66667
##  [358]  59.00000  60.66667  86.33333  59.66667  82.33333  56.00000  31.00000
##  [365]  59.00000  55.66667  60.00000  62.66667  55.33333  80.66667  77.33333
##  [372]  62.66667  73.33333  91.66667  67.33333  43.33333  84.00000  93.33333
##  [379]  77.00000  64.00000  83.00000  94.00000  77.00000  44.00000  41.33333
##  [386]  72.66667  69.00000  67.33333  63.33333  72.66667  66.33333  74.00000
##  [393]  70.00000  55.66667  72.00000  44.66667  60.00000  89.66667  64.66667
##  [400]  57.66667  60.00000  46.33333  56.33333  95.66667  58.33333  68.00000
##  [407]  64.33333  79.66667  55.00000  85.33333  71.66667  81.66667  65.66667
##  [414]  65.66667  67.33333  75.33333  71.00000  71.33333  63.00000  55.66667
##  [421]  89.33333  59.66667  57.33333  74.66667  38.00000  63.66667  85.00000
##  [428]  68.33333  59.00000  61.66667  63.00000  67.66667  57.33333  52.00000
##  [435]  68.33333  50.33333  69.00000  71.33333  59.00000  86.33333  75.66667
##  [442]  79.66667  67.00000  77.33333  78.00000  72.66667  65.00000  82.33333
##  [449]  45.00000  75.33333  78.00000  96.33333  72.00000  57.33333  58.66667
##  [456]  46.66667  85.66667  51.66667 100.00000  68.33333  55.33333  51.00000
##  [463]  72.33333  86.00000  65.00000  87.33333  31.66667  68.00000  83.33333
##  [470]  80.33333  86.00000  68.66667  79.33333  62.33333  90.33333  76.66667
##  [477]  68.00000  73.33333  63.00000  71.33333  70.66667  55.66667  65.66667
##  [484]  52.33333  51.66667  71.66667  54.66667  69.66667  58.00000  81.00000
##  [491]  75.33333  66.00000  85.33333  86.33333  62.00000  66.00000  51.33333
##  [498]  71.00000  67.66667  73.00000  78.33333  91.00000  59.33333  92.00000
##  [505]  51.00000  81.33333  68.00000  56.00000  78.00000  88.33333  73.33333
##  [512]  52.33333  54.33333  59.00000  89.33333  82.66667  82.33333  71.00000
##  [519]  74.00000  74.66667  57.33333  87.00000  61.33333  54.33333  51.33333
##  [526]  62.33333  59.00000  44.00000  39.00000  68.66667  69.33333  51.33333
##  [533]  60.33333  87.00000  70.00000  77.33333  56.33333  59.66667  74.00000
##  [540]  91.66667  70.66667  80.33333  79.00000  88.66667  64.33333  80.33333
##  [547]  96.33333  67.66667  64.33333  73.33333  73.33333  88.33333  46.00000
##  [554]  67.66667  46.00000  34.66667  68.66667  64.66667  64.33333  67.00000
##  [561]  76.00000  70.33333  92.66667  74.33333  48.33333  45.33333  97.33333
##  [568]  70.00000  52.66667  67.66667  72.00000  93.00000  57.00000  60.00000
##  [575]  75.33333  49.33333  54.66667  87.00000  54.00000  60.66667  91.33333
##  [582]  78.66667  71.33333  76.00000  74.33333  72.33333  67.00000  56.33333
##  [589]  61.00000  59.66667  56.33333  61.00000  66.66667  74.33333  97.00000
##  [596]  69.00000  23.00000  51.66667  73.00000  76.00000  59.00000  29.33333
##  [603]  78.00000  56.00000  87.66667  69.66667  83.66667  50.66667  62.33333
##  [610]  62.00000  64.00000  61.00000  91.66667  72.00000  89.33333  66.66667
##  [617]  40.00000  83.00000  86.66667  68.66667  50.00000  60.33333  53.66667
##  [624]  94.00000  60.33333  98.66667  67.33333  51.66667  50.66667  50.00000
##  [631]  67.00000  68.00000  73.66667  82.66667  82.66667  69.66667  76.00000
##  [638]  86.66667  78.66667  74.33333  48.00000  84.00000  77.33333  77.66667
##  [645]  65.00000  75.66667  64.66667  64.66667  52.66667  76.33333  53.33333
##  [652]  74.66667  89.66667  69.66667  77.00000  65.33333  69.33333  65.33333
##  [659]  53.66667  87.33333  74.66667  67.33333  65.00000  67.00000  68.66667
##  [666]  56.66667  69.00000  83.00000  69.33333  76.66667  70.00000  53.00000
##  [673]  74.33333  77.66667  74.66667  60.00000  75.66667  76.00000  78.00000
##  [680]  61.33333  71.00000  62.66667  57.00000  37.66667  65.33333  97.66667
##  [687]  76.00000  76.00000  51.66667  88.66667  51.66667  75.66667  73.66667
##  [694]  75.66667  56.00000  84.66667  82.33333  67.00000  71.33333  63.66667
##  [701]  80.66667  65.33333  86.00000  64.66667  62.00000  66.33333  38.66667
##  [708]  59.00000  85.00000  53.66667  89.00000  83.33333  99.00000  82.00000
##  [715]  68.00000  85.66667  74.33333  97.00000  75.33333  81.33333  68.00000
##  [722]  57.66667  84.00000  46.66667  43.66667  75.33333  72.33333  58.66667
##  [729]  83.00000  43.00000  75.00000  48.00000  90.00000  48.66667  56.00000
##  [736]  61.00000  85.00000  64.00000  75.00000  58.66667  75.00000  50.00000
##  [743]  82.33333  68.00000  52.33333  75.00000  71.66667  67.00000  56.33333
##  [750]  85.66667  69.33333  68.33333  77.00000  84.00000  55.33333  90.33333
##  [757]  55.00000  70.00000  58.66667  74.33333  63.00000  53.33333  81.66667
##  [764]  62.33333  60.66667  72.66667  70.00000  66.00000  71.33333  58.33333
##  [771]  49.66667  74.00000  63.66667  73.00000  63.66667  54.00000  69.33333
##  [778]  40.66667  77.66667  87.00000  53.00000  83.66667  81.00000  57.66667
##  [785]  83.66667  42.33333  76.00000  29.66667  64.66667  59.33333  56.66667
##  [792]  65.33333  69.66667  83.33333  48.33333  66.00000  70.00000  78.33333
##  [799]  61.00000  54.66667  69.33333  76.33333  92.00000  84.66667  75.66667
##  [806]  76.66667  71.00000  42.00000  78.00000  54.66667  39.33333  47.00000
##  [813]  61.66667  82.33333  78.33333  89.00000  56.00000  69.00000  66.66667
##  [820]  85.33333  89.00000  87.00000  50.66667  80.00000  52.66667  62.33333
##  [827]  64.66667  70.00000  78.66667  58.33333  59.33333  83.00000  60.66667
##  [834]  82.66667  51.00000  66.00000  64.66667  78.66667  56.00000  72.00000
##  [841]  45.66667  57.66667  34.33333  75.66667  56.33333  86.33333  87.00000
##  [848]  56.00000  66.33333  74.66667  68.33333  64.00000  88.33333  70.00000
##  [855]  60.33333  96.66667  69.33333  75.00000  49.00000  77.33333  56.00000
##  [862]  84.66667  39.66667  74.00000  93.66667  84.00000  54.66667  48.00000
##  [869]  74.66667  50.33333  54.66667  72.66667  81.33333  87.33333  55.33333
##  [876]  70.00000  82.33333  57.33333  70.33333  71.33333  64.33333  70.33333
##  [883]  69.33333  48.33333  52.00000  72.66667  96.00000  61.66667  69.33333
##  [890]  47.66667  87.33333  87.33333  63.33333  79.00000  63.33333  34.66667
##  [897]  30.66667  73.33333  61.33333  75.00000  86.00000  75.00000  41.00000
##  [904]  97.66667  78.33333  80.66667  52.00000  84.66667  71.33333  68.00000
##  [911]  46.66667  78.33333  59.66667  58.33333  54.00000  68.00000 100.00000
##  [918]  52.33333  71.33333  92.66667  68.66667  44.66667  68.00000  61.33333
##  [925]  71.00000  66.00000  57.33333  65.66667  44.33333  51.66667  70.33333
##  [932]  60.33333  68.33333  73.00000  91.66667  63.66667  59.00000  57.33333
##  [939]  83.66667  71.33333  70.00000  88.33333  70.33333  61.33333  62.33333
##  [946]  57.66667  81.33333  55.66667  50.33333  68.33333  79.33333  78.33333
##  [953]  73.33333  54.66667  66.66667  63.66667  84.00000  97.33333  55.66667
##  [960]  75.66667  59.33333  51.66667 100.00000  72.00000  62.33333  68.00000
##  [967]  66.00000  62.00000  70.33333  79.66667  96.33333  73.00000  54.33333
##  [974]  58.33333  61.33333  74.33333  60.66667  61.66667  48.00000  93.33333
##  [981]  18.33333  79.00000  83.33333  85.33333  77.00000  54.00000  50.00000
##  [988]  77.33333  44.66667  78.66667  80.66667  75.00000  69.00000  69.33333
##  [995]  62.66667  94.00000  57.33333  65.00000  74.33333  83.00000
# skewness dan kurtosis math
skewness_math = skewness(datauts$math.score)
kurtosis_math = kurtosis(datauts$math.score)
skewness_math
## [1] -0.2785166
kurtosis_math
## [1] 3.267597
# skewness dan kurtosis reading
skewness_reading = skewness(datauts$reading.score)
kurtosis_reading = kurtosis(datauts$reading.score)
skewness_reading
## [1] -0.2587157
kurtosis_reading
## [1] 2.926081
# skewness dan kurtosis writing
skewness_writing = skewness(datauts$writing.score)
kurtosis_writing = kurtosis(datauts$writing.score)
skewness_writing
## [1] -0.2890096
kurtosis_writing
## [1] 2.960808
# piechart gender
frekuensi_gender = datauts %>%
  count(gender)
persentase_gender = frekuensi_gender %>%
  mutate(persentase = n / sum(n) * 100)
labels = paste(persentase_gender$gender, "\n", round(persentase_gender$persentase, 1), "%", sep = "")
pie(persentase_gender$persentase, labels = labels, 
    col = rainbow(nrow(persentase_gender)), main = "Persentase Gender")

# piechart race.ethnicity
frekuensi_ras = datauts %>%
  count(race.ethnicity)
persentase_ras = frekuensi_ras %>%
  mutate(persentase = n / sum(n) * 100)
labels = paste(persentase_ras$race.ethnicity, "\n", round(persentase_ras$persentase, 1), "%", sep = "")
pie(persentase_ras$persentase, labels = labels, 
    col = rainbow(nrow(persentase_ras)), main = "Persentase race.ethnicity")

# piechart parental.level.of.education
frekuensi_parental = datauts %>%
  count(parental.level.of.education)
persentase_parental = frekuensi_parental %>%
  mutate(persentase = n / sum(n) * 100)
labels = paste(persentase_parental$parental.level.of.education, "\n", round(persentase_parental$persentase, 1), "%", sep = "")
pie(persentase_parental$persentase, labels = labels, 
    col = rainbow(nrow(persentase_parental)), main = "Persentase parental.level.of.education")

# membuat boxplot math
ggplot(datauts, aes(x = parental.level.of.education, y = math.score, fill = gender)) +
  geom_boxplot() +
  labs(title = "Scores by Parental Education Level and Gender",
       x = "Parental Level of Education",
       y = "Scores") +
  scale_fill_manual(values = c("male" = "skyblue", "female" = "pink"))

# interpretasi : median male selalu lebih tinggi dari female, nilai maksimum diperoleh pada parental di master's degree. Terdapat 13 data outlier.



# membuat boxplot writing
ggplot(datauts, aes(x = parental.level.of.education, y = writing.score, fill = gender)) +
  geom_boxplot() +
  labs(title = "Scores by Parental Education Level and Gender",
       x = "Parental Level of Education",
       y = "Scores") +
  scale_fill_manual(values = c("male" = "blue", "female" = "red"))

# interpretasi : median female selalu lebih tinggi dari male, nilai maksimum diperoleh pada parental di master's degree. Terdapat 9 data outlier.



# membuat boxplot reading
ggplot(datauts, aes(x = parental.level.of.education, y = reading.score, fill = gender)) +
  geom_boxplot() +
  labs(title = "Scores by Parental Education Level and Gender",
       x = "Parental Level of Education",
       y = "Scores") +
  scale_fill_manual(values = c("male" = "green", "female" = "yellow"))

# interpretasi : median female selalu lebih tinggi dari male, nilai maksimum diperoleh pada parental di master's degree. Terdapat 10 data outlier.

# membuat scatter plot
x1 = datauts$math.score
x2 = datauts$reading.score
x3 = datauts$writing.score

kucing = data.frame(x1,x2,x3)
ggplot(kucing, aes(x=x1 , y=x2))+
  geom_point(color="blue", size =4) +
  geom_point( aes(x=x1 , y=x3), color="green",size= 4) +
  geom_point( aes(x=x2 , y=x3), color="red",size= 4)+
  labs (x = "Math", y = "Reading and writing")+
  ggtitle("Scatter Plot Scores")

# interpretasi : perolehan skor math, reading, writing mempunyai persebaran data yang mirip dimana hubungan yang persebaran datanya paling bagus adalah warna merah ya itu antara variabel x2(reading)dan x1(writing), jadi bisa dikatakan bahwa skor math, reading, writing saling berhubungan dimana semakin tinggi skor math sebanding juga dengan skor reading dan writing 

#diagram batang
x1 = datauts$parental.level.of.education
x2 = datauts$total.score
x3 = datauts$gender
ayam = data.frame(x1,x2,x3)
ggplot(datauts, aes(x=x1,y=x2,fill=x3))+
  geom_bar(stat = "identity")+
  labs(title="Diagram Batang",x=x1,y=x2)

summary(datauts)
##     gender          race.ethnicity     parental.level.of.education
##  Length:1000        Length:1000        Length:1000                
##  Class :character   Class :character   Class :character           
##  Mode  :character   Mode  :character   Mode  :character           
##                                                                   
##                                                                   
##                                                                   
##     lunch           test.preparation.course   math.score     reading.score   
##  Length:1000        Length:1000             Min.   :  0.00   Min.   : 17.00  
##  Class :character   Class :character        1st Qu.: 57.00   1st Qu.: 59.00  
##  Mode  :character   Mode  :character        Median : 66.00   Median : 70.00  
##                                             Mean   : 66.09   Mean   : 69.17  
##                                             3rd Qu.: 77.00   3rd Qu.: 79.00  
##                                             Max.   :100.00   Max.   :100.00  
##  writing.score     total.score      avg.score     
##  Min.   : 10.00   Min.   : 27.0   Min.   :  9.00  
##  1st Qu.: 57.75   1st Qu.:175.0   1st Qu.: 58.33  
##  Median : 69.00   Median :205.0   Median : 68.33  
##  Mean   : 68.05   Mean   :203.3   Mean   : 67.77  
##  3rd Qu.: 79.00   3rd Qu.:233.0   3rd Qu.: 77.67  
##  Max.   :100.00   Max.   :300.0   Max.   :100.00