hi: I want to know the math behind the "tm" package findAssocs(). I have found that someone had asked the question before, and have a good explanation by Rick. ?]http://r.789695.n4.nabble.com/findAssocs-td3845751.html?^ But I still don't understand how to calculate the correlation value between the two vectors. For example: # Correlation word2 with word3 cor(c(0,1,1,1,1),c(0,0,1,1,1)) [1] 0.6123724 How does it caculate cor(c(0,1,1,1,1),c(0,0,1,1,1)) to get 0.6123724 ? Eva [[alternative HTML version deleted]]
Rolf Turner
2017-Jul-07 02:57 UTC
[R] [FORGED] How does findAssocs() calculate the correlation value ??
On 07/07/17 13:55, ? ? wrote:> hi: > > I want to know the math behind the "tm" package findAssocs(). > > I have found that someone had asked the question before, and have a good explanation by Rick. > > ?]http://r.789695.n4.nabble.com/findAssocs-td3845751.html?^ > > > But I still don't understand how to calculate the correlation value between the two vectors. > > > For example: > > # Correlation word2 with word3 > > cor(c(0,1,1,1,1),c(0,0,1,1,1)) > [1] 0.6123724 > > > How does it caculate cor(c(0,1,1,1,1),c(0,0,1,1,1)) to get 0.6123724 ?Look in any first year statistics text for the definition of correlation. cheers, Rolf Turner -- Technical Editor ANZJS Department of Statistics University of Auckland Phone: +64-9-373-7599 ext. 88276