## 1. Simulasi data
set.seed(123)
data <- rnorm(100, mean = 100, sd = 5)
# Menampilkan data
data
## [1] 97.19762 98.84911 107.79354 100.35254 100.64644 108.57532 102.30458
## [8] 93.67469 96.56574 97.77169 106.12041 101.79907 102.00386 100.55341
## [15] 97.22079 108.93457 102.48925 90.16691 103.50678 97.63604 94.66088
## [22] 98.91013 94.86998 96.35554 96.87480 91.56653 104.18894 100.76687
## [29] 94.30932 106.26907 102.13232 98.52464 104.47563 104.39067 104.10791
## [36] 103.44320 102.76959 99.69044 98.47019 98.09764 96.52647 98.96041
## [43] 93.67302 110.84478 106.03981 94.38446 97.98558 97.66672 103.89983
## [50] 99.58315 101.26659 99.85727 99.78565 106.84301 98.87115 107.58235
## [57] 92.25624 102.92307 100.61927 101.07971 101.89820 97.48838 98.33396
## [64] 94.90712 94.64104 101.51764 102.24105 100.26502 104.61134 110.25042
## [71] 97.54484 88.45416 105.02869 96.45400 96.55996 105.12786 98.57613
## [78] 93.89641 100.90652 99.30554 100.02882 101.92640 98.14670 103.22188
## [85] 98.89757 101.65891 105.48420 102.17591 98.37034 105.74404 104.96752
## [92] 102.74198 101.19366 96.86047 106.80326 96.99870 110.93666 107.66305
## [99] 98.82150 94.86790
## 2. Histogram dan Boxplot
hist(data, main = "Histogram Data", xlab = "Nilai", ylab = "Frekuensi")

boxplot(data, main = "Boxplot Data")

## 3. Mean dan Standar Deviasi
mean(data)
## [1] 100.452
sd(data)
## [1] 4.564079
## 4. Median dan IQR
median(data)
## [1] 100.3088
IQR(data)
## [1] 5.928367
## 5. Uji t (mu = 100)
t.test(data, mu = 100)
##
## One Sample t-test
##
## data: data
## t = 0.99041, df = 99, p-value = 0.3244
## alternative hypothesis: true mean is not equal to 100
## 95 percent confidence interval:
## 99.54642 101.35764
## sample estimates:
## mean of x
## 100.452
## 6. Uji t (mu = 90)
t.test(data, mu = 90)
##
## One Sample t-test
##
## data: data
## t = 22.901, df = 99, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 90
## 95 percent confidence interval:
## 99.54642 101.35764
## sample estimates:
## mean of x
## 100.452
## 7. Uji Wilcoxon
wilcox.test(data, mu = 100)
##
## Wilcoxon signed rank test with continuity correction
##
## data: data
## V = 2763, p-value = 0.4142
## alternative hypothesis: true location is not equal to 100
wilcox.test(data, mu = 90)
##
## Wilcoxon signed rank test with continuity correction
##
## data: data
## V = 5048, p-value < 2.2e-16
## alternative hypothesis: true location is not equal to 90