R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("irr-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('irr') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "anxiety" > > ### * anxiety > > flush(stderr()); flush(stdout()) > > ### Name: anxiety > ### Title: Anxiety ratings by different raters > ### Aliases: anxiety > ### Keywords: datasets > > ### ** Examples > > data(anxiety) > apply(anxiety,2,table) $rater1 1 2 3 4 5 6 2 6 5 2 4 1 $rater2 1 2 3 4 6 1 5 8 4 2 $rater3 1 2 3 4 6 7 5 5 2 1 > > > > cleanEx(); ..nameEx <- "diagnoses" > > ### * diagnoses > > flush(stderr()); flush(stdout()) > > ### Name: diagnoses > ### Title: Psychiatric diagnoses provided by different raters > ### Aliases: diagnoses > ### Keywords: datasets > > ### ** Examples > > data(diagnoses) > table(diagnoses[,1]) 1. Depression 2. Personality Disorder 3. Schizophrenia 13 10 2 4. Neurosis 5. Other 1 4 > > > > cleanEx(); ..nameEx <- "finn" > > ### * finn > > flush(stderr()); flush(stdout()) > > ### Name: finn > ### Title: Finn coefficient for oneway and twoway models > ### Aliases: finn > ### Keywords: univar > > ### ** Examples > > data(video) > finn(video, 6, model="twoway") Finn-Coefficient (Model=twoway) Subjects = 20 Raters = 4 Finn = 0.89 F(Inf,60) = 9.03 p-value = 6.71e-19 > > > > cleanEx(); ..nameEx <- "icc" > > ### * icc > > flush(stderr()); flush(stdout()) > > ### Name: icc > ### Title: Intraclass correlation coefficient (ICC) for oneway and twoway > ### models > ### Aliases: icc > ### Keywords: univar > > ### ** Examples > > data(anxiety) > icc(anxiety, model="twoway", type="agreement") Single Score Intraclass Correlation Model: twoway Type : agreement Subjects = 20 Raters = 3 ICC(A,1) = 0.198 F-Test, H0: r0 = 0 F(19,39.7) = 1.83 , p = 0.109 95%-Confidence Interval for ICC Population Values: -0.039 < ICC < 0.494 > > r1 <- round(rnorm(20, 10, 4)) > r2 <- round(r1 + 10 + rnorm(20, 0, 2)) > r3 <- round(r1 + 20 + rnorm(20, 0, 2)) > icc(cbind(r1, r2, r3), "twoway") # High consistency Single Score Intraclass Correlation Model: twoway Type : consistency Subjects = 20 Raters = 3 ICC(C,1) = 0.846 F-Test, H0: r0 = 0 F(19,38) = 17.4 , p = 5.7e-13 95%-Confidence Interval for ICC Population Values: 0.708 < ICC < 0.93 > icc(cbind(r1, r2, r3), "twoway", "agreement") # Low agreement Single Score Intraclass Correlation Model: twoway Type : agreement Subjects = 20 Raters = 3 ICC(A,1) = 0.106 F-Test, H0: r0 = 0 F(19,2.35) = 17.4 , p = 0.0754 95%-Confidence Interval for ICC Population Values: -0.002 < ICC < 0.346 > > > > cleanEx(); ..nameEx <- "kappa2" > > ### * kappa2 > > flush(stderr()); flush(stdout()) > > ### Name: kappa2 > ### Title: Cohen's Kappa and weighted Kappa for two raters > ### Aliases: kappa2 > ### Keywords: univar > > ### ** Examples > > data(anxiety) > kappa2(anxiety[,1:2], "squared") # predefined set of squared weights Cohen's Kappa for 2 Raters (Weights: squared) Subjects = 20 Raters = 2 Kappa = 0.319 z = 1.3 p-value = 0.193 > kappa2(anxiety[,1:2], (0:5)^2) # same result with own set of squared weights Cohen's Kappa for 2 Raters (Weights: 0,1,4,9,16,25) Subjects = 20 Raters = 2 Kappa = 0.319 z = 1.3 p-value = 0.193 > > # own weights increasing gradually with larger distance from perfect agreement > kappa2(anxiety[,1:2], c(0,1,2,4,7,11)) Cohen's Kappa for 2 Raters (Weights: 0,1,2,4,7,11) Subjects = 20 Raters = 2 Kappa = 0.263 z = 1.10 p-value = 0.27 > > data(diagnoses) > # Unweighted Kappa for categorial data without a logical order > kappa2(diagnoses[,2:3]) Cohen's Kappa for 2 Raters (Weights: unweighted) Subjects = 30 Raters = 2 Kappa = 0.631 z = 7.56 p-value = 4.04e-14 > > > > cleanEx(); ..nameEx <- "kappam.fleiss" > > ### * kappam.fleiss > > flush(stderr()); flush(stdout()) > > ### Name: kappam.fleiss > ### Title: Fleiss' Kappa for m raters > ### Aliases: kappam.fleiss > ### Keywords: univar > > ### ** Examples > > data(diagnoses) > kappam.fleiss(diagnoses) # Fleiss Kappa Fleiss' Kappa for m Raters Subjects = 30 Raters = 6 Kappa = 0.43 z = 15.6 p-value = 0 > kappam.fleiss(diagnoses, exact=TRUE) # Exact Kappa Fleiss' Kappa for m Raters (exact value) Subjects = 30 Raters = 6 Kappa = 0.442 > kappam.fleiss(diagnoses, detail=TRUE) # Fleiss Kappa and category-wise Kappa Fleiss' Kappa for m Raters Subjects = 30 Raters = 6 Kappa = 0.43 z = 15.6 p-value = 0 Kappa z p.value 1. Depression 0.245 2.149 0.032 2. Personality Disorder 0.245 2.149 0.032 3. Schizophrenia 0.520 4.459 0.000 4. Neurosis 0.471 3.378 0.001 5. Other 0.566 4.440 0.000 > > kappam.fleiss(diagnoses[,1:4]) # Fleiss Kappa of raters 1 to 4 Fleiss' Kappa for m Raters Subjects = 30 Raters = 4 Kappa = 0.489 z = 12.7 p-value = 0 > > > > cleanEx(); ..nameEx <- "kappam.light" > > ### * kappam.light > > flush(stderr()); flush(stdout()) > > ### Name: kappam.light > ### Title: Light's Kappa for m raters > ### Aliases: kappam.light > ### Keywords: univar > > ### ** Examples > > data(diagnoses) > kappam.light(diagnoses) # Light's Kappa Light's Kappa for m Raters Subjects = 30 Raters = 6 Kappa = 0.300 z = 1.50 p-value = 0.133 > > > > cleanEx(); ..nameEx <- "kendall" > > ### * kendall > > flush(stderr()); flush(stdout()) > > ### Name: kendall > ### Title: Kendall's coefficient of concordance W > ### Aliases: kendall > ### Keywords: univar > > ### ** Examples > > data(anxiety) > kendall(anxiety, TRUE) Kendall's coefficient of concordance Wt Subjects = 20 Raters = 3 Wt = 0.54 Chisq(19) = 30.8 p-value = 0.0429 > > > > cleanEx(); ..nameEx <- "meancor" > > ### * meancor > > flush(stderr()); flush(stdout()) > > ### Name: meancor > ### Title: Mean of bivariate correlations between raters > ### Aliases: meancor > ### Keywords: univar > > ### ** Examples > > data(anxiety) > meancor(anxiety) Mean of bivariate correlations RĜ Subjects = 20 Raters = 3 RĜ = 0.224 z = 0.922 p-value = 0.357 > > > > cleanEx(); ..nameEx <- "meanrho" > > ### * meanrho > > flush(stderr()); flush(stdout()) > > ### Name: meanrho > ### Title: Mean of bivariate rank correlations between raters > ### Aliases: meanrho > ### Keywords: univar > > ### ** Examples > > data(anxiety) > meanrho(anxiety, TRUE) Mean of bivariate rank correlations RhoĜ Subjects = 20 Raters = 3 RhoĜ = 0.314 z = 1.29 p-value = 0.196 Coefficient may be incorrect due to ties > > > > cleanEx(); ..nameEx <- "print.icclist" > > ### * print.icclist > > flush(stderr()); flush(stdout()) > > ### Name: print.icclist > ### Title: Default printing function for ICC results > ### Aliases: print.icclist > ### Keywords: print > > ### ** Examples > > data(anxiety) > # "print.icclist" is the default printing function of "icc" > icc(anxiety, model="twoway", type="agreement") Single Score Intraclass Correlation Model: twoway Type : agreement Subjects = 20 Raters = 3 ICC(A,1) = 0.198 F-Test, H0: r0 = 0 F(19,39.7) = 1.83 , p = 0.109 95%-Confidence Interval for ICC Population Values: -0.039 < ICC < 0.494 > > > > cleanEx(); ..nameEx <- "print.irrlist" > > ### * print.irrlist > > flush(stderr()); flush(stdout()) > > ### Name: print.irrlist > ### Title: Default printing function for various coefficients of interrater > ### reliability > ### Aliases: print.irrlist > ### Keywords: print > > ### ** Examples > > data(anxiety) > # "print.irrlist" is the default printing method of various functions, e.g. > finn(anxiety, 6) Finn-Coefficient (Model=oneway) Subjects = 20 Raters = 3 Finn = 0.446 F(Inf,40) = 1.80 p-value = 0.0100 > meancor(anxiety) Mean of bivariate correlations RĜ Subjects = 20 Raters = 3 RĜ = 0.224 z = 0.922 p-value = 0.357 > > > > cleanEx(); ..nameEx <- "robinson" > > ### * robinson > > flush(stderr()); flush(stdout()) > > ### Name: robinson > ### Title: Robinson's A > ### Aliases: robinson > ### Keywords: univar > > ### ** Examples > > data(anxiety) > robinson(anxiety) Robinson's A Subjects = 20 Raters = 3 A = 0.477 > > > > cleanEx(); ..nameEx <- "video" > > ### * video > > flush(stderr()); flush(stdout()) > > ### Name: video > ### Title: Different raters judging the credibility of videotaped > ### testimonies > ### Aliases: video > ### Keywords: datasets > > ### ** Examples > > data(anxiety) > apply(anxiety,2,table) $rater1 1 2 3 4 5 6 2 6 5 2 4 1 $rater2 1 2 3 4 6 1 5 8 4 2 $rater3 1 2 3 4 6 7 5 5 2 1 > > > > ### *