formula: Formula Variables

Description Usage Arguments Details Value See Also

View source: R/formula.R

Description

Transforming a formula object into a list with the variables and their names for the beta regression model of the bayesbr package.

Usage

1

Arguments

formula

symbolic description of the model (of type y ~ x or y ~ x | z;).

data

Data frame with regression observations

Details

The form of the formula used for the Bayesbr package follows the pattern proposed in Formula. The expression y ~ represents that y is the response variable of the beta regression, everything to the right of the ~ operator represents covariates or intercepts for the parameter θ or ζ of the variable response .

The + operator adds one more explanatory covariate for the parameter,the operator : indicates interaction between variables adjacent to the operator, operator * adds the variables adjacent to the operator as covariable and the interaction between them the operator | represents that the next covariates are explanatory for ζ and those that were before the operator are explanatory for θ. So, in the formula y ~ x1 + x2 | x3 + x4 x1 and x2 are the covariates for the parameter θ and x3 and x4 are the covariates of ζ. θ and ζ are parameters of the variable y answer. The numbers 1 and 0 represent, respectively, the presence or not of the intercept in the construction of the model. By default, the intercept is included, so the number 1 is necessary only when the user wants to include only the intercept for the estimation of the parameter in question. Here are some examples:

y ~ 0 | x1: No estimate for θ

y ~ 1 | 0 + x2: The estimation for θ will be made only with the intercept, and the estimation for ζ will not use the intercept only the covariable x2

y~ x3*x4 | x5:x6: The estimation for θ will be with the covariables x3 and x4 and the interaction between them, and the estimation for ζ will be the interaction between variables x5 and x6.

The variables passed to the formula can be environment variables or columns of a dataframe, in which case the dataframe must be informed.

Value

A list containing the following items:

Y

A vector containing the model response variable,

X

A matrix containing the covariates for theta of the model,

W

A matrix containing the covariates of the model for zeta

name_y

The name passed in the call to the bayesbr function for the variable response,

name_x

The name passed in the call to the bayesbr function for the covariates for theta,

name_w

The name passed in the call to the bayesbr function for covariates for zeta.

See Also

bayesbr


bayesbr documentation built on July 17, 2021, 1:07 a.m.