Interaction effects in patsy with patsy.dmatrices giving duplicate columns for “:” as with “+” , or “*”
问题 I have a dataframe with columns, both of which I intend to treat as categorical variables. the first column is country , which has values such as SGP, AUS, MYS etc. The second column is time of day, which has values in 24 hour format such as 00, 11, 14, 15 etc. event is a binary variable that has 1/0 flags. I understand that to categorize them , I need to use patsy before running the Logistic regression. This, I build using dmatrices. Usecase : Consider only interaction effects of country &