Learn R Programming

qbrms (version 1.0.1)

model_builder: Interactive Model Builder for qbrms (console)

Description

An interactive assistant that guides users through model specification by asking questions about their data, suggesting appropriate families, helping with prior selection, and building qbrms model code.

Usage

model_builder(data = NULL, response = NULL, predictors = NULL, quiet = FALSE)

Value

An object with class "qbrms_model_spec" containing:

  • formula: The model formula

  • family: A list with name and the constructed family object

  • prior: Prior specifications (if provided)

  • data: The data frame

  • data_name: The symbol used for data in the emitted code

  • model_code: Character string with executable qbrms code

  • response_info: Summary information about the response

Arguments

data

A data frame containing the variables to be modelled (optional). If not provided, the user will be prompted to specify it.

response

Character string specifying the response variable name (optional).

predictors

Character vector of predictor variable names (optional).

quiet

Logical; if TRUE, suppresses welcome messages (default: FALSE).

Examples

Run this code
if (FALSE) {
spec <- model_builder()
fit <- eval(parse(text = spec$model_code))
}

Run the code above in your browser using DataLab