0
$\begingroup$

I am making a multi-level linear model in R using lmer

Structure of my data is a bit convoluted There are 8 Bogs with 6 squares where damage is evaluated and 3 sweeps for insects. Squares 1,2 correspond to sweep 1-2 and so forth. Additionally, the data was gathered on different weeks. The structure of the data can be seen below:

enter image description here

I would like to relate Perc.Dead to Total.Toadbug. I came up with the following model:

Perc.Dead ~ log(Total.Toadbug + 1) + as.factor(Week) + (1|Bog)

log(Total.Toadbug + 1) does not vary by bog or week as I would expect he affect of the insect to be the same across these 2 parameters.

However, I am not sure if this is correct as 2 observations of Perc.Dead correspond to one observation of Total.Toadbug.

Should I take aggregate the Perc.Dead by Sample.. so that Each Perc.Dead corresponds to a single Total.Toadbug. To get the following table: enter image description here

and then use the above model?

$\endgroup$
  • $\begingroup$ What you propose in terms of collapsing the data so that the frequency of Total.Toadbug corresponds to a similar frequency of Perc.Dead seems right to me, but I'm not sure I completely understand the data structure. Why did you have two Perc.Dead per Total.Toadbug to begin with? $\endgroup$ – Erik Ruzek Jun 10 at 14:15
  • $\begingroup$ Perc.Dead is a measure of dead stems. Supposedly the Toadbug kills plants. Data is convoluted I was given the data after the experiment was run. I am considered using 2 separate random effect, but have found that Week has var 0. Which I suppose would make sense. Since each bog was measured over multple weeks the week variation is already included in within Bog variation. Thus, I have chosen to make Week a fixed effect (non significant) for the purpose of the study. $\endgroup$ – NicoFish Jun 10 at 19:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.