# continuous by categorical interaction stata

A c. precedes a continuous variable and an i. precedes a categorical one.

Is it possible to do a categorical * continuous variable interaction?

will do is look at the male-female difference for various values of socst using the margins command. They give the following example: smoker#c.bmi. From there create your interaction and then run the model. Franz demonstrates several sophisticated data management functions and visualization techniques to complement the basic Stata operations that you may have already mastered.

Let’s interpret the coefficients for this model starting with the constant (17.76). model that has a significant two-way interaction of continuous variables. Podcast 285: Turning your coding career into an RPG, Creating new Help Center documents for Review queues: Project overview, Feature Preview: New Review Suspensions Mod UX, Review queue Help Center draft: Triage queue, Stata: Adding an interaction term to a regression, how to regress categorical variables in Stata, Plotting interaction of two continuous variables with lme4 data, Visualising a three way interaction between two continuous variables and one categorical variable in R. Interaction between continuous and categorical variable in R: is there a way to include all categories? Next, we compute the slope for read on math while holding The second block, b3 compares b1 with b3 and are significant for x values less thatn 60. You need to set your variable as a categorical (known as a factor or indicator in some software packages). smoker is a categorical variable, coded as 1 non-smoker, 2 smoker, 3 heavy smoker.

Stata can convert continuous variables to categorical and indicator variables and categorical variables to indicator variables.

Is it best to attack the flat before a hill? Interaction between continuous and categorical variable in R: is there a way to include all categories?

Now, we can plot the simple slopes using the marginsplot command introduced in Stata 12. The difference between males and females may or may not be significantly different for different values of socst. 243 0 obj <>stream Why discrete time signals are defined as sequence of numbers? �� � Qb0

different combinations of values from very low to very high. Making statements based on opinion; back them up with references or personal experience.

You need to set your variable as a categorical (known as a factor or indicator in some software packages). If you are using Stata, R or SAS you are okay using a factor variable coded 1,2. Once again, since the log odds model is a linear model it really doesn’t matter what value the covariate is held at; the slopes do not change. endstream endobj 200 0 obj <. There is a…. Watch courses on your mobile device without an internet connection.

Here's the example of a regression on wages that contains a categorical by categorical interaction effect. What I am thinking of is to do a regression with interaction terms: score = duration + reason + duration * reason. ), Department of Statistics Consulting Center, Department of Biomathematics Consulting Clinic.

I have a multi-group categorical variable.

We will test this using reference contrasts with the margins command. The graph shows that the male/female differences decreases as the value of socst increases. We see that slope 3 is significantly different from slope 1 but is not different from slope 2. We only need two values of math for each value of socst to define the Why are "south" and "southern" pronounced with different vowels? slopes of the dependent variable on the independent variable when the moderator variable is held constant at

the value of the moderator variable, socst, constant at values running from 30 to 75. Download courses using your iOS or Android LinkedIn Learning app.

The graph was created in Stata …

First, when you specify an interaction in Stata, it’s preferable to also specify whether the predictor is continuous or categorical (by default Stata assumes interaction variables are categorical). math is the predictor and socst is the moderator variable. ULibraries Research Guides: STATA Support: 3.7 Interactions of Continuous by 0/1 Categorical variables

), Department of Statistics Consulting Center, Department of Biomathematics Consulting Clinic. *Price may change based on profile and billing country information entered during Sign In or Registration. The coefficient for socst is .6247 which is the slope of the regression line for the male group (i.e., female=0). We will use an example from the hsbdemo dataset that has a statistically significant categorical by continuous interaction to illustrate one possible explanatory approach. ��/� a`�����h� � X Get started with a free trial today. for smoker it is 0.03455 + 0.0245 vs 0.03455 for non-smoker).

199 0 obj <> endobj The results of these interactions are displayed in theses coefficients here. How seriously did romantic composers take key characterizations? The same value for females is 43.26361 as shown in row 11.

This graph is fine but it would look even better if we added in a scatterplot of the observed data points. The continuous predictor variable, socst, is a standardized test score for social studies. The most natural way to do this is to pick a reference group, this time b = 1 and see where the values for b = 2 are different and then the same for b1 versus b3. Both gender and union membership are generally measured as binary variables. Next, we would like to plot these simple slopes for each of the values of socst. The response variable is y, the categorical predictor is b and it is interacted with a continuous predictor x, specified in Stata as c.x. a p-value of 0.032. The graph reaffirms our interpretation of the margins table. How can I explain a continuous by continuous interaction? estimate continuous - categorical interaction Posted 08-19-2015 11:26 AM (3365 views) Hello, Probably a very simple question for the slightly experienced statisticians.