Turn on suggestions

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

Showing results for

Options

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

☑ This topic is **solved**.
Need further help from the community? Please
sign in and ask a **new** question.

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

Posted 08-27-2023 05:08 AM
(122 views)

Hi

I am having a nightmare!!!

I am having an error with part of my code. I believe that I know what is the error message means but I can't figure out how to solve it. I checked everything, I printed every value to make sure that it is well defined and yet once SAS reached that statement, it doesn't execute it!!!

Please help me.

Thank you

proc iml;

seed=22; theta1=0.1; theta2=0.5;

NN=5;

case=1; n1=20; m1=5; k=J(m1,1,0); K[1]=n1-m1;

******************************************************************************;

start Uniform_p(m,R) global(seed);

** The Required Progressively Type-II from U(0,1);

V=J(m,1,0); U=J(m,1,0);W=J(m,1);

Call randseed(seed);

Call randgen(W, "Uniform");

Do i=1 to m;

Sum=0;

Do j=m-i+1 to m;

Sum=Sum+R[j];

End;

Sum=Sum+i;

V[i]=W[i]**(1/Sum);

End;

Do i=1 to m;

U[i]=1-prod ( V[m: (m-i+1)] );

End;

Call sort (U);

return U;

Finish;

********************************************************************;

Start Adaptive(X, T, n, m, R,theta) ;

Do idx=1 to m-1;

If (( X[idx] < T) & (T <= X[idx+1] )) then j=idx;

End;

If X[m]>T then

Do;

W=Uniform_p(m-j,R);

X_m_j = T - theta*log(1-W);

X_Adptive= X[1:j]//X_m_j;

RJ=R((m-j),1,0); RJ[(m-j)]=n-m-sum(R[1:J]);

newR=R[1:J]//RJ;

End;

else

Do;

j= m;

newR=R;

X_Adptive=X;

End;

P1=[X_Adptive,j,newR];

return P1;

Finish;

Do JJ=1 to NN;

X=J(m1,1,0); X_ADP=J(m1,1,0);

X = - theta1 * log (1- uniform_p(m1,K));

T1=X[Floor(4*m1/5)];

AdaptiveResX=Adaptive(X, T1,n1,m1,K,theta1);

X_ADP=AdaptiveResX$1;* This is my Adaptive IIPH that I will use to find MLEs;

J1=AdaptiveResX$2;

newK=AdaptiveResX$3;

print J1 K newK ;

End;

Quit;

1 ACCEPTED SOLUTION

Accepted Solutions

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

The error is

ERROR: Invocation of unresolved module R.

statement : ASSIGN at line 17681 column 1

traceback : module ADAPTIVE at line 17681 column 1

The error occurs because of the invalid statement:

**RJ=R((m-j),1,0);**

The SAS IML language thinks you want to call a function module named R that has three arguments.

I don't know what you intended, but perhaps something like

**RJ=j((m-j),1,0);**

2 REPLIES 2

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

The error is

ERROR: Invocation of unresolved module R.

statement : ASSIGN at line 17681 column 1

traceback : module ADAPTIVE at line 17681 column 1

The error occurs because of the invalid statement:

**RJ=R((m-j),1,0);**

The SAS IML language thinks you want to call a function module named R that has three arguments.

I don't know what you intended, but perhaps something like

**RJ=j((m-j),1,0);**

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

By the way, you can make your posts easier to read and to copy/paste if you use the "Running Man" icon to paste your SAS programs into the post. For example, you can get your code to look like this:

```
proc iml;
seed=22; theta1=0.1; theta2=0.5;
...
QUIT
```

This will make it easier for others to read your questions.

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

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.