# 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)
# See it graphically
qplot(factor(years), tourists)+ geom_point()
# Test the null against a trend
Bartels(tourists, alternative="left.sided", pvalue="beta")
Run the code above in your browser using DataLab