[R] interacting variables in a formulae in R

Peter Schmidtke pschmidtke at mmb.pcb.ub.es
Wed Jul 15 12:27:17 CEST 2009


Dear R Mailing Subscribers,

I just have a question of how R handles interacting variables in model
creation using glm for instance. 

if I write : 

>>
model=glm(solution~descriptor1+descriptor2+descriptor3,family=binomial(link="logit"))

I should end up with coefficients for a logistic model that I can introduce
easily in the mathematical form of such a model (weighted sum of these
descriptors). 

But how do I have to interpret what R does with interacting terms, like
this? :

>>
model=glm(solution~descriptor1:descriptor2+descriptor3,family=binomial(link="logit"))

What does R with the numerical values of descriptor1 and 2 in order to fit
the data? How I can rewrite the model in a mathematical form?

Thanks in advance.

Best regards.
-- 

Peter Schmidtke

----------------------
PhD Student at the Molecular Modeling and Bioinformatics Group
Dep. Physical Chemistry
Faculty of Pharmacy
University of Barcelona




More information about the R-help mailing list