Extending linear regression to model a continuous outcome using multiple predictor variables.
General Principles
To study relationships between multiple continuous independent variables (e.g., the effect of weight and age on height), we can use a multiple regression approach. Essentially, we extend Linear Regression for continuous variable by adding a regression coefficient \beta_x for each continuous variable (e.g., \beta_{weight} and \beta_{age}).
The model interpretation of the regression coefficients \beta_x is considered for fixed values of the other independent variable(s)β regression coefficientsβi.e., for a given age, \beta_{weight} represents the expected change in the dependent variable (height) for each one-unit increase in weight, holding all other variables (e.g., age) constant.
Example
Below is example code demonstrating Bayesian multiple linear regression using the Bayesian Inference (BI) package. Data consist of three continuous variables (height, weight, age), and the goal is to estimate the effect of weight and age on height. This example is based on McElreath (2018).
We model the relationship between the independent variables (X_{1i}, X_{2i}, ..., X_{[K,i]}) and the dependent variable Y using the following equation:
X_{[1,i]}, X_{[2,i]}, β¦, X_{[K,i]} are the values of the independent variables for observation i.
\beta_1, \beta_2, β¦, \beta_K are the regression coefficients.
\epsilon_i is the error term for observation i, and the vector of the error terms, \epsilon, are assumed to be independent and identically distributed.
Bayesian formulation
In the Bayesian formulation, we define each parameter with priors π. We can express the Bayesian model as follows: