this may be a beginners question but any help is appreciated!
I'm looking to compare the length frequencies of fish caught by two different nets using a linear mixed effect model. In this study the 'control net' and 'trial net' were towed together (twin rig trawl) for several repeated hauls. The dataframe contains the number of fish of length L caught by each net for each haul. An example dataframe is given below:
#generate random lengths for each haul
haul1length <- sort(sample(20:100, 50, replace=FALSE))
haul2length <- sort(sample(20:100, 50, replace=FALSE))
haul3length <- sort(sample(20:100, 50, replace=FALSE))
haul4length <- sort(sample(20:100, 50, replace=FALSE))
haul5length <- sort(sample(20:100, 50, replace=FALSE))
length <- c(haul1length, haul2length, haul3length, haul4length, haul5length)
#dataframe contains 5 hauls (replicates) with length frequency counts for the control net and trial net
dataframe <- data.frame("haul" = rep(1:5, each=50), "length"=length, "control"=sample(0:150, 250, replace=TRUE), "trial"=sample(0:150, 250, replace=TRUE))
dataframe
The aim is to compare the expected proportion of fish retained by the trial net per length class (compared to the control net). I'm attempting to do this using a linear mixed model with proportion retained i.e.:
P(L) = n(L)trial / (n(L)trial + n(L)control)
using length as the fixed effect and haul number as the random effect:
install.packages("lme4")
library(lme4)
lmer <- lmer((trial/(trial+control)) ~ length + (1|haul), data=dataframe)
I'm looking to explore the model graphically if possible to produce something like this: the proportion (P) at length (L) of the total catch retained by the trial net
(wherein the dotted line P=0.5 indicates no difference between the trial and control catches)
Is this model right for my data? And if so, how do I go about interpreting in? Much appreciated