Testing hypotheses in models with measurement error

I have a model like the following:

m <- brm(y | se (ySE) ~ 1 + me(x, sdx = xSE), d, family=gaussian, save_mevars = T,
prior=prior, sample_prior = T, etc)

I am a bit at a loss as to how to test the hypothesis that the relation between x and y is positive.

hypothesis(m, “x > 0”)
understandably gives a “Error: Some parameters cannot be found in the model”.
however, even using the predictor from the model summary fails with the same error:
hypothesis(m, “mexsdxEQxSE > 0”)

How should I specify the command?

The class of these parameters is bsp not b. You see that when running parnames(m). I understand that’s possibly confusing, but I can’t change it until brms 3.0 and even then I am undecided whether to allign all these effects to have class b.

Thanks! It makes sense. Maybe just an example with sbp in the help file would suffice, instead of a change of class.

Hi Paul,

Is it now possible to test hypotheses about effects with measurement error in brms using hypothesis()?

Best wishes,

Ladislas

Yes it is. What code did you try that didnt work?

I have tried hypothesis(model, "bsp_meesT1seT1 = 0") where esT1 is the name of the predictor with known measurement error.

It throws out the following error message: Error: Some parameters cannot be found in the model: 'b_bsp_meesT1seT1'

I have also tried replacing bsp_meesT1seT1 with esT1 or meesT1 without much more success…

Add class = “”

2 Likes

Aaah my bad, I should have read the doc… my apologies for digging up this old thread. Thank you!