[R] equivalent to SAS genmod code in R?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Fri Feb 13 21:15:46 CET 2009


Nicole Schneider wrote:
> Hello,
> 
> I have to run a general linear mixed model which looks at 2 dependent
> variables at the same time (var1 divided by var2). I have tryed to search
> for such a kind of model structure but since I just started using R my
> search was not successful. Especielly since I only have an old SAS GENMOD
> code structure from my project supervisor as an indication.
> 
> My question is no, does there exist a code in R which is equivalent to the
> SAS code below?
> 
> PROC GENMOD DATA=X;
> CLASS FLH;
> MODEL BS/OCCUPANCY = distcrop distfor flh distcrop*flh /D=B LINK=LOGIT
> TYPE3; RUN;
> 
> 

Something like

glm(bs/occupancy ~ distcrop*flh+distcrop,
     family=binomial(logit), weights=occupancy)

where flh needs to be a factor.

You do need to read up on the details of glm(), model formulas and such, 
though.


-- 
    O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
   c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
  (*) \(*) -- University of Copenhagen   Denmark      Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)              FAX: (+45) 35327907




More information about the R-help mailing list