[R] kstest vs shapirotest
    "Sibylle Stöckli" 
    sibylle.stoeckli at gmx.ch
       
    Wed Sep 22 14:32:11 CEST 2010
    
    
  
Dear R-users
Idea: 
Analysing tree height frequency with hist(), normal distribution (ks.test & shapiro.test) and skewness (package e1071 - thanks a lot for this useful package)as an indication of possible self-thinning in an experimental tree stand.
Problem: 
Results from the ks.test and the shapiro.test are not comparable (see example of both tests). Tree height is a nice continuous variable. Sample size is around n= 250-350. Does anybode know about a problem in ks tests using a large sample size and working with subsets (e.g file[,])? Comparing tests with qqplots, I would appreciate shapiro, but I am wondering about the results from ks (test ist not very sensitive, D=1, p=2.2e-16 many times?
Thanks
Sibylle
> shapiro.test(Biotree[Ac,]$Height2008)
	Shapiro-Wilk normality test
data:  Biotree[Ac, ]$Height2008 
W = 0.9908, p-value = 0.05175
> ks.test(Biotree[Ac,]$Height2008, "pnorm")
	One-sample Kolmogorov-Smirnov test
data:  Biotree[Ac, ]$Height2008 
D = 1, p-value < 2.2e-16
alternative hypothesis: two-sided 
Warning message:
In ks.test(Biotree[Ac, ]$Height2008, "pnorm") :
  cannot compute correct p-values with ties
--
    
    
More information about the R-help
mailing list