1
$\begingroup$

I have experimental data that looks like this:

RaspberrySample     ProcessingMethod    VirusAssay  MeasuredConcentration
1   Ctrl    A   7.111
1   Ctrl    B   8.408
1   Ctrl    C   8.957
2   New A   6.974
2   New B   8.860
2   New C   8.510
3   Ctrl    A   6.938
3   Ctrl    B   8.526
3   Ctrl    C   8.525
4   New A   6.623
4   New B   8.210
4   New C   8.639

…etc.

These are 40 different raspberry samples that have been artificially contaminated with equal concentrations of three different viruses (A, B, C). For each sample, I have either used processing method “Ctrl” (20 samples) or “New” (20 samples), and then I have measured the concentration of the tree viruses in each sample, using different detection assays. In my analysis I will treat processing method and virus detection assay as fixed effects. The design is balanced.

The aim of the experiment is to see which of the two processing methods that provides the highest measured viral concentration for each specific virus, and to estimate the size of these differences.

I realise that I need to treat “raspberry sample” as a random effect (within-sample measurements are expected to be more similar to each other than between-sample measurements). I am using lmer in R and is quite new to it, so I am wondering if I have set up my model correctly, given the experimental design described above. My model is:

model1 <- lmer(MeasuredConcentration ~ ProcessingMethod * VirusAssay + (1|RaspberrySample), data = pathogens, REML = FALSE)

Then, for pairwise comparison of the different treatment combinations, I use:

library("emmeans")
lsmeans(model1, pairwise ~ ProcessingMethod*VirusAssay, data = pathogens, adjust = "Tukey")

Any comments on this, am I thinking correctly about the random effect here?

$\endgroup$
  • $\begingroup$ You are thinking correctly about the random effect. You may want to look at the intraclass correlation coefficient (ICC) to get a sense of how much variation in viral concentration is between samples of raspberries. It is calculated as (between variance)/(between variance + within variance). Your lmer model looks good as well. The lsmeans looks ok to me, although I'm not too familiar with it. The vignette below suggests you may want to employ the simple contrast method: cran.rstudio.com/web/packages/emmeans/vignettes/… $\endgroup$ – Erik Ruzek Jul 24 at 17:41
  • $\begingroup$ Many thanks for your reply! The link was really helpful! $\endgroup$ – annaspn Jul 26 at 15:12

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.