hi Asia,
varying numbers of secondary periods is accommodate implicitly by padding data with missing values.
For example, if you look at this data file from the help file for colext:
# Fake data
R <- 4 # number of sites
J <- 3 # number of secondary sampling occasions
T <- 2 # number of primary periods
y <- matrix(c(
1,1,0, 0,0,0,
0,0,0, 0,0,0,
1,1,1, 1,1,0,
1,0,1, 0,0,1), nrow=R, ncol=J*T, byrow=TRUE)
this shows 2 primary periods with 3 secondary periods each. If instead the 2nd primary period only had 2 secondary samples then you change one set of data to NA:
y <- matrix(c(
1,1,0, 0,0,NA,
0,0,0, 0,0,NA,
1,1,1, 1,1,NA,
1,0,1, 0,0,NA), nrow=R, ncol=J*T, byrow=TRUE)
In general, you make the data file have the highest value of J for all sites and then pad with NAs.
regards
andy