1
$\begingroup$

I have a dataset from an AB test. It shows the conversion rate per treatment group and the categories within each variant.

category     group         converted
green        control       0
green        control       0
green        control       1
blue         control       1
blue         control       0
purple       control       1 
purple       control       1 
yellow       control       1
yellow       control       0
green        treatment     0 
green        treatment     0 
blue         treatment     0
blue         treatment     1
purple       treatment     1
purple       treatment     1
yellow       treatment     0
yellow       treatment     1

I'm putting together a logistic regression to predict the likelihood of conversion as a function of the category + the group. I have about 10K records altogether.

I am encoding the category as is_green (0/1), is_blue (0/1), is_yellow(0/1) and is_purple(0/1). I am encoding the group as group(0/1).

I would like to see the group, but it also looks like there may be some interaction effect going on.

How do I capture the interaction in the logistic model when both variables are encoded?

$\endgroup$
1
$\begingroup$

You can multiply them, just like you would in other models, like linear ones.

Say you have dummy variables $v_1$ and $v_2$, both assuming either $0$ or $1$, and you want to capture their interaction. For this you could create $w=v_1 v_2$ to asses the effect they'd have when the events they represent happen together.

Naturally, you can also include, separately, $v_1$ and $v_2$ and asses their individual effects.

This answer has a much in-depth example of how to interpret the results.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.