wants <- c("coin")
has <- wants %in% rownames(installed.packages())
if(any(!has)) install.packages(wants[!has])
N <- 10
P <- 5
cDf <- data.frame(id=factor(rep(1:N, each=P)),
year=factor(rep(1981:1985, times=N)),
pref=c(1,1,0,1,0, 0,1,0,0,1, 1,0,1,0,0, 1,1,1,1,1, 0,1,0,0,0,
1,0,1,1,1, 0,0,0,0,0, 1,1,1,1,0, 0,1,0,1,1, 1,0,1,0,0))
Asymptotic General Symmetry Test
data: pref by
year (1981, 1982, 1983, 1984, 1985)
stratified by id
chi-squared = 1.3333, df = 4, p-value = 0.8557
R markdown - markdown - R code - all posts