반응형
[R 통계분석] Kolmogorov-sminov test (정규성검정)
#1. 방법
ks.test(x, y, ...,
alternative = c("two.sided", "less", "greater"),
exact = NULL)
x 자리에 데이터, y자리에 pnorm 입력.
#2. 예제
> 코드
#표본생성
set.seed(1)
group1=rnorm(50,0,1)
#ks test 수행
ks.test(group1,pnorm)
> 실행결과
> ks.test(group1,pnorm)
One-sample Kolmogorov-Smirnov test
data: group1
D = 0.13466, p-value = 0.2974
alternative hypothesis: two-sided
One-sample Kolmogorov-Smirnov test
data: group1
D = 0.13466, p-value = 0.2974
alternative hypothesis: two-sided
반응형
댓글