Hello everyone, I am running two multiple linear regression models where the first one needs to have an interaction term between the dummy variable female (1 = female, 0=male) and a categorical variable beauty. The first model needs to have the interaction term between female and beauty, and the second one between male and beauty. I've read that i.female##c.beauty will give me the interaction term between the two variables but how should I write the regress in order to have an interaction term between female and beauty and male and beauty? I have tried the following: for the model with the interaction term between female and beauty I used regress with 1.female##c.beauty and 0.female##c.beauty for the second model but I don't know if this is the correct way to write it and if this is giving me the results I want. I also don't really understand the difference between # and ##.
Related Posts with Question on interaction terms
counting days between date and another dateDear all, I have 5 subjects who had 5 visits at different dates, I want to create a new variable tha…
Generate difference variable between 2 digits sectors and relevant 3 digits sub-sectors of NACE Rev.2Dear all, I have a data set consisting of Inflation rates relating to 2-,and 3- digit sectors of Na…
Create a Variable in stata that is a value minus it's last month valueHi all, I put some data below, but I have a question about making a varialbe that is it's value min…
Predict and margins after melogit with interactionsHello Statalisters, I am running a mixed effect model in Stata 15.1 using melogit, with weights. I n…
Automating meta-analyses code for several outcomes using metaanHi, I have data for 40 outcomes for 2 studies. I am wondering if there is a way to automate this ra…
Subscribe to:
Post Comments (Atom)
0 Response to Question on interaction terms
Post a Comment