Measurement error corrected hierarchical model in brms

#1
  1. Have you released a vignette yet on measurement error using the brms package? I am trying to do a multilevel measurement error model but within a hierarchical structure.

The hierarchy is over time (year_cat5) and the measurement error is on the variable “Q” which we are using to explain the investment rate of firms (inv_rf).

  1. In, principle, in this formulation, for a hierarchical measurement error model in brms correct?

Family: student

Links: mu = identity; sigma = identity; nu = identity

Formula: inv_rf ~ me(Q_manual, Q_sd) + cashflow_rf + (1 + me(Q_manual, Q_sd) + cashflow_rf | year_cat5) + capital_output + fic_advanced_nousa

Data: data_STAN_lender_sam (Number of observations: 584)

Samples: 3 chains, each with iter = 4000; warmup = 2000; thin = 1;

total post-warmup samples = 6000

I ask because when adding the hierarchical structure the impact of the measurement error vanishes basically, Ie when running a ‘fixed effects’ measurement error it makes a big difference; but the hierarchical measurement error makes little difference.

  1. One issue is that I have a large dataset (360,000 data points. But it doesn’t seem to work with more 10,000 points or so. Understandable given that every datapoint will now be treated as an unknown parameter. What do you recommend to try work around this?

Best wishes,

our question:

  • Operating System:
  • brms Version:
1 Like

#2
  1. Not yet. I am still waiting for measurement models to be implemented in brms (version 3.0 as it currently stands) and then perhaps combine it into one vignette.

  2. The specification looks reasonable to me.

  3. You could try overimputation to incorporate the measurement error for instance via the micemd package and then pass the results to brm_mutiple. This will require fitting the model multiple times
    but at least each model will run considerably faster.

0 Likes