BookmarkSubscribeRSS Feed
Wen-jun
Calcite | Level 5

 We are students from Taiwan.While practicing SAS, we met some problems on coding IML.

We could not figure out the solution.

The attachment is our code.

The system keeps showing ERROR,but we don't know why.

And we couldn't fix it.

Hope any hero can find the mistake in our coding , and give us some hint. We look forward to receive reply.

5 REPLIES 5
Ksharp
Super User

It looks like you are doing Maximize Likelihood Estimate.

But your code is not completed and you don't give us a sample data to test your code yet ?

And what is your ERROR information ?

Ksharp
Super User

Check Rick's blog , might give you some clue how to do MLE .

 

http://blogs.sas.com/content/iml/2011/10/12/maximum-likelihood-estimation-in-sasiml.html

Wen-jun
Calcite | Level 5

We have already read this website. And referred the code to write our code.  

We guess the attachment code we writed main problem appears in the following part.

 

print Param[c={"R0" "B" "lambda" "simga"} label=""] LogLik;

p = param[1,];
print p;
f = LogLik(p);
print f;
print Param[c={"R0" "B" "lambda" "simga"} label=""] LogLik;

 

In addition, we don't use date to test .

We just use sas to run and revise our code.

We want to make sure our code is correct first.

If possible, wish you could give us more direction to revise our code again.

 

Ksharp
Super User

As I said before, Your code is not completed. It is hard to say something without any data to test.

And you event don't post the ERROR information.

 

Here I found a problem :

1)you have 4 parameter, but you only initiate 2 (p=......)?

2)in your function X have 4 columns, But you only read 2 columns. That is not right.

Ksharp
Super User

Your CON Matrix is not completed. 

Should look like :

 

con = { 0 0 0 0, 
        . . . .};

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

From The DO Loop
Want more? Visit our blog for more articles like these.
Discussion stats
  • 5 replies
  • 1214 views
  • 0 likes
  • 2 in conversation