Not applicable
Posts: 0

# Finding max and min of predicted Y

I'm running linear probability model, thus I need to show that all possible values of Y are between 0 and 1. How can I find the min and max of predicted values in proc iml?
Regular Contributor
Posts: 170

## Re: Finding max and min of predicted Y

Brentos;
Normally you can output the set within the proc function with the output out=p p=yhat (p is an arbitrary designation) statement with the predicted values by using the p=yhat . From there, you can transpose the set and use the functions min,max, etc...
See code below.

If there are more efficent methods I would be game to hear them. Hope this helps you.

data X1;
set p;
x=compress('x'||_n_);
run;

proc transpose data=X1 out=descstats;
id x;
var predicted;
run;

data descstats;
set descstats;

min1=min(of x1-x?);
max1=max(of x1-x?);
run;

proc print;
var min1 max1;
run;
Not applicable
Posts: 0

## Re: Finding max and min of predicted Y

Thanks a lot. It did the trick.
Discussion stats
• 2 replies
• 172 views
• 0 likes
• 2 in conversation