7 Understanding parameters

In linear modeling, we would like to explain our dependent variable (f0_st) by the effect of Tone and Gender. This can be achieved with a model like

m00_lm = lm(
  F0_st ~ Tone + Gender,
  data = f0_df
)

In GAMs, we can achieve the same by doing the following:

m00_gam = bam(F0_st ~
    Tone + Gender,
    data = f0_df
)

m00_gam assumes that the effect of Tone and Gender is constant over time. In addition, m00_gam introduces bam. bam is a function to compute generalized additive models for very large datasets (maybe an overkill in our toy example, but not so in many real cases). It makes the fitting of GAMs more efficient in these cases.

The previous two methods are essentially the same:

all.equal(as.numeric(fitted(m00_lm)), as.numeric(fitted(m00_gam)))
## [1] TRUE