# Generalised linear model fitted values

I have ran this model in R:

glm(alert ~ water.height + ssp*ssp.zone + log(count) + ssp*days,

• Alert = proportion of a goose flock that were alert,
• ssp = subspecific identity of flock,
• ssp.zone = which part of site they were in,
• log(count) = log of flock size, and
• days = days from 27.9.13

This is a plot of the the predicted proportion of flock that is alert conditional on days and ssp.zone:

Two things are strike me as slightly strange:

1. The top two lines for predicted values are curved, even though the model doesn't include a polynomial term.
2. The confidence interval for the top two lines in uneven and the predicted values are not always in the centre of the confidence interval.

Can anyone explain why I'm seeing a curved line for predictions and an uneven confidence interval? Is it something to do with using family=quasibinomial? Unfortunately I cannot recreate these patterns using any built-in R datasets.

-
The function being fitted is not linear. The default link function is logisitic. That is $$P(Y=1) = \frac{\exp(\eta)}{1+\exp(\eta)}$$ where $\eta = X\beta$. You really shouldn't use this model, or any other GLM - or indeed any model - until you at least have a basic understanding of what it is you're fitting. There are some good basic introductions to GLMs around here and there. – Glen_b Mar 24 '14 at 22:02

Your response data are binary. It doesn't matter whether you used family=binomial or family=quasibinomial. The fitted values are predicted probabilities that a given goose will be 'alert' on a given day. Those predicted probabilities will follow a sigmoid (elongated 's'-shape) curve unless the variable has absolutely no relationship with the response (in your sample), in which case the line would be flat and at the level of the proportion 'alert' in your sample. In addition, if the predicted probability is not exactly $.5$, the confidence interval must be asymmetrical with the longer tail pointing towards the far side of the $(0, 1)$ interval. This is simply because the confidence interval cannot go outside that interval. The CI will be more asymmetrical the further the predicted probability is from $.5$. In addition, the CI / standard error will tend to be wider the closer it is to $.5$. Most of these facts can be understood by learning about the binomial distribution, which is the most basic distribution for binary data.
It's still bounded by (0,1), so all the above still applies. The quasibinomial is presumably fine. The lower lines aren't exactly straight, but almost. I imagine the variable days has little association w/ the proportion 'alert'. I also guess there are fewer observations at later days for the light-bellied geese. – gung Mar 24 '14 at 20:49