BookmarkSubscribeRSS Feed
ojibous
Calcite | Level 5

Hello, 

 

Please I would love to run this logistic procedure with proc nlin or proc nlimixed, any ideas please? the codes I tried are below. Thanks

 

proc logistic data = rsm1;
model edema (event="1") = DoseA DoseT DoseA*DoseT DoseA*DoseA DoseT*DoseT/link = probit;
output out=pred p=prob;
run;

**This did not work

proc nlmixed data = rsm1; call streaminit(123456);
parms beta0=1 beta1=1 beta2=1 beta11=1 beta12=1 beta22=1 s2=1;
y2 = (beta0 + beta1*DoseA + beta2*DoseT + beta11*DoseA*DoseA
+ beta22*DoseT*DoseT + beta12*DoseA*DoseT);
p = exp(y2)/(1+exp(y2));
model Edema~binary(p);
predict y2 out=y2;
run;

**I'm not getting same results with this:

proc nlin data =rsm1 method=newton;
parms beta0=1 beta1=1 beta2=1 beta11=1 beta12=1 beta22=1;
y2 = (beta0 + beta1*DoseA + beta2*DoseT + beta11*DoseA*DoseA
+ beta22*DoseT*DoseT + beta12*DoseA*DoseT);
p = probnorm(edema);
if (edema = 1) then p = 1-p;
model p=y2;
output out=p p=predict;
run;
3 REPLIES 3
Reeza
Super User
FYI - I updated your subject line to be more descriptive than help. Help is vague and doesn't convey anything about the subject line.
I also edited your post to have the code in code blocks which helps with legibility and makes it easier to copy/paste to run your code.
I also moved your post to the stats forum.
Note that no one can run your code because you have not provided sample data, which means you'll need to wait for someone with expertise in all three procs. If you provide test data, others can attempt to help.

PaigeMiller
Diamond | Level 26

@ojibous wrote:

 

Please I would love to run this logistic procedure with proc nlin or proc nlimixed, any ideas please?


Why? What do you gain by taking PROC LOGISTIC code and getting it to run in another PROC?

This did not work


A lot more information is needed than "This did not work". What didn't work? How do you know? What do you see? Is there an error in the log, or the results are wrong, or both, or something else? Show us the wrong log or the wrong results. SHOW US.

 

**I'm not getting same results with this:


We don't know what you mean again. SHOW US. Although, honestly, I would not expect PROC LOGSITIC and PROC NLIN to produce the exact same results, and I doubt that different results are by themselves are problem.

--
Paige Miller
Ksharp
Super User

Both NLIN and NLIMIXED are for non-linear model.

But Logistic model is linear model , so try PROC GLIMMIX .

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 607 views
  • 0 likes
  • 4 in conversation