Building models with SAS Enterprise Miner, SAS Factory Miner, SAS Visual Data Mining and Machine Learning or just with programming

absolute value

Accepted Solution Solved
Reply
Contributor mei
Contributor
Posts: 62
Accepted Solution

absolute value

I have a variable, idiorisk which is in positive and negative values.

How do i calculate the absolute value of idiorisk?

is it

absolute_IV=abs(IV);

thanks


Accepted Solutions
Solution
‎04-05-2012 11:08 PM
Super Contributor
Posts: 1,636

Re: absolute value

yes. example:

data have;

input var1;

var2=abs(var1);

cards;

1

-2

3

-4

;

proc print;run;

                              obs    var1    var2

                                 1       1       1

                                 2      -2       2

                                 3       3       3

                                 4      -4       4

View solution in original post


All Replies
Solution
‎04-05-2012 11:08 PM
Super Contributor
Posts: 1,636

Re: absolute value

yes. example:

data have;

input var1;

var2=abs(var1);

cards;

1

-2

3

-4

;

proc print;run;

                              obs    var1    var2

                                 1       1       1

                                 2      -2       2

                                 3       3       3

                                 4      -4       4

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 12268 views
  • 1 like
  • 2 in conversation