Standard errors of the response variable in the model

128 views
Skip to first unread message

Vladimir Mikryukov

unread,
Apr 9, 2018, 6:21:13 AM4/9/18
to brms-users
Hello!
I would like to incorporate the standard errors for the response variable into the analysis.
Brms is wonderful package and, to my knowledge, it is the only one capable of doing so.

In general, I would like to fit the following model: `S ~ A + B`
where S is the species diversity estimate, and A & B are experimental factors.

The true diversity is unknown (because of the unseen species), however we can estimate some uncertainty associated with it.
So I can try to use the `S | se(S.SE) ~ A + B` model.

Standard error of S depends on the number of sampled individuals
(the more individuals we sample, the more we should know about the diversity).
In principal, I can try to use `S | se(S.SE, sigma = TRUE) ~ A + B, sigma ~ NumSamples`

Is it a proper way of the analysis or there is something I'm missing?


Here are some dummy data illustrating the structure of my dataset:

datt <- data.frame(
  S
= round(c(rnorm(n = 20, mean = 10, sd = 1), rnorm(n = 20, mean = 15, sd = 1)), 3),
 
NumSamples = sample(x = 20:200, size = 40),
  A
= rep(c("A","a"), each = 20), B = rep(c("B", "b")))

datt$S
.SE <- round(1/datt$NumSamples * 100, 3)


modd
<- brm(
    bf
(S | se(S.SE, sigma = TRUE) ~ A + B, sigma ~ NumSamples),
    data
= datt, family = gaussian(),
    prior
= c(prior(student_t(5,0,10), class = b)))

I really appreciate any help or advice you can provide.
With best regards,
Vladimir

Paul Buerkner

unread,
Apr 10, 2018, 1:36:56 PM4/10/18
to Vladimir Mikryukov, brms-users
The problem I see with this approach is that the standard error is in your example proportional to 1/n, while it is usually proportional to 1/sqrt(n).

Since the main purpose of this seems to be a weighting of each observation(?), have you considered using the weights() instead of the se() argument?

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/brms-users/876903a9-fe7c-4fb9-8e45-56617ba2f7d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vladimir Mikryukov

unread,
Apr 13, 2018, 1:00:58 AM4/13/18
to brms-users
Thanks a lot for your answer!

Unfortunately, I don’t know the relationship of standard error (of the expected diversity estimate) and sample size because it depends on the distribution of species abundances in each sample. I just thought that with this approach it is possible to propagate uncertainty of the response to the model.

Indeed, weighting of observations could be considered as another solution. However, is it OK to use the inverse of the standard error instead of variance which is typically applied?

Paul Buerkner

unread,
Apr 13, 2018, 9:48:42 AM4/13/18
to Vladimir Mikryukov, brms-users
Whether it's "ok" depends on what you want to achieve. It's just another weighting, but generally the inverse variance weighting has good statistical justification.

--
You received this message because you are subscribed to the Google Groups "brms-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to brms-users+unsubscribe@googlegroups.com.
To post to this group, send email to brms-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages