| Literature DB >> 28959087 |
Jeremy Koster1,2, Richard McElreath2,3.
Abstract
Behavioral ecologists frequently use observational methods, such as instantaneous scan sampling, to record the behavior of animals at discrete moments in time. We develop and apply multilevel, multinomial logistic regression models for analyzing such data. These statistical methods correspond to the multinomial character of the response variable while also accounting for the repeated observations of individuals that characterize behavioral datasets. Correlated random effects potentially reveal individual-level trade-offs across behaviors, allowing for models that reveal the extent to which individuals who regularly engage in one behavior also exhibit relatively more or less of another behavior. Using an example dataset, we demonstrate the estimation of these models using Hamiltonian Monte Carlo algorithms, as implemented in the RStan package in the R statistical environment. The supplemental files include a coding script and data that demonstrate auxiliary functions to prepare the data, estimate the models, summarize the posterior samples, and generate figures that display model predictions. We discuss possible extensions to our approach, including models with random slopes to allow individual-level behavioral strategies to vary over time and the need for models that account for temporal autocorrelation. These models can potentially be applied to a broad class of statistical analyses by behavioral ecologists, focusing on other polytomous response variables, such as behavior, habitat choice, or emotional states.Entities:
Keywords: Focal observations; Generalized linear mixed models; Multinomial logistic regression; RStan; Scan sampling
Year: 2017 PMID: 28959087 PMCID: PMC5594044 DOI: 10.1007/s00265-017-2363-8
Source DB: PubMed Journal: Behav Ecol Sociobiol ISSN: 0340-5443 Impact factor: 2.980
Description of activities that comprise the response categories
| Response | Description |
|---|---|
| (1) Agriculture | Activities including clearing fields, planting, weeding, and harvesting crops |
| (2) Domestic chores | Cooking, laundering clothes, cleaning the residence, bringing water, etc. |
| (3) Staying at finca | Extended time at makeshift upstream residences, involving overnights |
| (4) Firewood | Either collecting firewood from forest or chopping firewood in community |
| (5) Fishing | Excursions specifically devoted to fishing |
| (6) Gold panning | Either preparing sites or actively panning for gold in streams around community |
| (7) Hunting | Excursions devoted specifically to hunting activities, not opportunistic hunting |
| (8) Livestock | Either direct care of domestic animals or preparation of pastures and shelters |
| (9) Manufacture | Constructions of items such as dugout canoes, residences, or homemade tools |
| (10) Miscellaneous work | Involves community labor, errands, providing routine assistance to others |
| (11) School | Attending school as a student |
| (12) Steady work | Regular employment as a schoolteacher, contract worker, or project assistant |
| (13) Wage labor | Working for pay locally, including clearance of fields and construction tasks |
| (14) Reference | Non-work reference level for idleness, sleeping, leisure, church, socializing, etc. |
Predictor variable names, descriptions, and summary statistics
| Variable | Description | Mean | Std dev. |
|---|---|---|---|
| Age | Age in years of observed individuals | 31.13 | 15.63 |
| Wealth | Log-transformed value of household possessions (measured in Nicaraguan currency) | 8.60 | 0.93 |
| House size | Number of residents in the household of the observed individual at the time of the observation | 8.16 | 3.04 |
| Sunday | Binary variable to denote observations that occurred on Sunday | .12 | |
| Saturday | Binary variable to denote observations that occurred on Saturday | .15 | |
| Time of day | Proportional variable that denotes that percentage of a 24-h day that had elapsed at the time of observation | 0.49 | 0.15 |
| Monthly rainfall | Average monthly rainfall (mm) for the month in which the observation occurred | 222.10 | 112.19 |
Model comparison using WAIC
| Model | WAIC (SE) | Effective parameters | ΔWAIC (SE) | Weight |
|---|---|---|---|---|
|
| 8447.0 (122.72) | 362.4 | 1 | |
|
| 8721.6 (123.68) | 284.3 | 274.6 (31.83) | 0 |
|
| 9267.0 (113.26) | 324.5 | 820.0 (52.34) | 0 |
|
| 9574.4 (112.97) | 231.5 | 1127.4 (60.67) | 0 |
Lower values indicate preferable models. The weight of a model is its Akaike weight, interpretable as the probability that a candidate model will make superior predictions on new data
Variance estimates of the random effects in the four models presented in this paper. The reported quantities are the standard deviations of the random effects while the values in parentheses are the standard deviations of these quantities in the posterior samples
| Individual | House | Month | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
|
|
|
|
|
|
| |
| 1. Agriculture | .67 (.10) | .50 (.11) | .62 (.11) | .41 (.14) | .24 (.15) | .30 (.15) | .52 (.16) | .46 (.15) |
| 2. Domestic | 1.08 (.28) | .87 (.33) | .80 (.33) | .62 (.36) | .73 (.41) | .62 (.38) | .28 (.22) | .23 (.19) |
| 3. Finca | 1.80 (.31) | 1.89 (.33) | 1.47 (.37) | 1.58 (.44) | 1.09 (.53) | 1.30 (.69) | 1.00 (.30) | 1.11 (.32) |
| 4. Firewood | .29 (.19) | .23 (.17) | .25 (.18) | .22 (.17) | .31 (.20) | .28 (.20) | .79 (.25) | .74 (.25) |
| 5. Fishing | .90 (.28) | .89 (.30) | .38 (.27) | .34 (.27) | .98 (.36) | 1.00 (.37) | .71 (.37) | .71 (.35) |
| 6. Gold | 2.23 (.38) | 2.28 (.43) | 1.60 (.39) | 1.39 (.44) | 1.64 (.62) | 1.76 (.57) | .56 (.19) | .32 (.20) |
| 7. Hunting | 1.31 (.27) | 1.29 (.30) | .92 (.31) | .80 (.43) | .96 (.47) | 1.00 (.53) | .23 (.18) | .35 (.26) |
| 8. Livestock | .70 (.36) | .74 (.40) | .41 (.32) | .46 (.35) | .72 (.37) | .83 (.41) | 1.28 (.73) | 1.14 (.67) |
| 9. Manufacture | 1.02 (.19) | .81 (.19) | .87 (.22) | .37 (.26) | .47 (.28) | .74 (.27) | .27 (.18) | .24 (.17) |
| 10. Other work | .82 (.20) | .57 (.24) | .73 (.21) | .42 (.25) | .32 (.22) | .38 (.25) | 1.59 (.57) | 1.38 (.46) |
| 11. School | 1.64 (.35) | .81 (.38) | 1.68 (.41) | .43 (.33) | .60 (.50) | .59 (.40) | 2.36 (.99) | 1.78 (.77) |
| 12. Steady work | 2.91 (.63) | 2.85 (.56) | 2.84 (.60) | 2.80 (.57) | .84 (.81) | .71 (.62) | .32 (.20) | .30 (.19) |
| 13. Wage | 1.10 (.21) | .53 (0.24) | .83 (.26) | .31 (.22) | .73 (.32) | .67 (.24) | 1.06 (.34) | 1.01 (.31) |
Correlations of individual-level random effects across responses
| (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | (11) | (12) | (13) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1. Agriculture | .00 (.21) | . | .05 (.24) | .07 (.21) | .01 (.17) | .04 (.20) | − .01 (.23) | .30 (.18) | .14 (.23) | .13 (.22) | − .24 (.18) | .04 (.22) | |
| 2. Domestic | .02 (.18) | .07 (.19) | − .02 (.25) | .15 (.22) | − .02 (.21) | .13 (.21) | .14 (.23) | − .15 (.22) | .06 (.23) | .06 (.24) | − .02 (.22) | .03 (.23) | |
| 3. Finca | .24 (.15) | .14 (.17) | .00 (.24) | .05 (.19) | .18 (.15) |
| .06 (.21) | − .10 (.18) | .20 (.21) | .13 (.22) | − .23 (.16) | − .02 (.20) | |
| 4. Firewood | .12 (.23) | .03 (.23) | − .01 (.23) | .07 (.24) | .06 (.24) | .00 (.24) | .01 (.25) | .09 (.25) | − .01 (.24) | .04 (.25) | − .03 (.24) | − .04 (.25) | |
| 5. Fishing | − .10 (.19) | .10 (.21) | .01 (.18) | .06 (.24) | .23 (.20) | .21 (.21) | .07 (.23) | .10 (.21) | .07 (.23) | − .03 (.22) | − .07 (.21) | .18 (.22) | |
| 6. Gold | .03 (.16) | − .11 (.19) | .19 (.14) | − .03 (.24) | .21 (.19) |
| .15 (.20) | − .04 (.18) | .10 (.20) | − .15 (.23) |
| .13 (.20) | |
| 7. Hunting | − .02 (.17) | .14 (.19) |
| − .11 (.23) | .07 (.20) |
| .14 (.22) | .02 (.20) | .24 (.21) | − .05 (.24) | − .13 (.19) | .13 (.21) | |
| 8. Livestock | .03 (.22) | .17 (.22) | .09 (.21) | .03 (.24) | .02 (.22) | .16 (.21) | .17 (.21) | − .09 (.23) | .18 (.24) | .07 (.24) | − .01 (.22) | − .06 (.23) | |
| 9. Manufacture |
| − .13 (.19) | − .12 (.16) | .03 (.23) | − .06 (.20) | .09 (.16) | .16 (.17) | .00 (.22) | .00 (.22) | − .02 (.22) | .03 (.19) | .02 (.21) | |
| 10. Other work |
| .09 (.21) | .16 (.17) | − .03 (.24) | − .09 (.22) | .15 (.18) | .31 (.18) | .23 (.23) | .30 (.18) | .12 (.24) | − .14 (.22) | − .03 (.24) | |
| 11. School | − .21 (.17) | .21 (.18) | .21 (.17) | .08 (.23) | .14 (.19) | − .24 (.18) | − .07 (.19) | .04 (.22) | − .33 (.18) | − .18 (.20) | − .09 (.23) | − .21 (.24) | |
| 12. Steady | − .19 (.16) | .02 (.21) | − .14 (.15) | − .08 (.23) | − .12 (.21) | − .19 (.17) | .09 (.18) | .05 (.22) | .17 (.17) | .04 (.20) | − .18 (.19) | − .01 (.21) | |
| 13. Wage | .27 (.15) | − .01 (.19) | − .06 (.15) | − .11 (.23) | .08 (.20) |
| .22 (.17) | − .05 (.21) | .28 (.16) | .23 (.18) |
| .14 (.17) |
The reported means are from the posterior samples (standard deviation in parentheses). Parameters in bold represent estimates whose 96% credible intervals do not include zero. The bottom half of the matrix depicts correlations from the intercept-only model (mfit_i). The top half of the matrix details correlations from the model with fixed effects, but not additional random effects (mfit_iF)
Posterior means (standard deviations in parentheses) of fixed effects in models mfit_iF and mfit_ihmF, respectively
| Agriculture | Domestic | Finca | Firewood | Fishing | Gold | Hunting | Livestock | Manufacture | Other work | School | Steady work | Wage labor | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||||||
| Intercept | .21 (.16) |
|
|
|
| − .95 (.50) |
|
|
|
|
|
|
|
| Age |
| − .05 (.25) | .11 (.35) | .07 (.16) | − .26 (.27) | .77 (.44) | .50 (.31) | .31 (.28) |
|
|
| .75 (.59) |
|
| Age2 | − .12 (.10) | − .05 (.25) | − .29 (.32) | .22 (.13) | − .03 (.26) |
|
| − .18 (.25) |
|
| .26 (.47) |
|
|
| Wealth | − .14 (.10) | .34 (.22) | .35 (.30) | − .04 (.14) | − .23 (.24) | − .10 (.36) | .55 (.28) | .35 (.25) | − .02 (.17) | .10 (.17) | .15 (.25) | .32 (.46) |
|
| House size |
| − .43 (.21) |
| − .15 (.14) | − .06 (.22) | .03 (.20) | − .37 (.23) | .14 (.24) | − .04 (.15) | − .16 (.17) | − .30 (.20) | .29 (.30) | − .15 (.14) |
| Sunday |
| − .20 (.39) |
|
|
|
|
| − 1.06 (.55) |
| − .08 (.31) |
|
|
|
| Saturday | .31 (.16) | .37 (.38) | .17 (.20) |
| .42 (.35) | − .39 (.27) |
| .15 (.49) | − .17 (.28) | − .27 (.40) |
| − .42 (.31) |
|
| Time | .07 (.07) | .05 (.14) | − .09 (.08) | − .03 (.13) | − .17 (.15) | − .04 (.12) | − .36 (.20) | − .27 (.19) | − .17 (.10) |
| .26 (.19) | − .01 (.12) |
|
| Time2 |
| − .29 (.17) |
|
|
|
|
| − .34 (.21) |
|
|
|
|
|
| Rainfall |
| .23 (.15) | − .12 (.08) | .00 (.12) | − .13 (.16) | . | .04 (.15) | .19 (.19) | .15 (.10) | . | .20 (.15) | − .02 (.11) |
|
|
| |||||||||||||
| Intercept | .26 (.24) |
|
| − |
| − .94 (.53) |
|
|
|
|
|
|
|
| Age |
| − .13 (.25) | .41 (.39) | .04 (.18) | − .32 (.25) | .67 (.41) | .56 (.30) | .25 (.28) |
|
|
| .77 (.58) | . |
| Age2 | − .12 (.11) | .10 (.25) | − .46 (.31) | .22 (.14) | .11 (.24) |
|
| − .15 (.25) |
|
| .38 (.46) |
|
|
| Wealth | − .14 (.11) | .35 (.24) | .26 (.37) | − .04 (.16) | − .27 (.30) | − .26 (.43) | .48 (.32) | .41 (.30) | − .02 (.18) | .09 (.19) | .20 (.26) | .38 (.46) |
|
| House size | − .19 (.10) | − .36 (.23) |
| − .11 (.15) | .04 (.26) | .15 (.23) | − .43 (.27) | .29 (.28) | − .09 (.17) | − .11 (.18) | − .29 (.22) | .33 (.32) | − .06 (.18) |
| Sunday |
| − .20 (.37) | − |
|
| − |
|
|
| .09 (.32) |
|
|
|
| Saturday | . | .37 (.38) | .14 (.21) |
| .43 (.34) | − .43 (.28) |
| .16 (.47) | − .16 (.28) | − .28 (.42) |
| − .42 (.32) |
|
| Time | .08 (.07) | .05 (.14) | − .09 (.08) | − .02 (.14) | − .19 (.17) | − .04 (.11) | − .34 (.20) | − .25 (.20) | − .17 (.10) |
| .23 (.19) | − .02 (.12) |
|
| Time2 |
| − .30 (.16) |
|
|
| − |
| − .35 (.21) |
|
|
|
|
|
| Rainfall | − .28 (.15) | .24 (.18) | − .11 (.33) | − .05 (.25) | − .13 (.27) |
| .04 (.20) | .25 (.41) | .15 (.13) | .37 (.41) | .25 (.50) | − .02 (.15) | − .23 (.31) |
Parameters in bold represent estimates whose 96% credible intervals do not include zero. Note that all continuous predictors have been z-score standardized relative to their values in Table 1
Fig. 1Model predictions of response behaviors as a function of age. Predictions assume a time of 8:00 a.m. on a weekday. All other covariates are held at the sample mean. The shaded regions are the 89% percentile intervals, as calculated from the posterior samples of model mfit_iF
Fig. 2Model predictions of response behaviors as a function of day. Predictions assume a time of 8:00 a.m. while all other covariates are held constant at the sample mean. The confidence intervals are the 89% percentile intervals, as calculated from the posterior samples of model mfit_iF. Note the similarity of ratios between other work (k = 10) and the reference level (k = 14), which was addressed as an example in the text of the manuscript