Model 3: price = intercept + mpg + weight + gear ratio Model 2: price = intercept + mpg + weight We will fit the following three linear regression models and use hierarchical regression to see if each subsequent model provides a significant improvement to the previous model or not: We can see that the dataset contains information about 12 different variables for 74 total cars. We can get a quick summary of the data by using the following command: First, load the dataset by typing the following into the Command box: We’ll use a built-in dataset called auto to illustrate how to perform hierarchical regression in Stata. Example: Hierarchical Regression in Stata This tutorial provides an example of how to perform hierarchical regression in Stata. We then repeat the process of fitting additional regression models with more explanatory variables and seeing if the newer models offer any improvement over the previous models. If the R-squared (the proportion of variance in the response variable that can be explained by the explanatory variables) in the second model is significantly higher than the R-squared in the previous model, this means the second model is better. Then we fit another regression model using an additional explanatory variable. The basic idea is that we first fit a linear regression model with just one explanatory variable. Hierarchical regression is a technique we can use to compare several different linear models.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
February 2023
Categories |