Learn R Programming

brms (version 0.4.0)

hypothesis: Non-linear hypothesis testing

Description

Perform non-linear hypothesis testing of fixed effects parameters

Usage

hypothesis(x, hypothesis, class = "b", alpha = 0.05, ...)

Arguments

x
An R object typically of class brmsfit
hypothesis
A character vector specifying one or more non-linear hypothesis concerning parameters of the model
class
A string specifying the class of parameters being tested. Default is "b" for fixed effects. Other typical options are "sd" or "cor". If class = NULL, all parameters can be tested against each other, but have to be specified with their full
alpha
the alpha-level of the tests (default is 0.05)
...
Currently ignored

Value

  • Summary statistics of the posterior distributions related to the hypotheses

Details

Currently there are methods for brmsfit objects.

Examples

Run this code
fit_i <- brm(rating ~ treat + period + carry + (1+treat|subject),
             data = inhaler, family = "gaussian")

hypothesis(fit_i, "treat = period + carry")
hypothesis(fit_i, "exp(treat) - 3 = 0")

## perform one-sided hypothesis testing
hypothesis(fit_i, "period + carry - 3 < 0")

# compare random effects standard deviations
hypothesis(fit_i, "treat < Intercept", class = "sd_subject")

## test more than one hypothesis at once
hypothesis(fit_i, c("treat = period + carry", "exp(treat) - 3 = 0"))

Run the code above in your browser using DataLab