Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • $\begingroup$ I think that the s function in mgcv only includes the term once? e.g. s(time, city) vs te(time,x1) ... I think te(time,x1) includes the main effects of time, the main effects of x1 and the interaction of time and x1.... whereas the s function does not do this. $\endgroup$ Commented Dec 16, 2024 at 8:21
  • 1
    $\begingroup$ That's (your comment) is not correct; te() includes the main effects and interaction $\endgroup$ Commented Dec 16, 2024 at 10:50
  • $\begingroup$ Hi Gavin, thanks for the feedback. Can you please write the mathematical equation corresponding to " gam_beta <- gam( y ~ te(time, x1) + te(time, x2) + s(time, by = city) + s(city, bs = "re"), data = my_data, method = "REML", family = betar(link = "logit") )" if you have time? $\endgroup$ Commented Dec 16, 2024 at 15:09