Re: [R] kolmogorov-Smirnov critical values

2012-05-17 Thread aramos
Thank you all for your help!! !

Alex

--
View this message in context: 
http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630393.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread David Winsemius


On May 16, 2012, at 12:27 PM, aramos wrote:


Thanks, I've already done that!!


But the illustration for how you get the statistics is in the code.

Describe what you want: number of samples, two versus single sided,  
two sample versus comparing to theory, which table columns should be  
used. Then someone can probably help.






--
View this message in context: 
http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630276.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


David Winsemius, MD
West Hartford, CT

__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread R. Michael Weylandt
Open source software (what you're driving)

Michael

On Wed, May 16, 2012 at 12:27 PM, aramos  wrote:
> Thanks, I've already done that!!
> What is OSS?
>
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630276.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.

__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread aramos
Thanks, I've already done that!!
What is OSS?


--
View this message in context: 
http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630276.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread aramos
I think that command will give me the statistics observed value!! Not
quantiles from the k-s distribution!

--
View this message in context: 
http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245p4630275.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread Petr Savicky
On Wed, May 16, 2012 at 06:52:48AM -0700, aramos wrote:
> Hi!
> 
> Any one knows how to obtain critical values for the k-s statistic, using R?

Hi.

I do not know, whether there is a function for this. However, the following
randomized approach allows to extract a table of statistic/p.value pairs
from ks.test() for fixed sample sizes.

  n1 <- 30
  n2 <- 50
  d <- 1
  res <- matrix(nrow=d, ncol=2)
  for (i in seq.int(length=d)) {
  x1 <- runif(n1) + runif(1)
  x2 <- runif(n2) + runif(1)
  out <- ks.test(x1, x2)
  res[i, 1] <- out$statistic
  res[i, 2] <- out$p.value
  }
  tab <- unique(res[order(res[, 1]), ])
  colnames(tab) <- c("statistic", "p.val")

If you are mainly interested in the range of the p-values for relatively
close distributions, then replace

  x1 <- runif(n1) + runif(1)
  x2 <- runif(n2) + runif(1)

by

  x1 <- runif(n1)
  x2 <- runif(n2)

Part of the obtained table is

 statisticp.val
  
  [39,] 0.3000 5.642910e-02
  [40,] 0.3067 4.815638e-02
  [41,] 0.3133 4.091424e-02
  [42,] 0.3200 3.466530e-02
  [43,] 0.3267 2.925540e-02
  [44,] 0. 2.458672e-02
  [45,] 0.3400 2.060188e-02
  [46,] 0.3467 1.719140e-02
  [47,] 0.3533 1.428992e-02
  [48,] 0.3600 1.183727e-02
  [49,] 0.3667 9.767969e-03

Hope this helps.

Petr Savicky.

__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread Uwe Ligges

On 16.05.2012 15:52, aramos wrote:

Hi!

Any one knows how to obtain critical values for the k-s statistic, using R?


 ks.test(.)$statistic

Uwe ligges



Thanks,
Alex

--
View this message in context: 
http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245.html
Sent from the R help mailing list archive at Nabble.com.

__
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.


__
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.


Re: [R] kolmogorov-Smirnov critical values

2012-05-16 Thread R. Michael Weylandt
On Wed, May 16, 2012 at 9:52 AM, aramos  wrote:
> Hi!
>
> Any one knows how to obtain critical values for the k-s statistic, using R?
>

Take a look at ?ks.test and the code of ks.test to see how R does it.
OSS is super helpful for these sorts of things.

Michael

> Thanks,
> Alex
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> 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.

__
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.


[R] kolmogorov-Smirnov critical values

2012-05-16 Thread aramos
Hi!

Any one knows how to obtain critical values for the k-s statistic, using R?

Thanks,
Alex

--
View this message in context: 
http://r.789695.n4.nabble.com/kolmogorov-Smirnov-critical-values-tp4630245.html
Sent from the R help mailing list archive at Nabble.com.

__
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.