[R] What is the SAS equivalent of this R glm() code?

peter dalgaard pdalgd at gmail.com
Fri Dec 3 23:15:01 CET 2010


On Dec 3, 2010, at 22:42 , Paul Miller wrote:

>  
>  
> Hello Everyone,
>  
> I'm trying to use SAS to replicate some results obtained in R. I was wondering if anyone call tell me the SAS equivalent of the code that appears below. 
>  
> fm.glm.x <- glm(resp ~ . - 1, data = as.data.frame(mm.x),  
> na.action = na.exclude, family = binomial(link = "probit"))
> summary(fm.glm.x)

Well, you're not saying what "." contains, so no-one can foresee all implications, but the closest parallels are usually found with PROC GENMOD. Something like

  proc genmod data=ingot2;
  model r/n=t / dist=binomial link=probit;
  run;

(shamelessly lifted from a Google search)

Notes: 

- I don't think you can avoid spelling out the list of variables in "."

- "-1" (no intercept) is obtained by adding "noint" after the "/" in the model statement

- for binary regression, I believe you may have to explicitly generate a variable n=1

- beware differences in contrast parametrizations for categorical variables





> 
> Thanks,
>  
> Paul 
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Peter Dalgaard
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list