R: Estimate the Intraclass Correlation Coefficient
ICCest
R Documentation
Estimate the Intraclass Correlation Coefficient
Description
Estimates the ICC and confidence intervals using the variance components from a one-way ANOVA.
Usage
ICCest(x, y, data = NULL, alpha = 0.05, CI.type = c("THD", "Smith"))
Arguments
x
column name indicating individual or group id in the dataframe data
y
column name indicating measurements in the dataframe data
data
a dataframe containing x and y
alpha
the alpha level to use when estimating the confidence interval. Default is 0.05.
CI.type
the particular confidence interval to estimate. Can be specified by just the first letter of the name. See Details section for more.
Details
If the dependent variable, x, is not a factor, then the function will change it into a factor and produce a warning message.
The confidence interval can be estimated from one of two methods included here. CIs of the type "THD" are based upon the exact confidence limit equation in Searle (1971) and can be used for unbalanced data (see Thomas & Hultquist 1978; Donner 1979).
CIs of the type "Smith" are based upon the approximate formulas for the standard error of the ICC estimate (Smith 1956).
Value
ICC
the intraclass correlation coefficient
LowerCI
the lower confidence interval limit, where the confidence level is set by alpha
UpperCI
the upper confidence interval limit, where the confidence level is set by alpha
N
the total number of individuals or groups used in the analysis
k
the number of measurements per individual or group. In an unbalanced design, k is always less than the mean number of measurements per individual/group and is calculated using the equation in Lessells and Boag (1987).
C.M. Lessells and P.T. Boag. 1987. The Auk, 104(1):116-121.
Searle, S.R. 1971. Linear Models. New York: Wiley.
Thomas, J.D. and Hultquist, R.A. 1978. Annals of Statistics, 6:582-587.
Donner, A. 1979. American Journal of Epidemiology, 110:335-342.
Smith, C.A.B. 1956. Annals of Human Genetics, 21:363-373.
See Also
ICCbare
Examples
data(ChickWeight)
ICCest(Chick, weight, data = ChickWeight, CI.type = "S")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
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 an HTML browser interface to help.
Type 'q()' to quit R.
> library(ICC)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/ICC/ICCest.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ICCest
> ### Title: Estimate the Intraclass Correlation Coefficient
> ### Aliases: ICCest
>
> ### ** Examples
>
> data(ChickWeight)
> ICCest(Chick, weight, data = ChickWeight, CI.type = "S")
$ICC
[1] 0.1077609
$LowerCI
[1] 0.0392255
$UpperCI
[1] 0.1762962
$N
[1] 50
$k
[1] 11.55519
$varw
[1] 4516.005
$vara
[1] 545.4238
>
>
>
>
>
> dev.off()
null device
1
>