Home > other >  r ICC estimate by group
r ICC estimate by group

Time:07-06

If this is my repeated measure dataset

Machine   RaterId    Date        Value
   Drill     123        01/05/2019  8.91
   Drill     123        07/19/2018  9.31
   Drill     144        02/10/2015  8.21
   Drill     110        04/15/2107  8.56
   Drill     134        06/10/2017  7.15
   Drill     134        08/15/2017  8.19
   Press     144        03/27/2018  8.24
   Press     289        09/15/2019  9.01
   Press     289        01/13/2015  8.36
   Press     144        03/27/2018  8.24
   Press     291        09/15/2015  9.18
   Press     167        08/26/2015  8.04
   Press     154        09/18/2016  8.19
   Press     144        11/06/2017  9.45
   Press     289        12/01/2019  8.98

How do I estimate the ICC for Drill and Press (by Machine) ? Thanks.

CodePudding user response:

You could use the ICCest function from the ICC package like this:

library(ICC)
ICCest(RaterId, Value, data=df[df$Machine=="Drill",])
#> Warning in ICCest(RaterId, Value, data = df[df$Machine == "Drill", ]): 'x' has
#> been coerced to a factor
#> $ICC
#> [1] 0.4722642
#> 
#> $LowerCI
#> [1] -1.871767
#> 
#> $UpperCI
#> [1] 0.9611994
#> 
#> $N
#> [1] 4
#> 
#> $k
#> [1] 1.444444
#> 
#> $varw
#> [1] 0.3104
#> 
#> $vara
#> [1] 0.2777731
ICCest(RaterId, Value, data=df[df$Machine=="Press",])
#> Warning in ICCest(RaterId, Value, data = df[df$Machine == "Press", ]): 'x' has
#> been coerced to a factor
#> $ICC
#> [1] -0.1891273
#> 
#> $LowerCI
#> [1] -1.2426
#> 
#> $UpperCI
#> [1] 0.784257
#> 
#> $N
#> [1] 5
#> 
#> $k
#> [1] 1.666667
#> 
#> $varw
#> [1] 0.3113333
#> 
#> $vara
#> [1] -0.04951667

Created on 2022-07-05 by the reprex package (v2.0.1)

  •  Tags:  
  • r
  • Related