[R] Normal distribution

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Feb 3 15:41:23 CET 2004


Laurent Houdusse <l.houdusse at cerep.fr> writes:

> I try to use ks.test to determine a normal distribution:
> 
> x<-c(11.5,27.9,9,10.7,30.0,9.5,14.2,14,9.4,6.1)
> ks.test(x,function(x) pnorm(x,mean=mean(x),sd=sd(x)))
> 
> Is it a correct method?
> I verify with SigmaStat, the D value is the same but the p-value is
> different, Why??
> SigmaStat p-value=0.01      R p-value=0.3234
> 
> Thanks for your help!

ks.test works for comparison with a fixed distribution, and you are
plugging in estimated parameters. This makes the test highly
conservative. SigmaStat presumably uses a correction term. 

Anyway shapiro.test() would be a more obvious choice in my opinion.

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)             FAX: (+45) 35327907




More information about the R-help mailing list