ME-helpers,

 

I am still learning ME models and am trying to implement methods
described by Lai and Helser (2004) (citation below) for analyzing fish
length-weight relationship.  I have a few questions that I could use
some help with.  I have described the situation below.  I have not
provided a reproducible example because the data.frame is large and the
overall code is lengthy.  I very much appreciate any help that anyone
can provide.

 

 

Question #1 - Is the model I implement consistent with the description
of the model provided by Lai and Helser (2004)?

 

Lai and Helser (2004) modeled fish length-weight relationships using a
linear mixed effects models. The particular model that they fit was

 

log(wij) = B0 + B1log(lij) + b0j + b1j log(lij) + eij

 

where

  j: index of group membership

  i: index of an individual within a group

  wij : weight

  lij : centered length

  B0: fixed-effect intercept for an "average" group

  B1: fixed-effect slope for an "average" group

  b0j : random-effect that shows how the intercept for the jth group
varies from the slope of the "average" group. Note that the slope for
the jth group is B0j = B0 + b0j

  b1j : random-effect that shows how the slope for the jth group varies
from the slope of the "average" group

 

I have attempted to fit this model with

 

lme1 <- lmer(logwt ~ cloglen + (cloglen | group), data = lwdf)

 

I extract the B0 and B1 with

 

(fe1 <- fixef(lme1))

 

and the b0j and b1j with

 

(re1 <- ranef(lme1))

 

 

 

Question #2 - Is my calculation of "group residuals" consistent with the
description of the "group residuals" provided by Lai and Helser (2004)?

 

Lai and Helser (2004) argued that the "group mean of residuals" can be
used as a basic measure of "condition" for fish populations. In the
two-level mixed effects model used above the "group residuals" are
defined as

 

vij =b0j +b1j xbarj + eij

 

and the "group mean residuals" are calculated as expected for each
group.

 

I have attempted to compute the vij with,

 

resid.lme1 <- residuals(lme1)

mn.cloglen <- tapply(lwdf$cloglen, lwdf$group,mean)

mres.lme1 = rep(0, nrow(lwdf))

for (i in 1:nrow(lwdf)) {

  mres.lme1[i] <- re1$group[lwdf$group[i], "(Intercept)"] +

                         re1$group[lwdf$group[i], "cloglen"] *
mn.cloglen[lwdf$group[i]] +

                         resid.lme1[i]

}

 

I then computed the "group mean residuals" as follows

 

tapply(mres.lme1, lwdf$group,mean)

 

 

Citation

Lai, H.-L. and T. Helser. 2004. Linear mixed-effects models for
weight-length relationships. Fisheries Research 70:377-387.

 


	[[alternative HTML version deleted]]


