Maybe I need express my question again: In n points of observation, we gain X(x1, x2, ..., xn), Y(y1, y2, ..., yn) and Z(z1, z2,..., zn). We want to calculate the similarity among X, Y and Z.
If by similarity you mean co-linearity between variables I would recommend reading the following paper by Gollini et al which outlines the usage of the GWModel package in R and works through some simple examples
While you may not be directly interested in Geographical Weighted Regression (GWR). Problems modelling due to co-linearity between input variables are exaggerated when applying GWR and the GWModel package has a number of tools to help you assess co-linearity and identify which variables to select or dismiss on this basis.
Paper: Gollini et al: http://arxiv.org/pdf/1306.0413.pdf
R Package: http://cran.r-project.org/web/packages/GWmodel/index.html
Samples X, Y, Z can be considered to be similar if their various means and variances are similar for specified levels of significance (LoS). Let the sample sizes be nx, ny, nz.... respectively.
(1) Similarity of means: Samples X and Y can be considered to have the same means if Z < Zcr
where Z = |Xm-Ym|/[Sx2/nx+Sy2/ny]0.5...............(1)
Xm, Ym are the sample means; Sx, Sy are the sample standard deviations. If nx and ny are not small then Zcr = 1.96 at LoS of 0.05 and Zcr = 2.58 at LoS of 0.01.
(2) Similarity of variances: Samples X and Y can be considered to have the same variance by using the F test whereby
F = Sx2/Sy2 < Fcr (nx-1, ny-1) ..................(2)
nx-1 and ny-1 are known as the degrees of freedom. F should be > 1, that is Sx should be > Sy. Fcr can be obtained from tables of F-distribution and it depends on the selected LoS and the degrees of freedom nx-1, ny-1.