Skip to content
Prev 241497 / 398500 Next

Define a glm object with user-defined coefficients (logistic regression, family="binomial")

Hi David,

Thank you very much for your answer. It helps me a lot. The offset 
argument was the key (I didn't understand the description in the R-help 
file)
Rereading my email I found a mistake in the definition of my formula. 
Instead of p(y) = exp(a + c1*x1 + c2*x2), it has to be: p(y) = exp(a + 
c1*x1 + c2*x2)/(1+exp(a + c1*x1 + c2*x2)), but actually that doesn't 
matter much in our case.
Imagine the following. I develop a model on one dataset and want to 
validate it on another. So I could use the coefficents trained on the 
first dataset to define a glm model (named: ModelV) on the second 
dataset. Then i could test this model against a NULL model (named: 
ModelV0) of the second dataset with anova(ModelV, ModelV0, test="Chisq").

Best Wishes
J?rgen