[R-sig-ME] predict function for a glmm

Williamson, Michael m|ch@e|@w||||@m@on @end|ng |rom kc|@@c@uk
Tue May 21 15:13:44 CEST 2019

Good Afternoon,

I am running a GLMM model using the glmmTMB function. I've been told I should run the model on 80% of my data, then test the outputs on the remaining 20% using the predict function in order to test the robustness of the model. I have a binomial response variable (off shore = 1 not offshore =0) for the model.

My code is this:

OffMod_80 <- glmmTMB(offshore ~ sex + log(size) + species*daynight+ species*season +
                    (1|code), family=binomial(), data=Off_80)

pred_Off20 <- as.data.frame(predict(OffMod_80, newdata = Off_20))

This spits out a table of values from the predict function.

My question is, considering my response variable is non-normal what method can I use to compare these predicted outputs with my observed values to test the robustness of the model? Is this even the correct way to go about things for this data and model type?

Any help appreciated.

Michael Williamson
London NERC DTP Candidate

Email: michael.williamson using kcl.ac.uk<mailto:michael.williamson using kcl.ac.uk> Phone: +447764836592 Skype: mikejwilliamson Twitter: @mjw_marine

Most recent paper:
Williamson, M. J., Tebbs, E., Dawson, T., Jacoby D. (2019) 'Satellite Remote Sensing in Shark and Ray Ecology, Conservation and Management', Frontiers in Marine Science, 6, 1-23. https://doi.org/10.3389/fmars.2019.00135<https://eur03.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdoi.org%2F10.3389%2Ffmars.2019.00135&data=01%7C01%7Cmichael.williamson%40kcl.ac.uk%7Cebe89eb38f9f4638c3af08d6b381355f%7C8370cf1416f34c16b83c724071654356%7C0&sdata=RSgPw0Ar9R1JvA0YDYfJhDOdwUYfy7sh2vZs2t5tO94%3D&reserved=0>

	[[alternative HTML version deleted]]

More information about the R-sig-mixed-models mailing list