Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Home
- /
- Programming
- /
- Graphics
- /
- Contour Plot of the Log-Likelihood

Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 12-02-2018 04:16 PM
(627 views)

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

4 REPLIES 4

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Are you receiving an error message?

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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

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. **

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.