Interpreting Splines in R using brms package

Dear community,
I am new to splines and I had to utilise it for my master’s thesis.
I’m fitting the following bivariate tensor splines using the brms package in R:

Family: cumulative 
  Links: mu = logit; disc = identity 
Formula: P_friendliness ~ t2(AV, AS) + (1 + AV + AS | Group) 
   Data: Final_AV_AS (Number of observations: 796) 
  Draws: 2 chains, each with iter = 2000; warmup = 1000; thin = 1;
         total post-warmup draws = 2000

Smooth Terms: 
              Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sds(t2AVAS_1)     1.38      1.21     0.05     4.41 1.00     1300     1005
sds(t2AVAS_2)     1.66      1.43     0.07     5.34 1.00     1624     1463
sds(t2AVAS_3)     1.66      1.44     0.07     5.28 1.00     1560     1161

Group-Level Effects: 
~Group (Number of levels: 6) 
                  Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
sd(Intercept)         1.23      0.52     0.59     2.46 1.00      807     1206
sd(AV)                0.43      0.29     0.04     1.15 1.00      811      730
sd(AS)                0.24      0.22     0.01     0.82 1.00     1175     1115
cor(Intercept,AV)    -0.07      0.43    -0.83     0.74 1.00     1984     1409
cor(Intercept,AS)    -0.08      0.48    -0.89     0.85 1.00     2297     1357
cor(AV,AS)           -0.18      0.51    -0.94     0.82 1.00     1799     1331

Population-Level Effects: 
             Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
Intercept[1]    -3.50      0.53    -4.52    -2.38 1.00      815     1113
Intercept[2]    -1.67      0.51    -2.66    -0.62 1.00      770     1116
Intercept[3]     0.44      0.51    -0.52     1.50 1.00      756     1228
Intercept[4]     2.89      0.52     1.88     3.98 1.00      783     1208
t2AVAS_1         0.39      0.24    -0.07     0.86 1.00     1553     1534
t2AVAS_2        -0.81      0.29    -1.37    -0.21 1.00     1404     1014
t2AVAS_3         0.07      0.25    -0.49     0.52 1.00     1940     1632

Family Specific Parameters: 
     Estimate Est.Error l-95% CI u-95% CI Rhat Bulk_ESS Tail_ESS
disc     1.00      0.00     1.00     1.00   NA       NA       NA

Draws were sampled using sampling(NUTS). For each parameter, Bulk_ESS
and Tail_ESS are effective sample size measures, and Rhat is the potential
scale reduction factor on split chains (at convergence, Rhat = 1).


I am not sure how to interpret the population-level effects table.
Additionally, I obtained this plot:

I can infer the relationship between my predictors and the outcome variable from the plot. However, how can I know whether this relationship is indeed supported by the data? Should i refer to the stats in the population-level effects table?

Thanks in advance :)

Hi @Rahaf, I’m sorry your post slipped through the cracks and hasn’t yet been replied to.

Here’s an incomplete attempt to unpack what’s going on. I hope others who have done this more will chime in to add detail and correct any errors.

Intercept[1]-Intercept[4]: These are the “cutpoints” or thresholds for your ordered categories. @Solomon has a nice blog post that illustrates the connection between theory and brms output (albeit using a probit link instead of your logit).

t2AVAS_1 is the marginal smooth term for AV, t2AVAS_2 is the marginal smooth term for AS, and t2AVAS_3 is the marginal smooth term for their “interaction.” Simon Wood’s Generalized Additive Models: and introduction with R discusses how these are constructed in Chapter 5, under 5.6.5 An alternative tensor product construction.

What you do here will vary based on what you want to learn from your model. For descriptive/exploratory analyses, interpreting the figure might be the most straightforward approach. If your goal is prediction, you can use the predict() method on your model or explore the tidybayes::add_*_draws() functions to make probabilistic predictions about the expected value or predicted value. Finally, if your goal is inference, you might want to look into hypothesis(). This is farthest outside my area of expertise, so tread carefully. Hypothesis testing on tensor product splines can be tricky for frequentist approaches, and with a Bayesian approach you’ll need to think carefully about your priors if your model is relying on the defaults.

EDIT: fix format & repeated wording

3 Likes

Thanks a lot! @wpetry
That was quite helpful actually :)