1
$\begingroup$

I have behavioural data on gentoo penguins from when we did research in Antarctica. I am looking at vigilance on exterior and interior nests at two different locations.

To standardise the count of vigilance behaviours I divided the amount of vigilant behaviours in one survey by the length of the survey (most 30 mins). So now my dependant variable is number of vigilant behaviours per minute.

So firstly looking at linear models lm(rate_per_min ~ nest position, data=gentoo_data) did not work as the assumptions were violated. I then tried transformations which did not work either so I am now trying GML's but am unsure what family to use.

I can't use poison as the they are not counts due to it being a rate. Obviously not binomial, so I thought maybe gamma but i have not come across this one yet. I have left a picture of the data distribution, i would say it is bimodal? Please can someone explain which family to use and why?

Thank you

$\endgroup$
3
  • 3
    $\begingroup$ Unless you absolutely have to keep your standardised count variable as the outcome, I suspect you can use Poisson regression on the raw counts of vigilance behaviours, and the survey length as an offset to model the rate. I'm making this a comment as there are many related answers on this site, but this one might be the most straightforward. In R, this would look like glm(n_behaviours ~ nest_position, data = gentoo_data, family = poisson, offset = log(survey_length)) $\endgroup$
    – awhug
    Apr 14 at 11:15
  • $\begingroup$ Thank you for your help. I standardised it because my lectuerer said I needed to consider effort so I thought this would be an appropriate way. I will read up about offsets as I havent come across this yet. Thanks again! $\endgroup$
    – Alice
    Apr 14 at 12:05
  • $\begingroup$ The offset in a glm accounts for effort. The chapter on glms in this book is very good. amazon.com/…. $\endgroup$
    – N Brouwer
    Apr 14 at 12:59

2 Answers 2

2
$\begingroup$

I divided the amount of vigilant behaviours in one survey by the length of the survey (most 30 mins)

If your outcome is a count variable, and it is a count per some unit time, you can use a Poisson (or negative binomial) with an offset.

An offset is a way to account for various lengths of time. The model for vigilant behaviors (even from different surveys with different lengths of time) can be

$$ \log(\lambda(X)) = X\beta + \log(t) $$

Here $X$ are your covariates (nest position), $\beta$ are the regression coefficients, and $t$ is the length of the time of the survey in minutes.

This keeps the outcome on its original scale (which is good for interpretation) and accounts for the variable length of time.

In R, an offset is used in the following way with the glm function

glm(count_per_survey ~ nest position, data=gentoo_data, 
    offset = log(length_of_survey), family = poisson())

Of course, you will need to validate that the assumptions of Poisson regression are met, so it instead might be better to just do a negative binomial regression since the assumption that the mean and variance are the same for the Poisson model is quite restrictive and unlikely to be true in my experience.

$\endgroup$
6
  • $\begingroup$ Hi Demetri! I think you missed a "g" in lm(....), i.e. glm(...) $\endgroup$
    – Stefan
    Apr 14 at 16:23
  • $\begingroup$ @Stefan thank you, fixed. $\endgroup$ Apr 14 at 16:35
  • $\begingroup$ @DemetriPananos: It might be better to write the formula as count_per_survey ~ nest position + offset(log(length_of_survey)). Offsets specified as a part of the model forula is treated better in calls to predict, for example. $\endgroup$ Apr 14 at 16:47
  • $\begingroup$ Great thank you for your reply and help Demetri. The variance is indeed significantly higher than the mean, so I have tried a negative binomial and made it: nb_model <- glm.nb(vigilance_count ~ nest_position*location + offset(log(Duration)), data = gentoo_data) This form of GLM is quite new to me, but I am guessing that the same assumptions do not apply now e.g. Homoscedasticity etc? When checking diagnostic plots and model fit, what should I be checking? Thanks again! $\endgroup$
    – Alice
    Apr 14 at 17:23
  • $\begingroup$ @Alice the assumptions for the negative binomial are not easily discussed in the 500 some odd characters I have available for comments. I suggest you do one of: Ask a new question here (you can link me to it), poke around this website for previous discussions (there are many), or perhaps search textbooks on the matter since the negative binomial is one of the first few models one may learn about in a generalized linear models class. $\endgroup$ Apr 14 at 17:35
0
$\begingroup$

the fitdistrplus package can help you with this. it has a descdist function that indicates some distribution possibilities for your response variable (Y).works for both continuous and discrete variables.

$\endgroup$
1
  • 4
    $\begingroup$ The family argument concerns the likelihood, which is the conditional distribution of outcome. So far as I understand, fitdistrplus can only be used for the marginal distirbution. $\endgroup$ Apr 14 at 15:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.