SOLVED
Elite

# convert from absolute value to percentage

Assume I have a recordset as this :

a1  a2  a3

1     1    2

2     2    1

1     2    1

and I want to convert it from absolute value to percentage so my outcome becomes like this :

a1       a2        a3

25%    25%    40%

50%    25%    40%

25%    50%    20%

Or in other words, for each of my attributes I want to get the sum by attribute, and then for each of the value the percentage.

I thought I would be able to do this with the loop attributes operator but I am not able to select the content so I'm doing something wrong somewhere.

What would be the easiest way to approach this?

2 REPLIES
Elite II

## Re: convert from absolute value to percentage

The percentages in your example don't seem to line up properly, but based on your description, I think the fractional count function in the Aggregate operator does what you want. You just have to specify to group by your primary id variable, so it won't really be aggregating if you have no duplicates in your dataset.  But that's fine.  Note that if you want row percentages rather than column percentages you can do something similar with Generate Aggregation.

Brian T., Lindon Ventures - www.lindonventures.com
Analytics Consulting by Certified RapidMiner Analysts
Highlighted
Regular Contributor

## Re: convert from absolute value to percentage

The Normalize operator has the useful option "proportion transformation" that rescales numeric attributes to be their fractional contribution out of 1. Use Generate Attributes to multiply this by 100 to get a percentage.

Andrew