#1
mlu_data <- readxl::read_excel("C:/Users/gram/OneDrive - 조선대학교[Chosun University]/바탕 화면/easy_r/mlu.xls", "mlu_timedur_freq_cds")
mlu_copy <- mlu_data
#2&3
unique_age_factors <- length(unique(mlu_data$age))
colnames(mlu_data)[colnames(mlu_data) == "utterances_mlu"] <- "utterances"
colnames(mlu_data)[colnames(mlu_data) == "words_mlu"] <- "words"
#4
mlu_data$mlu <- mlu_data$words / mlu_data$utterances
#5
mlu_summary <- summary(mlu_data$mlu)
print(mlu_summary)
## Min. 1st Qu. Median Mean 3rd Qu. Max.
## 1.730 2.447 2.745 2.696 2.916 3.476
#6&7
mlu_data$grade <- cut(mlu_data$mlu, breaks = 4, labels = c("D", "C", "B", "A"))
frequency_table <- table(mlu_data$age, mlu_data$mlu)
print(frequency_table)
##
## 1.72978723404255 2.05936920222635 2.13109243697479 2.20781527531083
## A0 1 1 1 1
## A1 0 0 0 0
## A2 0 0 0 0
##
## 2.20955882352941 2.2791519434629 2.35725938009788 2.40298507462687
## A0 0 1 0 0
## A1 1 0 1 1
## A2 0 0 0 0
##
## 2.42857142857143 2.46551724137931 2.54157303370787 2.61985815602837
## A0 0 0 0 1
## A1 1 0 1 0
## A2 0 1 0 0
##
## 2.63072776280323 2.63979848866499 2.66183574879227 2.68727272727273
## A0 1 0 0 0
## A1 0 1 1 0
## A2 0 0 0 1
##
## 2.69240196078431 2.74540682414698 2.75541795665635 2.79177057356608
## A0 0 0 0 1
## A1 1 1 0 0
## A2 0 0 1 0
##
## 2.80441176470588 2.81474820143885 2.81914893617021 2.8353982300885
## A0 0 0 1 1
## A1 1 0 0 0
## A2 0 1 0 0
##
## 2.84929577464789 2.90047393364929 2.93213296398892 2.97038327526132
## A0 0 1 0 1
## A1 0 0 0 0
## A2 1 0 1 0
##
## 2.98074074074074 3.02551020408163 3.02862254025045 3.18450704225352
## A0 0 0 0 0
## A1 0 0 1 0
## A2 1 1 0 1
##
## 3.34057971014493 3.35387323943662 3.47609147609148
## A0 0 0 0
## A1 0 0 0
## A2 1 1 1
#8
library(ggplot2)
qplot(x = age, y = mlu, data = mlu_data, geom = "boxplot")
## Warning: `qplot()` was deprecated in ggplot2 3.4.0.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.