Have you considered using a generalized additive model? Wikipedia link here
Basically the model would be
$$
g(y) = X'\beta+\displaystyle\sum_j f_j(Z_j)+\epsilon
$$
or in your specific case
$$
B = logit\left(f(S,T)\right)
$$
In R, you could use the mgcv
package, and run something like
library(mgcv)
m = gam(B~te(S,T),family=binomial)
which would give you a nonparametric interaction of the two variables. If you wanted to separate out main effects from the interaction effect, you could equivalently fit
m = gam(B~ti(S)+ti(T)+ti(S,T),family=binomial)
you can then look at contour plots of your estimated interaction via plot(m,pages=1, scheme=2)
(I prefer the contour plots, myself), or you could use the vis.gam
function to look at predicted values.
Or, if your treatment T
is binary, you might fit
m = gam(B~s(S,by=as.factor(T)),family=binomial)
The textbook on all of this is made to go with the R package, and is here this, by Simon Wood.
Also you'll want to check ?te
, ?ti
, etc.