3
$\begingroup$

I specified a random factor smooth in the following way:

gam(Abundance ~ Genus + s(Time, Farm, by = Genus, bs = "fs"), 
                REML = FALSE, data = dat)

Partial output from the smoothing terms was:

                                      edf   Ref.df  F       p-value  
s(Time,Farm):GenusMethanobrevibacter 22.28     49  13.244  <2e-16 ***
s(Time,Farm):GenusOrnithinimicrobium 22.17     49  45.468  <2e-16 ***
s(Time,Farm):GenusRomboutsia         18.86     49  10.507  <2e-16 ***
s(Time,Farm):GenusStaphylococcus     28.65     49 121.492  <2e-16 ***
s(Time,Farm):GenusTuricibacter       17.81     49   6.271  <2e-16 ***

The random smooth is intended to look at farm variability across genera over time. In this way, can the 'edf' be best described as the amount of farm-to-farm variability of each genus over time?

As an example, would if be fair to say that the genus Romboutsia (edf: 18.8) has less farm-to-farm variability over time than the genus Staphylococcus (edf: 28.6)?

$\endgroup$

1 Answer 1

3
$\begingroup$

Not really.

The smooths you show contain more than just deviations between farms, but within farms due to the smooth effects of Time. Which is not what I would call between farm variability; all the farms could have the same smooth Time effect, so no variability differences due to Time, but the EDF will count all the wiggliness of each smooth (even though they are all the same smooth shape) into this EDF value.

You can turn these into variance components using gam.vcomp and for each fs smooth there will be IIRC three variance components:

  1. the random intercepts, which capture how the farms vary in terms of their means of Time
  2. the random slopes, which capture the variance in the random slopes, and
  3. the random smooth components, which captures the variance due to the random smooths
$\endgroup$
3
  • 1
    $\begingroup$ Thanks for the answer. I think there is a typo though: "no no variability differences due to Time". It's a bit confusing so could you clarify what you meant there? $\endgroup$ Jan 17, 2023 at 12:53
  • 1
    $\begingroup$ @ShawnHemelstrand "no no" should have been "so no" $\endgroup$ Jan 17, 2023 at 16:56
  • $\begingroup$ Thanks for the edit! $\endgroup$ Jan 18, 2023 at 1:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.