File: test-walraff.test.Rout.save

package info (click to toggle)
r-cran-circular 0.5-1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,492 kB
  • sloc: ansic: 464; fortran: 69; sh: 13; makefile: 2
file content (96 lines) | stat: -rw-r--r-- 2,564 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96

R version 3.4.0 (2017-04-21) -- "You Stupid Darkness"
Copyright (C) 2017 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> # Test data from:
> #    Batschelet, E (1981). Circular Statistics in Biology.
> #    Examples 6.10.1 and 6.10.2, p 126
> # 
> 
> suppressMessages(library("circular"))
> # ?wallraff.test
> 
> angles <- circular(c(70, 80, 80, 85, 85, 90, 95, 95, 5, 5, 15, 55, 55, 65, 105, 120, 340), units="degrees", template="geographics")
> group <- factor(c(rep("control", 8), rep("experimental", 9)))
> 
> homeDir <- 40
> 
> # expect:
> # W = 2 (in wilcox.test) and p < 0.01 for the dispersion test
> # W = 26 (in wilcox.test) and p > 0.05 for the homing test
> 
> xn <- angles
> wallraff.test(xn, group)

	Wallraff rank sum test of angular distance

data:  xn by group
Kruskal-Wallis chi-squared = 10.77, df = 1, p-value = 0.001032

> 
> wallraff.test(xn, group, ref=homeDir)

	Wallraff rank sum test of angular distance

data:  xn by group
Kruskal-Wallis chi-squared = 0.93278, df = 1, p-value = 0.3341

> wallraff.test(xn, as.factor(group), ref=homeDir)

	Wallraff rank sum test of angular distance

data:  xn by as.factor(group)
Kruskal-Wallis chi-squared = 0.93278, df = 1, p-value = 0.3341

> 
> 
> xl <- split(xn, group)
> wallraff.test(xl, ref=homeDir)

	Wallraff rank sum test of angular distance

data:  control and experimental
Kruskal-Wallis chi-squared = 0.93278, df = 1, p-value = 0.3341

> wallraff.test(xl)

	Wallraff rank sum test of angular distance

data:  control and experimental
Kruskal-Wallis chi-squared = 10.77, df = 1, p-value = 0.001032

> 
> xl <- split(xn, group)
> names(xl) <- NULL
> wallraff.test(xl)

	Wallraff rank sum test of angular distance

data:  1 and 2
Kruskal-Wallis chi-squared = 10.77, df = 1, p-value = 0.001032

> 
> xd <- data.frame(group=group, angles=angles)
> wallraff.test(angles ~ group, xd)

	Wallraff rank sum test of angular distance

data:  angles by group
Kruskal-Wallis chi-squared = 10.77, df = 1, p-value = 0.001032

>