I have a dataset with multiple dependent variables, which are counts of about 53 different categories of debris found on beaches. I also have a variety of independent variables, some of which I am interested in as fixed effects, but others of which are probably best off as random effects. They are a mix of categorical and continuous variables, e.g. State, county, distance from north to south, number of people present, etc.
A very tiny sample data set is as follows, though there are additional factors such as distance to road, date of survey, number of people on beach, and multiple transects per site.
Counts<- as.data.frame(matrix (rpois(100,1), ncol=5)) colnames(Counts)<-c("Glass", "HardPlastic", "SoftPlastic", "PlasticBag", "Fragments") State<-rep(c("CA","OR","WA"), each=6) Counts$State<-c(State,"CA","OR") County<-rep((1:9), each=2) Counts$County<-c(County, 1,4) Counts$Distance<-c(10, 15, 13, 19, 18, 23, 38, 40, 49, 44, 47, 45, 52, 53, 55, 59, 51, 53, 14, 33) Year<-rep(c("2010","2011","2012"), times=7) Counts$Year<-Year[1:20]
I would like to know whether the data vary by state, whether they change over time, and ultimately, whether the variability is higher within a site or between sites.
I think the best way to look at the data would be through a multinomial logistic regression model. I have been working in R, so I have looked at nnet (multinom) and VGAM (vglm), but it appears that neither of these support random effects. It could also be useful to have a smooth on some of the geographic data, so I've had a look at mgcv, but I can't find whether that package would support multiple dependent variables.
I have read that MCMCglmm will handle random effects, but I must admit I am a bit daunted by the complexity of how to set up the model structure, especially with respect to the priors.
My specific questions therefore are:
- can mgcv handle multiple DVs?
- Is there another package I have overlooked?
I have found the following site: http://search.r-project.org/library/mgcv/html/mvn.html, which describes using the mvn family in mgcv as a way to run multivariate normal additive models. The model structure then for my sample data set would appear to look something like this:
If this is correct, however, the model will get enormously long and complex as additional categories are added, and furthermore, I don't believe my data are normally distributed.
In other words, I'm still very much looking for an answer to this question!