[R] null in rao.test in R

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Sat Mar 11 15:44:20 CET 2023


On 11/03/2023 9:21 a.m., Nick Wray wrote:
> Hello  I am testing for the homogeneity of clusters of (yearly) seasonal
> data using the rao.test from the circular package.  I can't find anywhere
> (including the Cran pages) which specifically mentions the null hypothesis
> for this test.  Playing around with it, for example using say the toy code
> beneath it would seem that the null is that the data sets tested are not
> homogenous, which is fine except that seems to be contrary to normal
> practice, where the null would be that the two sets are homogenous unless
> there's evidence otherwise.  Has anyone else used this test and can confirm
> that the null is that sets are not homogenous?
> 
> a<-2*pi*c(1,2,3)/365
> b<-a+pi
> rt<- rao.test(a,b)
> rt$p.value
> 
> this gives two p-values of 1 - one for the equality of polar vectors, and
> the second for the  test of equality of dispersions.  Although I can guess,
> to be honest at the moment i'm not sure what either of these things mean
> (not really an R-help question I know) as I've only just begun serious
> analysis of circular data but I am surprised that this toy data gives a
> p-value of 1 in each case
> 
> can anyone cast light on all this?

I think the null for the polar test is that the directions are the same, 
and the null for the dispersion test is that the dispersions are the same.

Your two samples are very similar but in opposite directions.  If you 
add pi/2 (or other numbers) instead of pi to form b from a, you'll see 
very small p values.

What this indicates to me is that the test as implemented is unable to 
detect directions that differ by pi.

I don't know whether the original test had this limitation or whether it 
isn't implemented as designed.

Duncan Murdoch



More information about the R-help mailing list