I’m not well versed in R but am using the GLLVM package to assess the influence of season and water mass on plankton distribution – when I try to make the coefficient plots using coeffplot.gllvm() I get a plot per factor level eg; season_factorSPRING or water_factorNeritic but I want a coeff plot for just the factors (season + water mass). Also, the one level from each factor is missing (I assume this has become a reference level the others are based off but is this correct?) – is there a way to do this? I have been following [https://jenniniku.github.io/gllvm/articles/vignette1.html#model-with-environmental-variables] as a guide and the only difference I can think of that is causing this issue is my data is categorical while the AntTraits dataset is numerical?
Any advice would be much appreciated.
part of my code so far:
ALLData$water_factor <-factor(ALLData$water_type,
-
levels = c("NW", "STW", "SAW"))
ALLData$season_factor<-factor(ALLData$season,
-
levels = c("Spring", "Summer", "Autumn"))
data_ev <- ALLData[,c(“station”,”Temp_avg”,”Sal_avg”, “water_factor”, “season_factor”)]
head(data_ev)
A tibble: 6 × 5
station Temp_avg Sal_avg water_factor season_factor
1 2 11.5 34.4 NW Spring
2 3 11.0 34.9 STW Spring
3 8 9.07 34.5 SAW Spring
4 9 8.58 34.3 SAW Spring
5 1 16.6 34.7 STW Summer
6 2 16.6 34.6 NW Summer
y <- as.matrix(data_zp)
X <- as.matrix(data_ev)
fit_env9<- gllvm(y,X, family = “negative.binomial”, num.lv = 1,
-
formula = ~ season_factor + water_factor, seed = 1234)
coefplot.gllvm(fit_env9,cex.ylab = 0.7, mar = c(4,9,2,1), mfrow = c(2,2))
coefplot output – want two figures (season and water) not season and water broken by levels
daragh brown is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.