[R] Binomial GLM in Stata and R

Ben Bolker bbolker at gmail.com
Wed Nov 20 22:45:00 CET 2013


Floor Biemans <floor_biemans <at> hotmail.com> writes:

[snip]

> The stata code I have is:
> 
> glm c IndA fia, family(binomial s) link(cloglog) offset(offset)
> 
> The R code is:
> 
> glmt <- glm(data=dataset, c ~ IndA + fia, offset = offset, family =
binomial(link = cloglog))
> 
> Which yields different results from the Stata output.
>  I think the difference is in the variable s that is
> included in the binomial family in Stata (bold in the code).
>  How can I incorporate this variable in the R
> code?  

Cross-posted to stack overflow:

http://stackoverflow.com/questions/20094074/reproduce-stata-code-in-r-binomial-glm/20094514#20094514

glmt <- glm(data=dataset, cbind(c,s-c) ~ IndA + fia, 
    offset = offset, family = binomial(link = cloglog))



More information about the R-help mailing list