-2

I've scaled my variables before using k means clustering. Now I want to be able to analyze these clusters. How do I bring the variables back to the original scale. I've used the following codes:

Scaled the numeric variables

Data$scaledVariable=scale(Data$Variable)

Attach the scaled variables to a data frame and make computations on that.

new_data=data.frame(Data$scaledVariable,Data$scaledVariable2,Data$scaledVariable3)

Hope this is more descriptive.

  • Please share your code in an reproducible example. For e.g. `scale()` funciton the scaling parameters "(if any) are returned as attributes `scaled:center` and `scaled:scale`". – m-dz Nov 01 '16 at 11:04
  • 1
    Ciao! Welcome to SO. First of all you should read [here](http://stackoverflow.com/help/how-to-ask) about how to ask a good question; a good question has better likelihood to be solved and you to receive help. On the other hand a read of [this](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) is also good thing. It explains how to create a reproducible example in R. Help users to help you by providing a piece of your data, a desired output and things you have already tried. – SabDeM Nov 01 '16 at 11:25

1 Answers1

0

Depends on how you scaled. Not all transformations are reversible.

Assuming that you used a linear scaling, it's fairly trivial how to do the inverse transformation. Just recall that you did y=B(x-a). Solve this equation for x: x=(B^-1 y)+a To do thid, you need to remember a and B, which co pletely describe your linear transformation.

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194