I'm fitting some data to a Logit model in both Mathematica and R and I'm getting slightly different results.
R code:
data = read.table("http://www.rni.helsinki.fi/~kja/epid12/BCG.dat",header=T)
logitmodel = glm(cbind(D,H)~BCG,data=data,family=binomial(link="logit"))
summary(logitmodel)
Mathematica code:
{d, h, bcg, age} =
Transpose@
Rest@Import["http://www.rni.helsinki.fi/~kja/epid12/BCG.dat",
"Data"];
logitmodel =
GeneralizedLinearModelFit[Transpose@{bcg, d/h}, BCG, BCG,
ExponentialFamily -> "Binomial", LinkFunction -> Automatic,
Weights -> d + h]
logitmodel["ParameterTable"]
The results are estimates that are almost the same but differ in a few decimals. For example, the R estimate and standard error for BCG are -0.74152 and 0.12744 respectively. The corresponding Mathematica results are -0.742492 and 0.127755. Am I making a subtle mistake somewhere or is this the result of some numerical approximation?
