# [R] Null and Alternate hypothesis for Significance test

Moshe Olshansky m_olshansky at yahoo.com
Fri Aug 22 02:40:02 CEST 2008

```Hi Nitin,

I believe that you can not have null hypothesis to be that A and B come from different distributions.
Asymptotically (as both sample sizes go to infinity) KS test has power 1, i.e. it will reject H0:A=B for any case where A and B have different distributions.
To work with a finite sample you must be more specific, i.e. your null hypothesis must be not that A and B just have different distributions but must be more specific, i.e that their means are different by at least something or that certain distance between their distributions is bigger than something, etc. and such hypotheses can be tested (and rejected).

--- On Fri, 22/8/08, Nitin Agrawal <NITINA.A+rhelp at gmail.com> wrote:

> From: Nitin Agrawal <NITINA.A+rhelp at gmail.com>
> Subject: [R] Null and Alternate hypothesis for Significance test
> To: r-help at r-project.org
> Received: Friday, 22 August, 2008, 6:58 AM
> Hi,
> I had a question about specifying the Null hypothesis in a
> significance
> test.
> or is a naive
> question.
>
> I have two samples A and B, and I want to test whether A
> and B come from
> the same distribution. The default Null hypothesis would be
> H0: A=B
> But since I am trying to prove that A and B indeed come
> from the same
> distribution, I think this is not the right choice for the
> null hypothesis
> (it should be one that is set up to be rejected)
>
> How do I specify a null hypothesis H0: A not equal to B for
> say a KS test.
> An example to do this in R would be greatly appreciated.
>
> On a related note: what is a good way to measure the
> difference between
> observed and expected PDFs? Is the D statistic of the KS
> test a good choice?
>
> Thanks!
> Nitin
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help