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

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

Posted 06-11-2014 05:29 AM
(891 views)

The matrix r is (2*t-1)*(2*t-1) but is it empty..may you help me?

Besides, I need to start the do from a negative number is this o.k.??

This is the program:

proc iml;

t=15;

a=2*t;

r=j(a-1,a-1,.);

do i= (1-t) to (t-1);

do j= (1-t) to (t-1);

az1= -(j-i);

az2= -(j-i);

bz1= -(j-i);

bz2= (j-i);

cz1= (j-i);

cz2= (j-i);

if j<0 then z1=az1;

z2=az2;

if j=0 then z1=bz1;

z2=bz2;

if j>0 then z1=cz1;

z2=cz2;

r[i,j]=probnorm(z2)-probnorm(z1);

end;

end;

print r;

quit;

Thanks in advance.

Waiting for your reply.

4 REPLIES 4

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

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

Thanks for your help.

I have just tried what you suggested. The matrix is now filled with numbers but they are not correct.

Why did you suggested putting (+t)?

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

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

Since we don't know what numbers are correct, you need to tell us what you expect or give an example for t=3.

The correctness of the program depends on z2 and z1. You can check their correctness with the following:

1) Outside the loop, allocate

Lower=j(a-1,a-1,.);

Upper=j(a-1,a-1,.);

2) Within the loop, define

Lower[i+t,j+t] = z1;

Upper[i+t,j+t] = z2;

3) Print Lower and Upper after the loop.

BTW, since the normal CDF is effectively zero when z<-6 and is 1 when z>6, you can probably get by with a smaller value of t. In any case, switch from PROBNORM(z) to CDF("Normal",z), as suggested at the end of this article: Six reasons you should stop using the RANUNI function to generate random numbers - The DO Loop

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.