A starter SAS user got a little confused on functions and procedures. Thanks for bearing me on this.
Suppose that I have a string of numbers of interval ratio from a survey, but here is the problem. I don't know how to sort it by absolute value. Should I create a variable to contain these absolute values in procedures step or I can have other solutions by using some functions?
Is the following what you are looking to do?
data have;
input x;
cards;
-5
-7
3
-1
4
;
proc sql noprint;
create table want as
select x
from have
order by abs(x)
;
quit;
You've probably posted this in the wrong forum but you should post more info, anyhow, in order for others to know what you are seeking. A small example of your data would help as well as an explanation of what you would ultimately like to accomplish with the data.
For example, I have some numbers gained from the individual survey such as -5 -7 3 -1 4 -6 1 ... and I want to sort them by the power of absolute values then I could chose to display the survey question items by this order.
Is the following what you are looking to do?
data have;
input x;
cards;
-5
-7
3
-1
4
;
proc sql noprint;
create table want as
select x
from have
order by abs(x)
;
quit;
Yes. Thank you so much for helping me out.
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.
Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.
Find more tutorials on the SAS Users YouTube channel.