# 5 Solea_solea ~ temperature * salinity 72.68895Ī nice thing to do - as an initial exploratory step - is to fit all the single main effect models and visualize the effect sizes and significant. # 4 Solea_solea ~ salinity + temperature 73.97552 Solea.glms <- llply(formulae, function(f) glm(f, family=binomial, data=Solea)) Note how we can use lists and the ldply function from the (handy) plyr pacakge to build an AIC table: require(plyr) In R, it is often much smarter to work with lists. You can see how much better the salinity model is than the temperature model. Glm(f2, family=binomial, data=Solea)) # df AIC The nice thing about AIC is that we can compare models that are not nested: AIC(glm(f3, family=binomial, data=Solea), ) + 2p\] Because a HIGH likelihood means a better fit, the LOW AIC is the best model. # large_sand med_fine_sand mud Solea_soleaĪnd, using our handy plotting function: plotBinary <- function (X, Y. Head(Solea) # Sample season month Area depth temperature salinity transparency gravel Volume ~ group + s(age, by = group, k = 20, bs = "tp") +ĭoes anyone know whether comparing models is an appropriate way to study the interaction effect and how to get the actual effect? Preferably a method that I can also use for pair-wise analyses as well.Back to the Sole data from the previous lab: Solea <- read.csv("") but this does not give me the output I expected based on my experience comparing lm models with anova(). m2 <- gamm(volume ~ group + s(age, k = 20, bs = "tp") + scanner, data = sim.data, random=list(id=~1)) I thought of using using anova(), comparing a model with by term to a model without a by term. How can I best evaluate the interaction effect (although I also read somewhere that interaction may not be the appropriate term in this additive model)? I hoped that I could interpret the difference in development between groups with my s(age,by=group) term, however it gives me the smooth parameters of age, per group. I made a simulation dataset: library(simstudy) I want to know if the development of volume over time (and I mean age, not waves) is different between groups.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |