# NOT RUN {
# Load example data
data(shipley2009)
# Reduce dataset for example
shipley2009.reduced = shipley2009[1:200, ]
# Load model packages
library(lme4)
library(nlme)
# Create list of models
shipley2009.reduced.modlist = list(
lme(DD ~ lat, random = ~1|site/tree, na.action = na.omit,
data = shipley2009.reduced),
lme(Date ~ DD, random = ~1|site/tree, na.action = na.omit,
data = shipley2009.reduced),
lme(Growth ~ Date, random = ~1|site/tree, na.action = na.omit,
data = shipley2009.reduced),
glmer(Live ~ Growth+(1|site)+(1|tree),
family=binomial(link = "logit"), data = shipley2009.reduced)
)
# Get goodness-of-fit statistics
sem.fisher.c(shipley2009.reduced.modlist, shipley2009.reduced)
# }
# NOT RUN {
# Repeat with full dataset as in Shipley (2009)
# Create list of models
shipley2009.modlist = list(
lme(DD ~ lat, random = ~1|site/tree, na.action = na.omit,
data = shipley2009),
lme(Date ~ DD, random = ~1|site/tree, na.action = na.omit,
data = shipley2009),
lme(Growth ~ Date, random = ~1|site/tree, na.action = na.omit,
data = shipley2009),
glmer(Live ~ Growth+(1|site)+(1|tree),
family=binomial(link = "logit"), data = shipley2009)
)
# Get goodness-of-fit statistics
sem.fisher.c(shipley2009.modlist, shipley2009)
# }
Run the code above in your browser using DataLab