concordance.test {nopaco} | R Documentation |
concordance.test
performs a test for a random concordance (if a single matrix is given) or tests for equal concordance between two matrices.
concordance.test(x, y = NULL, alternative = NULL, alpha = 0.05, ...)
x |
a numeric matrix, subjects in the rows, repeated measurements in the columns |
y |
(optional) a numeric matrix of equal size as argument |
alternative |
"less", "greater" or "two.sided". Only used when |
alpha |
significance level (default = 0.05) |
... |
see details |
Testing the deviation from random concordance: if only one matrix is given (i.e. argument x
), its concordance will be tested against alternative hypothesis of finding a higher concordance under random sampling conditions. For small matrices (depending on number of replicate measurements) an exact method will be used to determine to p-value. In case of larger matrices where the exact approach in not feasible, either the revised-beta approach (default), a beta approximation or a normal approximation is used. To enforce the use of either one method, the method
argument can be used with value "exact","Rbeta","beta" or "normal".
Testing for a difference between concordances: if both arguments x
and y
have been given, the equality of concordances of both matrices is tested. The default alternative hypothesis is 'two.sided'. Both matrices must be of equal size and have corresponding missing entries (NA
values). In case of missing data in one matrix, the same entries in the other matrix will also be set to missing.
Unbalanced data due to randomly missing data or an unequal number of repeated measurements per subject is allowed. In that case, missing or unknown values must be set to NA
.
An object of ConcordanceTest-class
P.Rothery (1979) Biometrika 66(3):629-639
Other concordance functions: coef
,
getPsi
, rfromPsi
require(MASS) ##to use mvrnorm function #Generate a matrix without concordance matRandom <- matrix(rnorm(3*20),20,3) concordance.test(matRandom) #Generate a matrix with strong concordance sigma<-matrix(0.8,3,3) diag(sigma)<-1 matConcordant <- mvrnorm(20,mu=rep(0,3),Sigma=sigma) concordance.test(matConcordant) #Test concordances between matrices aTest <- concordance.test(matConcordant, matRandom) getPsi(aTest) coef(aTest)