Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Calculate ICC with 1 and 2 levels of clusters

    Dear Statalist,

    I am working on a dataset where I want to compare the ICC within three methodologies measuring an outcome.

    There are multiple measurements for each participants. More precisely, for each participant there are multiple sample types and for each sample type multiple measurements (sample_no). Therefore, two levels of clustering (participant and sample type). A visual representation of dummy data is presented below:

    outcome_m1 = the outcome value measured using method 1
    outcome_m2 = the outcome value measured using method 2
    outcome_m3 = the outcome value measured using method 3

    id sample_type sample_no outcome_m1 outcome_m2 outcome_m3
    1 1 1 3.8 5.0 1.2
    1 1 2 3.4 4.6 1.2
    1 1 3 3.3 4.4 1.1
    1 2 1 3.3 4.1 0.7
    1 2 2 3.4 4.0 0.6
    1 2 3 3.4 4.1 0.7
    1 2 4 3.3 4.0 0.7
    2 1 1 3.3 4.0 0.7
    2 1 2 3.3 4.1 0.8
    2 2 1 3.3 4.1 0.8
    2 2 2 3.5 4.1 0.6
    2 2 3 3.5 4.1 0.6
    3 1 1 3.6 4.3 0.7
    3 1 2 3.7 4.4 0.6
    3 1 3 3.6 4.4 0.8
    3 1 4 3.9 4.8 0.9
    3 2 1 4.1 5.2 1.1
    3 2 2 4.2 5.4 1.2
    3 3 1 4.2 5.5 1.3
    3 3 2 3.9 5.4 1.5

    I would like to estimate and compare the ICC of the difference of methods 1-2 and 1-3.
    First I would like to ignore the sample_no and estimate the ICC for 1 cluster:

    gen d1 = outcome_m1 - outcome_m2
    gen d2 = outcome_m1 - outcome_m3

    kappaetc d1 id, icc(mixed)
    kappaetc d2 id, icc(mixed)


    Is the above code correct? Shall I use this method of estimation and is this data format correct?
    How will this be amended to account for 2 levels of clustering?

    My first guess would be to run mixed effects models (after reshaping from wide to long) and use estat icc, but I would get one ICC estimate instead of two.

    I hope this makes sense. Thank you very much in advance.

    Best wishes
    Eveline
Working...
X