intra_icc: Estimate ICC of a data.frame

Description Usage Arguments Details Value See Also Examples

View source: R/intra_icc.R

Description

Given a data.frame in long format estimate ICC from the irr package

Usage

1
2
intra_icc(x, id.var = c("sample", "analyte"), value.var = "dil.fitted.conc",
    by = NULL, ...)

Arguments

x

a data.frame in long format with analyte, control number and concentration variables

id.var

one or more variables that identify each one of replicates samples

value.var

character vector with the name of the variable to estimate icc

by

character vector of the variable to stratify the icc results

...

arguments for the icc function from the irr package

Details

The icc function is the one from the irr package.

Value

A list with three objects is returned:

See Also

irr

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# Generate data.frame
set.seed(123)
controls <- sort(paste("Control", rep(1:3,4),sep=""))
values <-  sort(unlist(lapply(1:12, function(x)runif(1,10+x,13+x))))
plateno <- rep(c("plate1","plate2"),6)
df <- data.frame(controls,values, plateno)
df <- df[order(df$plateno),]

# Estimate ICC
intra_icc(df, id.var = c("controls","plateno"),
value.var = "values", type="agreement",model="twoway", unit="single")
intra_icc(df, id.var = c("controls","plateno"),
value.var = "values", by = "plateno", type="agreement",model="twoway",
unit="single")

Example output

$icc.df
  values_1 values_2 controls plateno
1 11.86273 14.36492 Control1  plate1
2 16.64905 18.58432 Control2  plate1
3 20.67726 23.36000 Control3  plate1
4 14.22693 16.13667 Control1  plate2
5 17.82140 20.65431 Control2  plate2
6 21.36984 23.87050 Control3  plate2

$icc.mod
 Single Score Intraclass Correlation

   Model: twoway 
   Type : agreement 

   Subjects = 6 
     Raters = 2 
   ICC(A,1) = 0.828

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
  F(5,1.05) = 379 , p = 0.0339 

 95%-Confidence Interval for ICC Population Values:
  -0.006 < ICC < 0.979

$icc.value
[1] 0.8276149

$icc.df
  values_1 values_2 controls plateno
1 11.86273 14.36492 Control1  plate1
2 16.64905 18.58432 Control2  plate1
3 20.67726 23.36000 Control3  plate1
4 14.22693 16.13667 Control1  plate2
5 17.82140 20.65431 Control2  plate2
6 21.36984 23.87050 Control3  plate2

$icc.mod
$icc.mod$plate1
 Single Score Intraclass Correlation

   Model: twoway 
   Type : agreement 

   Subjects = 3 
     Raters = 2 
   ICC(A,1) = 0.873

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
  F(2,1.04) = 521 , p = 0.0275 

 95%-Confidence Interval for ICC Population Values:
  -0.002 < ICC < 0.996

$icc.mod$plate2
 Single Score Intraclass Correlation

   Model: twoway 
   Type : agreement 

   Subjects = 3 
     Raters = 2 
   ICC(A,1) = 0.822

 F-Test, H0: r0 = 0 ; H1: r0 > 0 
  F(2,1.06) = 254 , p = 0.0381 

 95%-Confidence Interval for ICC Population Values:
  -0.01 < ICC < 0.994


$icc.value
$icc.value$plate1
[1] 0.8734341

$icc.value$plate2
[1] 0.8221986

drLumi documentation built on May 2, 2019, 2:45 p.m.

Related to intra_icc in drLumi...