1
$\begingroup$

I'm unsure about the relationship between dispersion estimates (precision^-1) from beta regression models (log link) and the standard deviation.

enter image description here

The left panel is from a glmmTMB model ...

mod <- glmmTMB(
  y ~ poly(x, 2) + (1 + poly(x, 2) || id),
  data = df,
  dispformula = ~ poly(x, 2),
  family = beta_family(link = "logit"),
)

predict(mod, type = "disp")^-1

The right panel are standard deviations for different values of x

df %>%
  group_by(x) %>%
  summarise(sd = sd(x), .groups = "drop")

There is a correspondence between the two, as you would expect, since they both measure spread in the data. But how would you convert one to the other? Exponentiating the dispersion measure produces values in the range of 1.002488 and 1.032853.

$\endgroup$

1 Answer 1

1
$\begingroup$

From ?glmmTMB::beta_family, beta regression in glmmTMB is parameterized so that the variance of the response variable is V=μ(1−μ)/(ϕ+1)

There, μ is the predicted mean value for a set of predictors (predict(mod, type = "response")) and ϕ is the dispersion parameter (sigma(mod)).

You can compute the predicted SD for set of predictors using, eg:

predict(
  mod,
  newdata = data.frame(group = c("a", "b")), 
  type = "response"
) |> 
(\(mu) x * (1 - mu) / (1 + sigma(mod)))() |> 
sqrt()
$\endgroup$

Your Answer

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