2
$\begingroup$

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.

$\endgroup$
5
  • $\begingroup$ Is this for some subject, such as an exercise, assignment or similar? Further, you should clearly identify the statistical issue you have (Q&A format where answers would typically be a few paragraphs long isn't a suitable mechanism for teaching you regression and ANCOVA from scratch) -- otherwise your question appears to be extremely broad. Please ask a specific question. $\endgroup$ Commented Apr 20, 2015 at 4:14
  • $\begingroup$ Yes it is part of a zoology/stats assignment. The only information we have is it is related to the lectures on 'Generalised Linear Models' and 'Model Selection and Model Averaging'. Okay thanks for that, ill get editing now $\endgroup$ Commented Apr 20, 2015 at 4:19
  • $\begingroup$ You should add the 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$ Commented Apr 20, 2015 at 4:20
  • $\begingroup$ I have reworded the question and added code from a past example, hopefully this helps. Thanks $\endgroup$ Commented Apr 20, 2015 at 5:08
  • $\begingroup$ Your current question appears simpler than your previous example where you seem to had 3 outcome variables: cbind(NSurvivors, NSticklebackAdded - NSurvivors). Here you have only one. $\endgroup$ Commented Apr 22, 2015 at 0:46

1 Answer 1

1
$\begingroup$

Looks to me like you should use binary logistic regression. Your dependent variable is learning (yes/no) and all other variables are independent variables. Binary logistic regression is extremely flexible with regard to scales of measurement used with the predictors.

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.