0
returns,   sharpe, risk,        volatibility
7.433193 ,   0.94 ,   6 ,            7.75
14.214304 ,  1.18 ,   7  ,           12.13
13.948246  , 1.22 ,   7  ,          11.73
12.372482 ,  0.74 ,   7  ,          12.37
3.099133 , -0.64 ,   4  ,           9.10
6.860875 , -0.08 ,   4  ,            4.27

I've some data above.

Returns is the response.

Other variables are the predictors.

I wish to apply the principles of MDS in R.

I google MDS in youtube and internet, and it seems that data needs to be "mean in distance".

How to I make the data above in "distance mean" and apply MDS ?

I am a novice here.

(Please ignore the comma as this is a csv file, the comma is use in this question to allow you to see data in specific column)

akrun
  • 874,273
  • 37
  • 540
  • 662
James Lim
  • 1
  • 2
  • You need a distance matrix, see the `dist` function from the `stats` package. Quick demo: http://www.r-bloggers.com/multidimensional-scaling-with-r-from-mastering-data-analysis-with-r/ – daroczig Jan 09 '16 at 07:41
  • the articles I read before. They have already calculated the dist function. What I am interested is how to convert the RAW data into dist function – James Lim Jan 10 '16 at 03:18
  • @james-lin as said, use the `dist` function to compute the distance matrix for your data, eg `dist(mtcars)`that you can pass to MDS such as `cmdscale(dist(mtcars))` -- not sure what's not clear to you or what do I miss from your question. – daroczig Jan 10 '16 at 05:06

0 Answers0