Title: | Probability Models for Ranking Data |
---|---|
Description: | Descriptive statistics (mean rank, pairwise frequencies, and marginal matrix), Analytic Hierarchy Process models (with Saaty's and Koczkodaj's inconsistencies), probability models (Luce models, distance-based models, and rank-ordered logit models) and visualization with multidimensional preference analysis for ranking data are provided. Current, only complete rankings are supported by this package. |
Authors: | Paul H. Lee and Philip L. H. Yu |
Maintainer: | Paul H. Lee <[email protected]> |
License: | GPL-2 |
Version: | 1.2.5.1 |
Built: | 2024-10-31 20:28:02 UTC |
Source: | CRAN |
Computing the weights, Saaty's (1977) and Koczkodaj's (1997) inconsistencies for analytic hierarchy process (AHP).
ahp(dset, sim_size=500)
ahp(dset, sim_size=500)
dset |
an “A” matrix. It should be a square matrix with diagonal values equal 1 and $a_ij = 1/a_ij$. |
sim_size |
simulation size for computation of Saaty's inconsistency. Default is 500. |
weighting |
Eigenvalues of the criteria. |
Saaty |
Saaty's inconsistency. |
Koczkodaj |
Koczkodaj's inconsistency. |
Paul H. Lee and Philip L. H. Yu
Koczkodaj, W. W., Herman, M. W., and Orlowski, M. (1997) Using consistency-driven pairwise comaprisons in knowledge-based systems. Proceedings of the sixth international conference on information and knowledge management, ACM Press, 91-96.
Saaty, T. L. (1980) The Analytic Hierarchy Process. McGraw-Hill, New York.
Saaty, T. L. (1977) A scaling methods for priorities in hierarchical structure. Journal of Mathematical Psychology, 15, 234-281.
## create an artificial A matrix abc, example taken from Koczkodaj et al. (1997) abc <- matrix(data = 1:16, nrow = 4, ncol = 4, byrow = TRUE) abc[1,1] <- 1 abc[1,2] <- 2 abc[1,3] <- 5 abc[1,4] <- 4 abc[2,1] <- 1/2 abc[2,2] <- 1 abc[2,3] <- 3 abc[2,4] <- 1.9 abc[3,1] <- 1/5 abc[3,2] <- 1/3 abc[3,3] <- 1 abc[3,4] <- 0.7 abc[4,1] <- 1/4 abc[4,2] <- 1/1.9 abc[4,3] <- 1/0.7 abc[4,4] <- 1 ## compute the weights, Saaty's and Koczkodaj's inconsistencies ## ahp(abc)
## create an artificial A matrix abc, example taken from Koczkodaj et al. (1997) abc <- matrix(data = 1:16, nrow = 4, ncol = 4, byrow = TRUE) abc[1,1] <- 1 abc[1,2] <- 2 abc[1,3] <- 5 abc[1,4] <- 4 abc[2,1] <- 1/2 abc[2,2] <- 1 abc[2,3] <- 3 abc[2,4] <- 1.9 abc[3,1] <- 1/5 abc[3,2] <- 1/3 abc[3,3] <- 1 abc[3,4] <- 0.7 abc[4,1] <- 1/4 abc[4,2] <- 1/1.9 abc[4,3] <- 1/0.7 abc[4,4] <- 1 ## compute the weights, Saaty's and Koczkodaj's inconsistencies ## ahp(abc)
Ranking of 4 English Premier League teams from season 1992-1993 to 2012-2013.
data(big4)
data(big4)
A data frame with 18 observations on the following 5 variables.
Arsenal
the rank of team "Arsenal"
Chelsea
the rank of team "Chelsea"
Liverpool
the rank of team "Liverpool"
Manchester.United
the rank of team "Manchester United"
n
number of observations
The comparative performance of the "Big Four" since the start of the English Premier League.
Wikipedia. (2013) http://en.wikipedia.org/wiki/Premier_League
Wikipedia. (2013) http://en.wikipedia.org/wiki/Premier_League
data(big4) ## maybe str(big4) ; plot(big4) ...
data(big4) ## maybe str(big4) ; plot(big4) ...
Ranking of 4 breast cancer categories of 106 observations. The original dataset was a categorical one, and it was converted to the current ranking dataset by sorting the expected probabilities (computed by fitting a stepwise logistic regression) of the 4 categories.
data(breasttissue)
data(breasttissue)
A data frame with 106 observations on the following 4 variables.
adi
the rank of category "adipose"
car
the rank of category "carcinoma"
con
the rank of category "connective"
new
the rank of cateogry "fibro-adenoma, mastopathy or glandular"
The rankings were generated by first fitting a stepwise logistic regression to the original dataset, and then sorted by the expected probabilities of the 4 categories.
Frank, A., Asuncion, A. (2010) UCI Machine Learning Repository. http://archive.ics.uci.edu/ml
Jossinet, J. (1996) Variability of impedivity in normal and pathological breast tissue. Medical and Biological Engineering and Computing 34, 346-350.
da Silva, J. E., de Sa, J. P., Jossinet, J. (2000) Classification of breast tissue by electrical impedance spectroscopy. Medical and Biological Engineering and Computing 38, 26-30.
data(breasttissue) ## maybe str(breasttissue) ; rankagg(breasttissue) ...
data(breasttissue) ## maybe str(breasttissue) ; rankagg(breasttissue) ...
Distance-based Models for ranking data. The distance-based models assume that rankings closer to the modal ranking are more likely to be observed.
dbm(dset, dtype="tau")
dbm(dset, dtype="tau")
dset |
a ranking dataset |
dtype |
type of distance between two rankings. tau : Kendall's tau, rho : Spearman's rho, rho2 : Spearman's rho square, foot : footrule |
Fit the distance-based models for the dataset and return a mle object. Standard methods on mle (e.g., @coef, @vcov) apply. The modal ranking and the Chi-square residual are given in the output.
Paul H. Lee and Philip L. H. Yu
library(pmr) ## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the distance-based model with Spearman's rho distance ## dbm(test,dtype="rho")
library(pmr) ## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the distance-based model with Spearman's rho distance ## dbm(test,dtype="rho")
Computing the descriptive statistics (mean rank, pairs matrix, and marginals matrix) of a ranking dataset.
destat(dset)
destat(dset)
dset |
a ranking dataset (aggregated) |
mean.rank |
Mean rank of the items. |
pair |
The number of observations which the first item (row) is more preferred than the second item (column). |
mar |
The number of observations which the item i (row) is ranked j (column). |
Paul H. Lee and Philip L. H. Yu
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## compute the descriptive statistics of the artificial dataset ## destat(test)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## compute the descriptive statistics of the artificial dataset ## destat(test)
Ranking of 5 items according to the similarity with the word "idea".
data(idea)
data(idea)
A data frame with 98 observations on the following 6 variables.
X1
the rank of word "thought"
X2
the rank of word "play"
X3
the rank of word "theory"
X4
the rank of word "dream"
X5
the rank of word "attention"
n
number of observations
98 college students were asked to rank five words according to the similarity with the word "idea". The five words were (1) thought, (2) play, (3) theory, (4) dream, and (5) attention.
Fligner, M. A., and Verducci, J. S. (1986) Distance based ranking models. Journal of the Royal Statistical Society Series B, 48(3), 359-369.
Fligner, M. A., and Verducci, J. S. (1986) Distance based ranking models. Journal of the Royal Statistical Society Series B, 48(3), 359-369.
data(idea) ## maybe str(idea) ; plot(idea) ...
data(idea) ## maybe str(idea) ; plot(idea) ...
Ranking of 3 items according to the preference of the group in an activity.
data(leisure.black)
data(leisure.black)
A data frame with 13 observations on the following 4 variables.
X1
Male
X2
Female
X3
Both
n
number of observations
13 black women, aged 70-79, were asked whom they would prefer to spend their leisure time.
Hollander, M. and Sethuraman, J. (1978) Testing for agreement between groups of judges. Biometrika, 65, 403-411.
Marden, J. I. (1995) Analyzing and Modeling Rank Data. Chapman and Hall.
data(leisure.black) ## maybe str(leisure.black) ; plot(leisure.black) ...
data(leisure.black) ## maybe str(leisure.black) ; plot(leisure.black) ...
Ranking of 3 items according to the preference of the group in an activity.
data(leisure.white)
data(leisure.white)
A data frame with 14 observations on the following 4 variables.
X1
Male
X2
Female
X3
Both
n
number of observations
14 white women, aged 70-79, were asked whom they would prefer to spend their leisure time.
Hollander, M. and Sethuraman, J. (1978) Testing for agreement between groups of judges. Biometrika, 65, 403-411.
Marden, J. I. (1995) Analyzing and Modeling Rank Data. Chapman and Hall.
data(leisure.white) ## maybe str(leisure.white) ; plot(leisure.white) ...
data(leisure.white) ## maybe str(leisure.white) ; plot(leisure.white) ...
Predict the ranking of a group of judges based on a training dataset with rankings and covariates. First, for each judge, the k-nearest neighbors (by Euclidean distance) are selected. Second, the prediction of rankings are done based on the rankings of these neighbors. Users can chooce two methods of prediction: by mean rank or by Luce model.
local.knn(dset,covariate.test,covariate,knn.k=1,method="mean")
local.knn(dset,covariate.test,covariate,knn.k=1,method="mean")
dset |
a ranking dataset for training the k-nearest neighbor. |
covariate.test |
the covariates of the judges to be predicted. |
covariate |
the covariates of the rankings. |
knn.k |
the number of nearest neighbors to be included. The default value is 1. |
method |
the prediction method. mean : mean rank, pl : Luce model |
Paul H. Lee and Philip L. H. Yu
Cheng, W., Dembczynski, K., Hullermeier, E. (2010). Label ranking methods based on the Plackett-Luce model. Proceedings of ICML 2010.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) co <- c(6,5,4,3,2,1) co.test <- 1.2 train <- data.frame(X1,X2,X3) ## local k-nearest neighbor method of the artificial dataset ## local.knn(train,co.test,co)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) co <- c(6,5,4,3,2,1) co.test <- 1.2 train <- data.frame(X1,X2,X3) ## local k-nearest neighbor method of the artificial dataset ## local.knn(train,co.test,co)
Local k-nearest neighbor method with the parameter k determined using cross-validation error (defined as the sum of Kendall's distance).
local.knn.cv(dset,covariate.test,covariate,cv=10,k.max=20,method.cv="mean")
local.knn.cv(dset,covariate.test,covariate,cv=10,k.max=20,method.cv="mean")
dset |
a ranking dataset for training the k-nearest neighbor. |
covariate.test |
the covariates of the judges to be predicted. |
covariate |
the covariates of the rankings. |
cv |
the number of cross-validated samples. The default value is 10. |
k.max |
the maximum number of nearest neighbors to be tested. The default value is 20. |
method.cv |
the prediction method. mean : mean rank, pl : Luce model |
Paul H. Lee and Philip L. H. Yu
Cheng, W., Dembczynski, K., Hullermeier, E. (2010). Label ranking methods based on the Plackett-Luce model. Proceedings of ICML 2010.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) co <- c(6,5,4,3,2,1) co.test <- 1.2 train <- data.frame(X1,X2,X3) ## local k-nearest neighbor method of the artificial dataset ## local.knn.cv(train,co.test,co)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) co <- c(6,5,4,3,2,1) co.test <- 1.2 train <- data.frame(X1,X2,X3) ## local k-nearest neighbor method of the artificial dataset ## local.knn.cv(train,co.test,co)
Display a 2D plot of the position of both judges and items. The items are labeled with consecutive numbers 1, 2, ..., k while the judges are presented as vectors pointing from the origin to their most preferred items.
mdpref(dset,rank.vector=FALSE,ndim=2)
mdpref(dset,rank.vector=FALSE,ndim=2)
dset |
a ranking dataset |
rank.vector |
The vectors of the rankings at default will be displayed if the value is set to TRUE. |
ndim |
The number of dimensions extracted from the singular value decomposition. |
Multidimenional preference analysis is a dimension reduction technique which aims to project the high-dimensional ranking data into 2D or 3D plot. Dimension reduction is done using singular value decomposition. Note that the perpendicular projection of the item points onto a judge vector represents the ranking of these items by this judge.
item |
Coordinates of the items. |
ranking |
Coordinates of the rankings. |
explain |
Proportion of variance explained by the number of dimensions specified. |
Paul H. Lee and Philip L. H. Yu
Carroll, J. D. (1972) Individual differences and multidimensional scaling. In Shepard, R. N., Ronney, A. K., and Nerlove, S. B. (eds.)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## multidimensional preference analysis of the artificial dataset ## mdpref(test,rank.vector=TRUE)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## multidimensional preference analysis of the artificial dataset ## mdpref(test,rank.vector=TRUE)
phi-component Models for ranking data. The distance-based models assume that rankings closer to the modal ranking are more likely to be observed. Phi-component models are extensions of distance-based models with Kendall's distance by allowing weights at different stages.
phicom(dset)
phicom(dset)
dset |
a ranking dataset (aggregated) |
Fit the phi-component models for the dataset and return a mle object. Standard methods on mle (e.g., @coef, @vcov) apply. The modal ranking and the Chi-square residual are given in the output.
Paul H. Lee and Philip L. H. Yu
Fligner, M. A., and Verducci, J. S. (1986) Distance based ranking models. Journal of the Royal Statistical Society Series B, 48(3), 359-369.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the phi-component model ## phicom(test)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the phi-component model ## phicom(test)
The Luce Models for ranking data. The Luce models assumed that the rankings of the items are proportional to the item parameters.
pl(dset)
pl(dset)
dset |
a ranking dataset (aggregated) |
Fit the Luce models for the dataset and return a mle object. Standard methods on mle (e.g., @coef, @vcov) apply. The Chi-square residual are given in the output.
Paul H. Lee and Philip L. H. Yu
Luce, R. D. (1959) Individual Choice Behavior. New York: Wiley.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the Luce model ## pl(test)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the Luce model ## pl(test)
Probability models for ranking data.
Package: | pmr |
Type: | Package |
Version: | 1.2.5 |
Date: | 2015-05-14 |
Depends: | stats4, graphics |
License: | GPL-2 |
LazyLoad: | yes |
This package includes various probability models for ranking data. Current, only complete rankings are supported by this package.
Paul H. Lee and Philip L. H. Yu
Maintainer: Paul H. Lee <[email protected]>
Marden, J. I. (1995) Analyzing and Modeling Rank Data. Chapman and Hall.
Lee, P. H., and Yu, P. L. H. (2013) An R package for analyzing and modeling ranking data. BMC Medical Research Methodology, 13, 65.
Turn individual rankings into a summary matrix.
rankagg(dset)
rankagg(dset)
dset |
each row represent a single ranking |
Return the dataset which summarize the original ranking data.
Paul H. Lee and Philip L. H. Yu
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) test <- data.frame(X1,X2,X3) ## aggregate the ranking of all the observations and create a summary matrix ## test2 <- rankagg(test)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) test <- data.frame(X1,X2,X3) ## aggregate the ranking of all the observations and create a summary matrix ## test2 <- rankagg(test)
Display rankings of 3 items by hexagon and 4 items by truncated octahedron. Each line linking two points represents a Kendall distance of one. The size of the point is proportional to the frequency of that particular ranking.
rankplot(dset,trans=FALSE,label.type="item", circle.col="black", circle.bg=FALSE)
rankplot(dset,trans=FALSE,label.type="item", circle.col="black", circle.bg=FALSE)
dset |
a ranking dataset |
trans |
(For 4-item ranking dataset) Another representation of the rankings. |
label.type |
The type of label for rankings to be displayed (default is item). ranking : ranking, ordering: ordering with item numbers, item: ordering with alphabets |
circle.col |
The colour of the circles (default is black). |
circle.bg |
The colour of the background of the circles (default is none). |
As a ranking dataset of k items can be represented in k-1 dimensions, ranking data with 3 or 4 items can be represented in graphs without losing any information. For visualization of ranking data with more items, multidimensional preference analysis can be used.
Paul H. Lee and Philip L. H. Yu
Thompson, G. L. (1993). Graphical techniques for ranked data. In Fligner, M. A., and Verducci, J. S. (eds.) Probability Models and Statistical Analyses for Ranking Data, pp. 294-298.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## plotting the artificial dataset in a hexagon ## rankplot(test)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## plotting the artificial dataset in a hexagon ## rankplot(test)
Computing the inverse of a summarized (or aggregated) ranking dataset. The function rankagg can be used to created a summarized ranking dataset from individual rankings.
rinv(dset)
rinv(dset)
dset |
a ranking dataset |
Return the dataset which is the orderings of the original ranking data.
Paul H. Lee and Philip L. H. Yu
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## compute the inverse of the artificial dataset ## rinv(test)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## compute the inverse of the artificial dataset ## rinv(test)
The Rank-ordered Logit (ROL) Models for ranking data. ROL models are extensions of the Luce models by incorporating covariates.
rol(dset, covariate)
rol(dset, covariate)
dset |
a ranking dataset |
covariate |
the covariates of the ranking dataset |
Fit the rank-ordered logit models for the dataset and return a mle object. Standard methods on mle (e.g., @coef, @vcov) apply. By default, the intercept term is included.
Paul H. Lee and Philip L. H. Yu
Beggs, S., Cardell, S., and Hausman, J. (1981) Assessing the potential demand for electric cars. Journal of Econometrics, 16: 1-19.
Chapman, R. G., and Staelin, R. (1982) Exploiting rank ordered choice set data within the stochastic utility model. Journal of Market Research, 19:288-301.
Hausman, J., and Ruud, P. A. (1987) Specifying and testing econometric models for rank-ordered data. Journal of Econometrics, 34:83-104.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) X4 <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3) ## fit the Luce model ## rol(test,X4)
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) X4 <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3) ## fit the Luce model ## rol(test,X4)
Ranking of 5 items according to the similarity with the word "song".
data(song)
data(song)
A data frame with 83 observations on the following 6 variables.
X1
the rank of word "score"
X2
the rank of word "instrument"
X3
the rank of word "solo"
X4
the rank of word "benediction"
X5
the rank of word "suit"
n
number of observations
83 college students were asked to rank five words according to the similarity with the word "song". The five words were (1) score, (2) instrument, (3) solo, (4) benediction, and (5) suit.
Critchlow, D. E., Fligner, M. A., and Verducci, J. S. (1991) Probability models on rakning. Journal of Mathematical Psychology, 35, 294-318.
Critchlow, D. E., Fligner, M. A., and Verducci, J. S. (1991) Probability models on rakning. Journal of Mathematical Psychology, 35, 294-318.
data(song) ## maybe str(song) ; plot(song) ...
data(song) ## maybe str(song) ; plot(song) ...
Weighted Distance-based Models for ranking data. The distance-based models assume that rankings closer to the modal ranking are more likely to be observed. Weighted distance-based models are extensions of distance-based models with by allowing weights for different items.
wdbm(dset, dtype="tau")
wdbm(dset, dtype="tau")
dset |
a ranking dataset (aggregated) |
dtype |
type of weighted distance between two rankings. tau : Kendall's tau, rho : Spearman's rho, rho2 : Spearman's rho square, foot : footrule |
Fit the weighted distance-based models for the dataset and return a mle object. Standard methods on mle (e.g., @coef, @vcov) apply. The modal ranking and the Chi-square residual are given in the output.
Paul H. Lee and Philip L. H. Yu
Lee, P. H., and Yu, P. L. H. (2010) Distance-based tree models for ranking data. Computational Statistics and Data Analysis, 54(6), 1672-1682.
Lee, P. H., and Yu, P. L. H. (2012) Mixtures of weighted distance-based models for ranking data with applications in political studies. Computational Statistics and Data Analysis, 56(8), 2486-2500.
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the weighted distance-based model with Spearman's foot distance ## wdbm(test,dtype="foot")
## create an artificial dataset X1 <- c(1,1,2,2,3,3) X2 <- c(2,3,1,3,1,2) X3 <- c(3,2,3,1,2,1) n <- c(6,5,4,3,2,1) test <- data.frame(X1,X2,X3,n) ## fit the weighted distance-based model with Spearman's foot distance ## wdbm(test,dtype="foot")