Hello everyone,
I'm quite new to R and am trying to run a logistic model
to look at how various measures of boldness in
individual animals influences probability of capture,
however I also want to include random effects and
I'm not sure how to construct a model that incorporates both
of these things.
Data was collected from 6 different groups of 6 individuals
with 10 replicates for each group. Whether an
individual was caught in a trial or not was called "Catchability"
and the outcome is binomial (caught = 1,
not caught = 0). "Catchability" is my response variable that
I want to see if I can explain by the other
variables. "Individual" and "Group" would be my random effects.
I have already installed lme4 but not
sure how to code for the model I need, can anyone offer any help please?
The column headings in my data table are as follows.
[1] "Trial" "Group" "Individual" "Mark"
[5] "Catchability" "Mboldness1" "Mboldness2" "Nboldness1"
[9] "Nboldness2" "Standardlength"
This is the string of my data:
str(data)
'data.frame': 36 obs. of 10 variables:
$ Trial : int 1 2 3 4 5 6 7 8 9 10 ...
$ Group : int 1 1 1 1 1 1 2 2 2 2 ...
$ Individual : int 1 2 3 4 5 6 7 8 9 10 ...
$ Mark : Factor w/ 8 levels " - O"," - P",..:
8 2 4 6 3 1 6 3 1 5 ...
$ Catchability : int 1 1 1 1 0 1 1 1 1 1 ...
$ Mboldness1 : int 7 10 0 11 15 5 15 4 15 1 ...
$ Mboldness2 : int 1 270 600 1 10 203 10 230 1 580 ...
$ Nboldness1 : int 0 0 0 0 0 0 1 0 2 0 ...
$ Nboldness2 : int 270 110 50 50 90 70 130 90 260 220 ...
$ Standardlength: num 40.5 37.4 38.6 41.1 39.1 40.5 50.2 60.3 53.9 55 ...