How do I code a Mixed effects model for abalone growth in Aquaculture nutrition with nested individuals

98 views Asked by At

I am a biologist working in aquaculture nutrition research and until recently I haven't paid much attention to the power of statistics. The usual method of analysis had been to run ANOVA on final weights of animals given various treatments and boom, you have a result. I have tried to improve my results by designing an experiment that could track individuals growth over time but I am having a really hard time trying to understand which model to use for the data I have.

For simplified explanation of my experiment: I have 900 abalone/snails which were sourced from a single cohort (spawned/born at the same time). I have individually marked each abalone (id) and recorded a length and weight at Time 0. The animals were then randomly assigned 1 of 6 treatment diets (n=30 abalone per treatment) each replicated n=5 times (n=150 abalone / replicate). Each replicate looks like a randomized block design where each treatment is only replicate once within each block and each is assigned to independent tank with n=30 abalone/tank (n treatment). Abalone were fed a known amount of feed for 90 days before being weighed and measured again (Time 1). They are back in their homes for another 90 days before the concluding the experiment.

From my understanding: fixed effects - Time, Treatment nested random effects - replicate, id

My raw data entered is in Long format with each row being a unique animal and columns for Time (0 or 1), Replicate (1-5), Treatment (1-6), Sex (M or F) Animal ID (1-900), Length (mm), Weight (g), Condition Factor (Weight/Length^2.99*5655)

I have used columns from my raw data and converted them to factors and vectors before using the new variables to create a data frame.

id<-as.factor(data.long[,5])

time<-as.factor(data.long[,1])

replicate<-as.factor(data.long[,2])

treatment<-data.long[,3]

weight<-as.vector(data.long[,7])

length<-as.vector(data.long[,6])

cf<-as.vector(data.long[,10])

My data frame is currently in the following structure:

df1<-data.frame(time,replicate,treatment,id,weight,length,cf)

I am struggling to understand how to nest my individual abalone within replicates. I can convert the weight data to change from initial but I think the package nlme already accounts this change when coded correctly. I could also create another measure of Specific Growth Rate for each animal at Time 1 but this would not allow the Time factor to be used.

lme(weight ~ time*treatment, random=~1 | id, method="ML", data=df1))

I would like to structure a mixed effects model so that my code takes into account the individual animal variability to detect statistical differences in their weight at Time 1 between treatments.

0

There are 0 answers