實務上取得之統計資料,無法確認資料之特徵與機率分佈。可先透過頻率分配 (Frequency Distribution)、累積相對頻率分配 (Cumulative Relative Frequency Distribution)、q-q plot (Quantile-Quantile Plot) 等方法進一步確認
ecdf 也是 R 繪製經驗累積分配函數的指令
x <- rnorm(50)
hist(x)
plot(ecdf(x), do.point=F, verticals=T) # 不要點,要垂直階梯
qqnorm(x)
qqline(x)
x <- rnorm(50,60,10)
hist(x)
plot(ecdf(x), do.point=F, verticals=T) # 不要點,要垂直階梯
qqnorm(x)
qqline(x)
x <- rbinom(100, 20 ,1/4)
hist(x)
plot(ecdf(x), do.point=F, verticals=T) # 不要點,要垂直階梯
qqnorm(x)
qqline(x)
x1 <- length(x[x[]< 5+1*sqrt(15/4)])-length(x[x[]< 5-1*sqrt(15/4)])
x2 <- length(x[x[]< 5+2*sqrt(15/4)])-length(x[x[]< 5-2*sqrt(15/4)])
x3 <- length(x[x[]< 5+3*sqrt(15/4)])-length(x[x[]< 5-3*sqrt(15/4)])
x1 / 100 * 100
## [1] 56
x2 / 100 * 100
## [1] 92
x3 / 100 * 100
## [1] 100