stats.SimilarityOfVectors | R Documentation |
A weighted similarity measure between two numeric vectors.
stats.SimilarityOfVectors(weights, final, initial)
weights |
Vector of weights for each observation. |
final |
Vector of numbers. |
initial |
Vector of numbers. |
A percentage of similarity between the two numeric vectors.
library(goal)
weights=c(0.5, 0.25, 0.25)
final=c(42,5,36)
initial=c(40,5,36)
plot(final, initial, cex=weights*2, col="red",
xlim=range(initial, final), ylim=range(initial, final))
abline(0,1)
per = goal::stats.SimilarityOfVectors(weights, final, initial)
print(per)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.