# Set of data that needs to be weighted to be put on the same scale. Possible with this data?

I've never posted on this forum, so I hope this question is valid...

I have sets of data that are composed of these values (simplified)

data1: 1396.53, 1, 1396.53, 106.85, 1, 55.6949
data2: 370.155, 1, 370.155, 16.2414, 1, 13.3966


The idea is to get the average of each column, then apply a weighting to give each the same scale. For example, the averages come out to be:

Averages: 883.3425, 1, 883.3425, 61.5457, 1, 34.54575


Then the goal would be to apply weights to put each column on roughly the same scale:

(883.3425 * 0.01) + (1) + (883.3425 * 0.01) + (61.5457 * 0.1) + (1) + (34.54575 *0.1)


I'm rather poor with thinking of algorithms, so I cant quite find a systematic way of calculating the weights. I hope this question makes sense and thank you for your help!

-
I'm not sure what your goal is, but if the weights must always be powers of ten, then a natural choice would be to use $10^{-n}$ for the column whose average is between $10^n$ and $10^{n+1}$. That is, $n = floor( log(a) )$, where $log$ is logarithm in base $10$, and $a$ is the average value of that column – Shaun Ault Oct 19 '11 at 2:36
Thank you! Actually, this is for a program I'm writing for practice. :) I tried to make my own ranking algorithm, but while I could figure out the concept on paper, I didnt know how to programmatically figure out to find the appropriate weights. – kurisukun Oct 19 '11 at 2:50
Ok, sounds good. I'll post it as an answer then. – Shaun Ault Oct 19 '11 at 2:55

## 2 Answers

If the weights must always be powers of ten, then a natural choice would be to use $10^{−n}$ for the column whose average is between $10^n$ and $10^{n+1}$. That is, $n=\lfloor \log_{10} a \rfloor$, where $a$ is the average value of the column.

-

You could subtract the average of each column from each data point. Now each column has average $0$. If you want each column to have the same standard deviation ($\sigma$) you can take the standard deviation of each column and divide by that. What is special about powers of $10$? That is an artifact of our notation.

-
My goal is to make each row of equal "importance", therefore I wanted to bring each column down to the same power of ten. I'm not sure if this actually makes sense, but this is how I had approached it...would a standard deviation make more sense? – kurisukun Oct 19 '11 at 3:54
My point is that 10 or powers of 10 isn't special. It is an artifact that we work in base 10. If you love base 10, Shaun Ault's answer works fine. Then if you have a column between 1 and 2 and another between 1 and 10, the second will have more weight. Now it is a question of what you want, not of mathematics. – Ross Millikan Oct 19 '11 at 4:05
I see, thank you for the explanation! I suppose I am mistaken in my logic then. I would like to have equal weighting to each column... – kurisukun Oct 19 '11 at 4:47
@kurisukun: Maybe you want standard scores, as in en.wikipedia.org/wiki/Standard_score Each datapoint is scored by how many standard deviations it is from the average, so this rescales the average and the standard deviation. The bad news is that it overweights points far from the mean if the tails are larger than a Gaussian (which is the normal case for real world data). – Ross Millikan Oct 19 '11 at 4:51