BookmarkSubscribeRSS Feed
SquashingOtters
Fluorite | Level 6

Hello everyone, i'm trying to obtain the contour plot of the log-likelihood function of a log-binomial model for some dataset which the log-binomial model fail to obtain the convergence

Here is the code to obtain one of those dataset

 

data nonconv;
infile datalines dsd;
input Y X;
datalines;
0, -1
0, -1
0, 0
0, 0
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
0, 1
1, -1
1, 0
1, 0
1, 0
1, 0
1, 0
1, 0
1, 0
1, 0
1, 0
1, 1
;
And this is the code to obtain the parameter of the model
proc genmod data=nonconv descending;
model Y=X / dist=bin link=log;
store logModel;
run;

 

Unfortunately I can't find how to plot the contour of the log-likelihood, I was trying with the proc plm but i'm not that familiar with this statement.

The plot that i'm trying to obtain is similar to the image below

countors.JPG

4 REPLIES 4
VDD
Ammonite | Level 13 VDD
Ammonite | Level 13

Are you receiving an error message?

 

SquashingOtters
Fluorite | Level 6

Actually I didn't really understand how the proc pml work, and I don't know if it could help me or if there is any better statement

Rick_SAS
SAS Super FREQ

Your example is for a two-parameter model, so I assume b0=Intercept and b1=parameter for X.

 

PROC PLM can construct a graph of the predicted values, but SAS regression procedures do not construct plots of the log-likelihood functions. However, you can construct them yourself by writing down the log-likelihood function. Here are some examples that illustrate the method. None of them are exactly what you need, but they show the basic idea about how to do it.:

The basic idea of optimizing a likelihood function

How to create a contour plot in GTL

How to construct a log-likelihood function

Make a contour plot of a probability density function

 

 

PeterClemmensen
Super User

Remember, PROC SGPLOT supports the VBOX Statement, that will do something similar

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 628 views
  • 3 likes
  • 4 in conversation