Statistical programming, matrix languages, and more

An Error Encoutered in SAS IML for NLPNRA subroutine

Reply
New Contributor
Posts: 3

An Error Encoutered in SAS IML for NLPNRA subroutine

Hi,

I am new in IML computing system and have received the following ERROR (at the end of the code) after submitting the following PROC IML program calling NLPNRA subroutine. Did I make any mistake in the program code. Thank you in advance for your generous assistance in this regard. Mohammad

1    PROC IML;

NOTE: IML Ready

2    *y  age  female;

3    data={1 23 1, 1 20 0, 0 18 0, 1 20 1, 0 25 1, 0 22 0, 0 20 1,

4          1 24 0, 1 20 1, 0 19 0, 0 20 1, 0 24 1, 0 22 1, 0 19 1, 1 20 0};

5    print data;

6

7    y = data[,1];

8    n = nrow(data);

9    x = repeat(1,n,1)||data[,2:3];

10   print n y x;


11   start logLik(B0) global(y,x);

12      beta = j(3,1,0);

13      print beta;

14      beta = B0`;

15      print beta;

16         z=x*beta;

17         print z beta;

18         p=1/(1+exp(-z));

18 !   /* distribution function (f) and density (p) */

19         f=p#p#exp(-z);

20         print p f;

21      logL = sum((y=1)#log(p) + (y=0)#log(1-p));

22      print logL  beta;

23       return ( logL );

24   finish;

NOTE: Module LOGLIK defined.

25   B0=j(1,3,0.01);

26   print B0;

27   opt ={1,4};

28   call nlpnra(rc, xres, "LogLik",B0,opt);

ERROR:  An exception has been encountered.

Please contact technical support and provide them with the following traceback information:


The SAS task name is [IML]

ERROR:  Read Access Violation IML

Exception occurred at (044D7C31)


Task Traceback

Address   Frame     (DBGHELP API Version 4.0 rev 5)

00000000044D7C31  0000000009CCC820  saswob:tkvercn1+0x6BF1

00000000074A9828  0000000009CCC828  sasoda:tkvercn1+0x287E8

00000000074A2E93  0000000009CCC8D0  sasoda:tkvercn1+0x21E53

0000000007490537  0000000009CCC960  sasoda:tkvercn1+0xF4F7

000000000A1EDC07  0000000009CCC968  sasmrk:tkvercn1+0x7CBC7

000000000749031C  0000000009CCCE80  sasoda:tkvercn1+0xF2DC

00000000060D7C58  0000000009CCCE88  sasods:tkvercn1+0x186C18

0000000005F82628  0000000009CCD0E0  sasods:tkvercn1+0x315E8

0000000005F81EA9  0000000009CCD1E0  sasods:tkvercn1+0x30E69

000000000CEBDD58  0000000009CCD1E8  sasinlp:tkvercn1+0xECD18

000000000CE187AE  0000000009CCDEE0  sasinlp:tkvercn1+0x4776E

000000000CE1765F  0000000009CCDFF0  sasinlp:tkvercn1+0x4661F

000000000CDE144D  0000000009CCE060  sasinlp:tkvercn1+0x1040D

000000000CE91178  0000000009CCE2E0  sasinlp:tkvercn1+0xC0138

000000000CDF683A  0000000009CCE3D0  sasinlp:tkvercn1+0x257FA

000000000CDDC249  0000000009CCF500  sasinlp:tkvercn1+0xB209

000000000CDDC891  0000000009CCF530  sasinlp:tkvercn1+0xB851

0000000007E212B4  0000000009CCF538  sasxfnc:tkvercn1+0x274

0000000009AFD163  0000000009CCF5D8  sasiml:tkvercn1+0xC123

0000000009AF260F  0000000009CCFB20  sasiml:tkvercn1+0x15CF

0000000009AF4241  0000000009CCFC50  sasiml:tkvercn1+0x3201

0000000009AF12F7  0000000009CCFCB0  sasiml:tkvercn1+0x2B7

0000000003418FD7  0000000009CCFCB8  sashost:Main+0xF917

000000000341D5FD  0000000009CCFF50  sashost:Main+0x13F3D

00000000775A652D  0000000009CCFF58  kernel32:BaseThreadInitThunk+0xD

00000000777DC541  0000000009CCFF88  ntdll:RtlUserThreadStart+0x21


NOTE: The SAS System stopped processing this step because of errors.

ERROR:  An exception has been encountered.

Please contact technical support and provide them with the following traceback information:


The SAS task name is [IML]

ERROR:  Read Access Violation IML

Exception occurred at (044D7C31)

NOTE: PROCEDURE IML used (Total process time):

      real time           1:06.22

      cpu time            9.67 seconds

SAS Super FREQ
Posts: 3,238

Re: An Error Encoutered in SAS IML for NLPNRA subroutine

The error is that you should not use a print statement in an NLP subroutine.

Delete the PRINT statements and you should get a result.

For more on maximum likelihood estimates in IML, see

Maximum likelihood estimation in SAS/IML - The DO Loop

New Contributor
Posts: 3

Re: An Error Encoutered in SAS IML for NLPNRA subroutine

Very many thanks, Dr. Wicklin. You are correct that opt[2]= does not allow the print command in NLPNRA subroutine as it invokes printing based on the value on opt[2]= (say, 4 in this case). Print statement and opt[2] argument contradict each other and this makes SAS system un-operational (as a result we have to re-start the SAS session). I think this is a technical issue SAS will take care about the matter in future.

Post a Question
Discussion Stats
  • 2 replies
  • 494 views
  • 3 likes
  • 2 in conversation