I have to fit a model to test whether Learning (1=learned, 0=failed) depends on lizard sex (M or F), Lizard SVL (snout-vent length), or an interaction of the two.
I am new to both R and this website. Please explain each step fully.
This is random data given to us as part of a zoology/statistics assignment. It is related to lectures 'Generalized Linear Models' and 'Model Selection and Model Averaging'.
Snout-vent length is used as a a measure of size (in millimeters).
Specifically, what R code is required to fit a GLM when a categorical and continuous predictor variable are used to predict a categorical dependent variable? The following is from a previous example with two categorical predictor variables that we have worked through if that helps with what I am trying to ask:
plot(ProportionSurvived ~ Treatment, data=dat)
interaction.plot(dat$Sculpin, dat$Lake, response = dat$NSurvivors/dat$NSticklebackAdded)
glm(cbind(NSurvivors, NSticklebackAdded - NSurvivors) ~ Lake * Sculpin, family = binomial(link = "logit"), data=dat)
Treatment is one of four possible conditions (2 levels of 2 predictors; lake and sculpin present or absent). This example was testing the proportion of sticklebacks that survived (proportionsurvived) in a pond.
self-study
tag and read its tag wiki (which explains how to modify the question and the style of answer that can be given). It may help to give more details; it's not immediately clear what model might be considered suitable for snout-vent lengths (I presume either a Gaussian or a Gamma model would be typical but I don't know biology enough to now which would be more accepted or more likely to be an apt description of typical data). I don't see an immediate connection to model selection or model averaging, since you're talking about testing. $\endgroup$