Hi, I have two sets of data, an observed data and generated data. The generated data is obtained from the model where the parameters is estimated from the observed data.
So I'm not sure which to use either one-sample test ks.test(x+2, "pgamma", 3, 2) # two-sided, exact or two-sample test ks.test(x, x2, alternative="l") If I use the one-sample test I need to specified the model which I don't have in my case. Actually I use the two-sample test and when I compare with what I got from using Chi-square test the result is too different. Data: obs_data pre_gam [1,] 93 25.6770 [2,] 115 127.9095 [3,] 125 151.6845 [4,] 120 146.9295 [5,] 106 107.9385 [6,] 101 107.4630 [7,] 75 86.5410 [8,] 58 55.6335 [9,] 46 43.7460 [10,] 38 32.8095 [11,] 31 16.1670 [12,] 17 18.5445 [13,] 10 9.0345 [14,] 16 20.9220 Results: > chisq.test(obs_data, p = pre_gam, rescale.p = TRUE) Chi-squared test for given probabilities data: obs_data X-squared = 205.4477, df = 13, p-value < 2.2e-16 > ks.test(obs_data,pre_gam) Two-sample Kolmogorov-Smirnov test data: obs_data and pre_gam D = 0.2143, p-value = 0.9205 alternative hypothesis: two-sided Am I doing the right thing? Thank you so much for your help. [[alternative HTML version deleted]]
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.