Function to calculate intra-observer TEM for each observer using input dataset containing multiple types of multiple measurements from multiple observers.

calculate_tem_cohort(m1, m2, index, n)

Arguments

m1

A numeric vector of first round measurements made by multiple observers

m2

A numeric vector of second round measurements made by multiple observers

index

A list of grouping factors

n

Number of subjects

Value

A vector or data frame of calculated TEM per observer and per measurement type.

Examples

# Get the TEM per observer for MUAC measurements in the smartStd dataset calculate_tem_cohort(m1 = smartStd$muac1, m2 = smartStd$muac2, index = smartStd$observer, n = 10)
#> 0 1 2 3 4 5 6 7 #> 3.694591 2.428992 2.819574 29.631908 3.674235 8.941476 3.008322 7.641989 #> 8 9 10 #> 3.232646 2.313007 2.037155
# Get the TEM per observer for all measurement types (height, weight, MUAC) # in the smartStdLong dataset calculate_tem_cohort(m1 = smartStdLong$measure_value[smartStdLong$measure_round == 1], m2 = smartStdLong$measure_value[smartStdLong$measure_round == 2], index = smartStdLong[smartStdLong$measure_round == 1, c("observer", "measure_type")], n = 10)
#> measure_type #> observer height muac weight #> 0 0.5500000 3.694591 0.08062258 #> 1 23.5565914 2.428992 0.33763886 #> 2 11.2581304 2.819574 0.11832160 #> 3 0.2941088 29.631908 0.06324555 #> 4 0.6855655 3.674235 0.16881943 #> 5 0.5319774 8.941476 1.38798415 #> 6 0.2539685 3.008322 0.13784049 #> 7 0.3255764 7.641989 0.10246951 #> 8 0.5490902 3.232646 0.11401754 #> 9 0.3612478 2.313007 0.10954451 #> 10 0.3255764 2.037155 0.29410882