I'm fitting a binomial GLM with the following formula:
glm(outcome ~ categorical:continuous:factor)
I would like to see the interaction of categorical and continuous under only the 1st level of 'factor' as well and I have been accomplishing that by subsetting the whole dataset to the 1st level so that 'factor' isn't a variable any more. For clarity the 1st level of factor is the reference level in the above model.
My question is whether I can accomplish the same thing without subsetting i.e. through contrast specification or some other syntax?
My current attempt:
glm(outcome ~ categorical:continuous:(factor == 1stLevel))
But the results don't look like what I'm trying to achieve.
edit I think specifying the formula as follows (in R) works:
glm(outcome ~ categorical:continuous, data = data[data$factor == "1stLevel",])