LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (July 2010, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 7 Jul 2010 00:02:21 -0400
Reply-To:     Ryan Black <ryan.andrew.black@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Ryan Black <ryan.andrew.black@GMAIL.COM>
Subject:      Re: NLMIXED (Logistic Regression) - Estimate Statements & 95% CIs
In-Reply-To:  <435327.54145.qm@web32408.mail.mud.yahoo.com>
Content-Type: text/plain; charset=ISO-8859-1

Dale,

You are a life saver! Your feedback, as always, is exactly what I needed. I really hope you have time to respond to two follow-up questions:

(1) Let's say the distribution of x is roughly normal for both groups, but there is little overlap between the distributions (e.g. range of x is 0 to 10 for group=0 and 8 to 18 for group=1). In general, when estimating the difference in probabilities would you select a value that is representative of both groups? (e.g. average of shared range = (10+8)/2=9)?

(2) I've opted to treat x as a covariate. Let's say the covariate were a sort of exposure variable (e.g. length of time exposed), how might you treat this covariate within the context of a logistic regression? Would you agree with my decision to treat it as a covariate? If you were to consider this as an offset variable, how would you model it?

I realize these questions are a bit off topic for SAS-L, but I'm very interested in your expert opinion.

As always, I understand if you're too busy to respond.

Hope you're having a good evening.

Ryan

On Tue, Jul 6, 2010 at 11:20 PM, Dale McLerran <stringplayer_2@yahoo.com> wrote: > --- On Tue, 7/6/10, Ryan Black <ryan.andrew.black@GMAIL.COM> wrote: > >> From: Ryan Black <ryan.andrew.black@GMAIL.COM> >> Subject: NLMIXED (Logistic Regression) - Estimate Statements & 95% CIs >> To: SAS-L@LISTSERV.UGA.EDU >> Date: Tuesday, July 6, 2010, 7:40 PM >> Will the estimate statements below yield the correct estimates? >> >> proc nlmixed data=mydata; >> eta = b0 + b1*group + b2*x + u; >> exp_eta = exp(eta); >> p = exp_eta / (1 + exp_eta); >> model y ~ binary(p); >> estimate 'x-adjusted probability for group=0' >> exp(b0+b2) / (1+exp(b0+b2)); >> estimate 'x-adjusted probability for group=1' >> exp(b0+b1+b2) / (1+exp(b0+b1+b2)); >> estimate 'x-adjusted probability difference between groups' >> (exp(b0+b2) / (1 + exp(b0+b2))) >> - (exp(b0+b1+b2) / (1 + exp(b0+b1+b2))); >> random u ~ normal(0,s2u) subject=subject; >> run; >> >> Also, how might I obtain the correct 95% CIs for these >> three estimates? >> >> Thanks, >> >> Ryan >> > > Ryan, > > Whether the above estimate statements produce correct point > estimates depends on a precise statement of what you are > trying to estimate. It could also depend on the distribution > of the covariate X. > > My guess is that the above statements are not what you want. > You probably want estimates of the probability of the response > for groups 0 and 1 at the mean value for the predictor X. > Your estimate statements produce point estimates for the > probability of the response for each of the two groups at the > value X=1. If the data have mean(X)=1 or if there is some > interpretability which is inherent to the value X=1, then > your estimate statements would be correct. > > However, most of the time, one would want to know the mean > value of X in the data that will be employed to fit the model > prior to executing your NLMIXED code. Suppose that you know > that the mean value is 3.28. Then you would construct your > estimate statements as: > > estimate 'x-adjusted probability for group=0' > exp(b0+b2*3.28) / (1+exp(b0+b2*3.23)); > estimate 'x-adjusted probability for group=1' > exp(b0+b1+b2*3.28) / (1+exp(b0+b1+b2*3.28)); > estimate 'x-adjusted probability difference between groups' > (exp(b0+b2*3.28) / (1 + exp(b0+b2*3.28))) > - (exp(b0+b1+b2*3.28) / (1 + exp(b0+b1+b2*3.28))); > > > Equivalent statements which are a little more computationally > efficient would be: > > estimate 'x-adjusted probability for group=0' > 1 / (1+exp(-(b0 + b2*3.23))); > estimate 'x-adjusted probability for group=1' > 1 / (1+exp(-(b0 + b1 + b2*3.28))); > estimate 'x-adjusted probability difference between groups' > 1 / (1 + exp(-(b0 + b2*3.28)))) > - 1 / (1 + exp(-(b0 + b1 + b2*3.28)))); > > > As for "correct confidence intervals", I presume that for > the probabilities of group=0 and group=1, you want to construct > > 1 / (1 + exp(-(b0 + b2*3.28 - 1.96*SE(b0 + b2*3.28))) > 1 / (1 + exp(-(b0 + b2*3.28 + 1.96*SE(b0 + b2*3.28))) > > 1 / (1 + exp(-(b0 + b1 + b2*3.28 - 1.96*SE(b0 + b1 + b2*3.28))) > 1 / (1 + exp(-(b0 + b1 + b2*3.28 + 1.96*SE(b0 + b1 + b2*3.28))) > > > In order to compute these statistics, you would need to write > estimate statements for > > estimate "Logit(group=0)" b0 + b2*3.28; > estimate "Logit(group=1)" b0 + b1 + b2*3.28; > > You can then apply the link function to the confidence limits > of the logit terms. Confidence intervals for the difference > between the two proportions can be gotten employing various > formulae. I really don't know what formula you wish to use, > so cannot really comment on what is the appropriate method > to use. However, unless your probability estimates are near > 0 or 1, then there will probably not be much difference in > the confidence limits obtained for different formulae. The > confidence intervals computed from the estimate statement > for the difference of the two proportions should be pretty > close to CI's obtained employing just about any formula > subject to the caveat about probabilities which are near the > extremes of the distribution. > > Dale > > --------------------------------------- > Dale McLerran > Fred Hutchinson Cancer Research Center > mailto: dmclerra@NO_SPAMfhcrc.org > Ph: (206) 667-2926 > Fax: (206) 667-5977 > --------------------------------------- >


Back to: Top of message | Previous page | Main SAS-L page