Date: Tue, 28 Oct 2008 18:16:42 -0700
Reply-To: shiling99@YAHOO.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Shiling Zhang <shiling99@YAHOO.COM>
Organization: http://groups.google.com
Subject: Re: Twelve procedures to do logistic regression in SAS
Content-Type: text/plain; charset=ISO-8859-1
Here is an example using proc model. The results matches with those
from proc logistic.
data t1;
do i =1 to 1000;
x=rannor(123);
y=1+x<rannor(123);
output;
end;
run;
proc logistic data=t1;
model y=x/link=probit;
run;
proc model data=t1;
xbeta=a+b*x;
p=probnorm(xbeta);
y=p;
if y=1 then e=1-p;
else e=p;
loge=-2*log(e);
errormodel y ~ general(loge);
fit y;
run;
quit;
On Oct 27, 12:32 pm, Oliver.K...@medizin.uni-halle.de wrote:
> Hello all,
> I have been interested in the logistic regression model for some years
> now. As SAS was always my preferred statistical software, some SAS
> code to fit logistic regression models accumulated over the years.
> Actually I found 12 different SAS procedures (LOGISTIC, GENMOD,
> PROBIT, GAM, LIFEREG, GLIMMIX, QLIM, NLMIXED, NLIN, IML, MDC, PHREG)
> which were able to fit a simple logistic model.
>
> I collected the codes and the data set on my website (http://www.oliverkuss.de/science/software/Twelve_procedures_to_do_logistic_r...)
>
> The data set is from a project which I conducted with Dr. Stefan
> Rimbach from the Gynecology Department of the University of
> Heidelberg, Germany. The sample consisted of 162 women who wanted to
> become pregnant and were observed at the department. The response was
> pregnancy within the first 3 years of observation and the covariates
> were age at baseline (AGE), years of infertility at baseline (INFER),
> and a physiological tube defect (TUBPHYSD).
> All of the above mentioned procedures below do reproduce exactly the
> result from a simple maximum likelihood fit in terms of the parameter
> estimates and their standard errors, which are
>
> Intercept 2.0117 (1.3734)
> AGE -0.0510 (0.0422)
> INFER -0.1409 (0.0791)
> TUBPHYSD -0.8880 (0.4284)
>
> Though I certainly agree that PROC LOGISTIC is sufficient for most
> practical cases, some additional things can be learned from the other
> procedures. For example, PROC QLIM and PROC MDC have a number of R-
> Square-measures (note that PROC QLIM has the correct ones, because
> PROC MDC is maximizing a partial likelihood), PROC GENMOD, PROC
> LIFEREG, PROC GLIMMIX and PROC NLMIXED give additional information
> criteria, PROC PROBIT gives inverse probabilities, or it might be
> instructive to look at the actual fitting algorithm in PROC IML. PROC
> QLIM gives estimates of marginal effects and PROC NLMIXED allows the
> estimation of nonlinear contrasts. Finally, you can use PROC GENMOD
> (with the REPEATED statement) to get robust standard errors.
>
> I am curious if you could find some more PROCs to do the job. For
> example, I did not succeed with the MODEL and the SURVEYLOGISTIC
> procedure.
>
> Hope you enjoy it,
> Oliver
|