# NOT RUN {
##
## Example 5.1 in Gibbons and Chakraborti (2003), p.98.
## Annual data on total number of tourists to the United States for 1970-1982.
##
years <- 1970:1982
tourists <- c(12362, 12739, 13057, 13955, 14123, 15698, 17523, 18610, 19842,
20310, 22500, 23080, 21916)
plot(years, tourists, pch=20)
bartels.rank.test(tourists, alternative="left.sided", pvalue="beta")
# output
#
# Bartels Ratio Test
#
#data: tourists
#statistic = -3.6453, n = 13, p-value = 1.21e-08
#alternative hypothesis: trend
##
## Example in Bartels (1982).
## Changes in stock levels for 1968-1969 to 1977-1978 (in $A million), deflated by the
## Australian gross domestic product (GDP) price index (base 1966-1967).
x <- c(528, 348, 264, -20, -167, 575, 410, -4, 430, -122)
bartels.rank.test(x, pvalue="beta")
# }
# NOT RUN {
<!-- %GPDprice<-c(83.9, 86.3, 87.3, 88.4, 91.6, 94, 96.9, 100, 102.6, 106.2, 110.9, 117.2, -->
# }
# NOT RUN {
<!-- % 125.5, 136.3, 155.4, 184.5, 211.8, 234.9, 254.1) -->
# }
# NOT RUN {
<!-- %income<-c(420, 361, 338, 463, 558, 613, 513, 530, 601, 747, 801, 790, 766, 817, 603, -->
# }
# NOT RUN {
<!-- % 155, 243, 829, 1255) -->
# }
# NOT RUN {
<!-- %x <- income/GPDprice * 100 -->
# }
# NOT RUN {
<!-- %bartels.rank.test(x) -->
# }
Run the code above in your browser using DataLab