The functions DA2y and y2DA are convenience functions that convert the estimates of intercept, slope and sd from the regression of \(D=y_1-y_2\) on \(A=(y_1+y_2)/2\), back and forth to the resulting intercept, slope and sd in the relationship between \(y_1\) and \(y_2\), cf. Carstensen (2010), equation 6.

DA2y(a = 0, b = 0, s = NA)

Arguments

a

Intercept in the linear relation of the differences y1-y2 to the averages (y1+y2)/2. If a vector of length>1, this is used instead of a, b and s, and b and s are ignored.

b

Slope in the linear relstion of the differences to the averages.

s

SD from the regression of the differences in the averages. Can be NA.

Value

DA2y returns a 2 by 3 matrix with rownames c("y1|2","y2|1") and columnnames c("int","slope","sd"), calculated under the assumption that the differences were formed as D <- y1 - y2.

Details

DA2y takes the intercept(a), slope(b) and sd(s) from the relationship (y1-y2)=a+b((y1+y2)/2)+e with sd(e)=s, and returns a two by 3 matrix with columns "int","slope","sd" and rows "y1|2","y2|1".

References

B. Carstensen: Comparing methods of measurement: Extending the LoA by regression. Stat Med, 29:401-410, 2010.

Author

Bendix Carstensen, Steno Diabetes Center, bendix.carstensen@regionh.dk, https://BendixCarstensen.com/MethComp/

Examples

data( milk )
DA.reg( milk )
#> 
#>  Conversion between methods:
#>                 alpha   beta sd.pred beta=1 int(t-f) slope(t-f) sd(t-f) int(sd) slope(sd)   sd=K
#> To:    From:                                                                                    
#> Gerber Gerber   0.000  1.000      NA     NA    0.000      0.000      NA      NA        NA     NA
#>        Trig    -0.080  1.029   0.081  0.005   -0.079      0.028   0.080   0.059     0.006  0.383
#> Trig   Gerber   0.078  0.972   0.079  0.005    0.079     -0.028  -0.080   0.059     0.006  0.383
#>        Trig     0.000  1.000      NA     NA    0.000      0.000      NA      NA        NA     NA
data( sbp )
print( DA.reg(sbp), digits=3 )
#> 
#>  Conversion between methods:
#>              alpha    beta sd.pred  beta=1 int(t-f) slope(t-f) sd(t-f) int(sd) slope(sd)    sd=K
#> To: From:                                                                                       
#> J   J        0.000   1.000      NA      NA    0.000      0.000      NA      NA        NA      NA
#>     R       -1.076   1.009   2.258   0.048   -1.071      0.009   2.248   1.505     0.003   0.486
#>     S       -8.448   0.950  19.839   0.226   -8.665     -0.051  20.349 -11.547     0.205   0.000
#> R   J        1.066   0.991   2.237   0.048    1.071     -0.009  -2.248   1.505     0.003   0.486
#>     R        0.000   1.000      NA      NA    0.000      0.000      NA      NA        NA      NA
#>     S       -7.178   0.940  19.559   0.146   -7.398     -0.061  20.160 -11.087     0.201   0.000
#> S   J        8.894   1.053  20.886   0.226    8.665      0.051 -20.349 -11.547     0.205   0.000
#>     R        7.633   1.063  20.800   0.146    7.398      0.061 -20.160 -11.087     0.201   0.000
#>     S        0.000   1.000      NA      NA    0.000      0.000      NA      NA        NA      NA
# Slope, intercept : y1 = 0.7 + 1.2*y2 (0.4)
A <- c(0.7,1.2,0.4)
( y2DA( A ) )
#>   int(t-f) slope(t-f)    sd(t-f) 
#>  0.6363636  0.1818182  0.3636364 
( DA2y( y2DA( A ) ) )
#>             int     slope        sd
#> y1|2  0.7000000 1.2000000 0.4000000
#> y2|1 -0.5833333 0.8333333 0.3333333