Hi Peter,
 
Got it! My equivalent SAS code is as follows:
 
proc logistic data=mydata descending;
model resp = price--dehydration3 /link=probit noint;
run;
 
Thanks for the hint about the noint option. That'ts what I was missing.

 
PAul
--- On Fri, 12/3/10, peter dalgaard <pdalgd@gmail.com> wrote:


From: peter dalgaard <pdalgd@gmail.com>
Subject: Re: [R] What is the SAS equivalent of this R glm() code?
To: "Paul Miller" <pjmiller_57@yahoo.com>
Cc: r-help@r-project.org
Received: Friday, December 3, 2010, 4:15 PM



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@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@cbs.dk  Priv: PDalgd@gmail.com




	[[alternative HTML version deleted]]

