# What is the different between 2 codes for K-S test

What is different between these two codes and when can we use them

I use K-S test code in R to check normaliity for data that is generated from N(1,6) of size 5

#the first code is

x<-rnorm(5,1,6)

ks.test(x,"pnorm",1,6)

#the second code is
ks.test(x,"pnorm",mean(x),sd(x)) 

• The difference is 1,6 using the theoretical moments of the distribution versus mean(x),sd(x) using the empirical moments of the sample. Oct 17, 2021 at 13:33
• The most obvious thing to do* is run the code whence you would see that mean(x) is not 1 and sd(x) is not 6`. $\:\:$ *(certainly it would be something you should do before posting, since it would count under the required "search and research" that is mentioned in the help here) Oct 18, 2021 at 1:20