Learn R Programming

brms (version 2.1.0)

me: Predictors with Measurement Error in brms Models

Description

Predictors with Measurement Error in brms Models

Usage

me(x, sdx = NULL)

Arguments

x

The variable measured with error.

sdx

Known measurement error of x treated as standard deviation.

Details

For detailed documentation see help(brmsformula).

This function is almost solely useful when called in formulas passed to the brms package.

See Also

brmsformula

Examples

Run this code
# NOT RUN {
# sample some data
N <- 100
dat <- data.frame(y = rnorm(N), x = rnorm(N), sdx = abs(rnorm(N, 1)))
# fit a simple error-in-variables model 
fit <- brm(y ~ me(x, sdx), data = dat, save_mevars = TRUE)
summary(fit)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab