Description Usage Arguments Value Author(s) See Also Examples
Use the linear correlation to compute the ICC, where the linear correlation is estimated from regressing measurements on items within a group against the group value. The function may also be used to estimate the ICC when the individual is only associated with the group and does not contribute to the group average.
1 |
x |
A numerical value representing a linear correlation. If |
n |
The number of single items within each group. |
type |
If |
A numerical value representing the ICC.
David M Diez
cdfDist
, apple
, peach
, pear
, pepper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #=====> Example 1: apple data <=====#
data(apple)
pest <- unique(apple$pesticide)
icc <- rep(-1, length(pest))
for(i in 1:length(pest)){
these <- apple$pesticide == pest[i]
r <- cor(apple$comp[these], apple$ss[these])
icc[i] <- cor2icc(r, 10,"within")
}
names(icc) <- pest
icc
#=====> Example 2: peach data <=====#
data(peach)
pest <- unique(peach$pesticide)
icc1 <- rep(-1, length(pest))
icc2 <- rep(-1, length(pest))
for(i in 1:length(pest)){
these <- peach$pesticide == pest[i]
r <- cor(peach$comp[these], peach$ss[these])
n <- mean(peach$items[these])
icc1[i] <- cor2icc(r, n, "not")
icc2[i] <- cor2icc(r, n, "within")
}
names(icc1) <- pest
names(icc2) <- pest
icc1 # correct
icc2 # incorrect based on data collection procedure
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.