I am estimating the effect of a continous treatment X (that goes from 0 to 1) on a dependent variable y (data is taken through an experiment).
I have around 250 Individuals in my dataset that can be divided in two, depending on another variable (50 in group 1 and 200 in group). I want to test if the effect of X on Y varies depending on the group to which the individual belongs
so i developed this model
where D is a dummy variable stating if individual i belongs to group 1 and group 2. So basically multiplying x for D I can obtain estimates of of the coefficient of x separately. Finally I performed an F-test to show that B1 and B2 are different from one another. Does it sound right to you? Alternatively, I could run the equation separately for the two groups but I obtain very similar results and the two groups are quite unbalanced..