Can you fit multiple regression models with categorical predictors?

Can you fit multiple regression models with categorical predictors?

We will fit models with categorical predictors, and use models that allow predictors to interact. The mathematics of multiple regression will remain largely unchanging, however, we will pay close attention to interpretation, as well as some difference in R usage.

How to test for moderation with continuous vs.categorical moderator?

For a continuous moderator we calculate Z a b o v e and Z l o w, calculate their crossproduct with X (e.g., Z A b o v e ∗ X and Z l o w ∗ X) and then run the regression with their combinations of H i g h and L o w with Y. I do not see that the same method above could be applied for a categorical moderator. How can I test that?

How to create interaction between categorical and indicator in Stata?

If you are using Stata, R or SAS you are okay using a factor variable coded 1,2. You need to set your variable as a categorical (known as a factor or indicator in some software packages). From there create your interaction and then run the model. The graph was created in Stata using the “marginsplot” command.

When do interactions between categorical and continuous variables occur?

The more prestigious the job, the greater the gap, as the graph shows. Moral of the story: When there is a statistically significant interaction between a categorical and continuous variable, the rate of increase (or the slope) for each group within the categorical variable is different.

How to properly code a categorical predictor variable?

Properly code a qualitative variable so that it can be incorporated into a multiple regression model. Be able to figure out the impact of using different coding schemes. Interpret the regression coefficients of a linear regression model containing a qualitative (categorical) predictor variable.

How are categorical variables used in linear regression?

Include and interpret categorical variables in a linear regression model by way of dummy variables. Understand the implications of using a model with a categorical variable in two ways: levels serving as unique predictors versus levels serving as a comparison to a baseline.

Are there any other categorical predictors for impurity?

Earlier, we fit a model for Impurity with Temp, Catalyst Conc, and Reaction Time as predictors. But there are two other predictors we might consider: Reactor and Shift. Reactor is a three-level categorical variable, and Shift is a two-level categorical variable.