delta.many2 | R Documentation |
This function performs Hotelling's T square test using a variance-covariance matrix based on the delta method to compare dependent Conger kappa coefficients
delta.many2(data, cluster_id, nrat = c(6, 6), multilevel = T, a.level = 0.05)
data |
a N x sum(Rg) matrix representing the classification of the N items by G groups of Rg observers (g=1,...,G). |
cluster_id |
a vector of lenght N with the identification number of the K clusters |
nrat |
a vector of lenght G indicating the number of observers in the G groups of observers |
multilevel |
a binary indicator equal to TRUE in the presence of multilevel data and FALSE otherwise |
a.level |
the significance level |
This function compare several (multilevel) dependent Conger kappa coefficients. It uses Hotelling's T square test with the variance-covariance matrix obtained by the delta method. If only a single Conger kappa coefficient is computed, the kappa coefficient and its standard error are returned.
$kappa a G x 2 matrix with the G kappa coefficients to be compared in the first column and their corresponding standard error in the second column
$T_test a vector of length 2 with the value of Hotelling's T square test as first element and the p-value as second element
$confidence confidence intervals for the pairwise comparisons of kappa coefficients
$var the G x G correlation matrix of the kappa coefficients
Sophie Vanbelle sophie.vanbelle@maastrichtuniversity.nl
Vanbelle S. (2017) Comparing dependent agreement coefficients obtained on multilevel data. Biometrical Journal, 59 (5):1016-1034
Vanbelle S. (submitted) On the asymptotic variability of (multilevel) multirater kappa coefficients
#dataset (multilevel) (Vanbelle, 2008) data(depression) attach(depression) delta.pair(data=cbind(diag,BDI,diag,GHQ),cluster_id=ID,weight='unweighted',multilevel=FALSE) #dataset (multilevel) (Vanbelle, submitted) data(CRACKLES) attach(CRACKLES) AGREEMENT<-matrix(NA,ncol=21,nrow=4) for (i in 1:7){ AGREEMENT[1,((i-1)*3+1)]<-mean((rowSums(CRACKLES[UP==1,((i-1)*4+1):(i*4)])*(rowSums((CRACKLES[UP==1,((i-1)*4+1):(i*4)]))-1)+(4-rowSums(CRACKLES[UP==1,((i-1)*4+1):(i*4)]))*((4-rowSums((CRACKLES[UP==1,((i-1)*4+1):(i*4)])))-1))/12) AGREEMENT[1,((i-1)*3+2):(i*3)]<-delta.many2(cluster_id=patient[UP==1],data=CRACKLES[UP==1,((i-1)*4+1):(i*4)],nrat=c(4))$kappa AGREEMENT[2,((i-1)*3+1)]<-mean((rowSums(CRACKLES[LO==1,((i-1)*4+1):(i*4)])*(rowSums((CRACKLES[LO==1,((i-1)*4+1):(i*4)]))-1)+(4-rowSums(CRACKLES[LO==1,((i-1)*4+1):(i*4)]))*((4-rowSums((CRACKLES[LO==1,((i-1)*4+1):(i*4)])))-1))/12) AGREEMENT[2,((i-1)*3+2):(i*3)]<-delta.many2(cluster_id=patient[LO==1],data=CRACKLES[LO==1,((i-1)*4+1):(i*4)],nrat=c(4))$kappa AGREEMENT[3,((i-1)*3+1)]<-mean((rowSums(CRACKLES[UP!=1 & LO!=1,((i-1)*4+1):(i*4)])*(rowSums((CRACKLES[UP!=1 & LO!=1,((i-1)*4+1):(i*4)]))-1)+(4-rowSums(CRACKLES[UP!=1 & LO!=1,((i-1)*4+1):(i*4)]))*((4-rowSums((CRACKLES[UP!=1 & LO!=1,((i-1)*4+1):(i*4)])))-1))/12) AGREEMENT[3,((i-1)*3+2):(i*3)]<-delta.many2(cluster_id=patient[UP!=1 & LO!=1],data=CRACKLES[UP!=1 & LO!=1,((i-1)*4+1):(i*4)],nrat=c(4))$kappa AGREEMENT[4,((i-1)*3+1)]<-mean((rowSums(CRACKLES[,((i-1)*4+1):(i*4)])*(rowSums((CRACKLES[,((i-1)*4+1):(i*4)]))-1)+(4-rowSums(CRACKLES[,((i-1)*4+1):(i*4)]))*((4-rowSums((CRACKLES[,((i-1)*4+1):(i*4)])))-1))/12) AGREEMENT[4,((i-1)*3+2):(i*3)]<-delta.many2(cluster_id=patient,data=CRACKLES[,((i-1)*4+1):(i*4)],nrat=c(4))$kappa } AGREEMENT2<-matrix(NA,ncol=14,nrow=4) for (i in 1:7) { AGREEMENT2[,((i-1)*2+2)]<-paste(paste(paste(round(as.numeric(AGREEMENT[,((i-1)*3+2)]),2),' ('),round(as.numeric(AGREEMENT[,((i-1)*3+3)]),2),')')) AGREEMENT2[,((i-1)*2+1)]<-round(as.numeric(AGREEMENT[,((i-1)*3+1)]),2) } AGREEMENT2 #(table 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.