Hi
I'm trying to build a regression model to tell me if two input variables are interacting.
Right now I'm doing this:
InteractionModelpVals=sm.OLS(response,covariateMatrix).fit().pvalues
It kind of works, but I created the interaction term as a new variable having the possible values of -3, -2, 2, or 3. This is maybe not the best. Or is that a legit way to create an interaction term?
In R you can literally multiply two terms together to get an interaction term and then stick it in your formula.
interactionTerm<-term1*term2
response~term1+term2+interactionterm
https://www.inkling.com/read/r-cookbook-paul-teetor-1st/chapter-11/recipe-11-6Should I not be using OLS to fit such a model?
Bonus points for explaining to me a good way to incorporate categorical covariates into my models. (Is there a faster way than creating binary dummy variables for each category?)
Thanks!
Chris