DA.reg: Make a regression of differences on averages

Description Usage Arguments Details Value Author(s) References Examples

Description

For each pair of methods in data, a regression of the differences on the averages between methods is made and a linear relationship between methods with prediction standard deviations is derived.

Usage

1
2
3
4
5
6
7
8
9
  DA.reg(data,
     Transform = NULL,
     trans.tol = 1e-6,
         print = TRUE,
 random.raters = FALSE,
      DA.slope = TRUE )
  DA2y( a=0, b=0, s=NA )
  y2DA( A=0, B=1, S=NA )
  

Arguments

data

A Meth object. May also be a data frame with columns meth, item and y.

Transform

A character string, or a list of two functions, each other's inverse. The measurements are transformed by this before analysis. Possibilities are: "exp", "log", "logit", "pctlogit" (transforms percentages by the logit), "sqrt", "sq" (square), "cll" (complementary log-minus-log), "ll" (log-minus-log). For further details see choose.trans.

trans.tol

The tolerance used to check whether the supplied transformation and its inverse combine to the identity. Only used if Transform is a list of two functions.

print

Should the results be printed?

random.raters

If methods really are a random selection of raters, neither intercept nor slope different from 0 are sensible, so if this is TRUE, intercept and slope in the regression of difference on averages are fixed to 0. Meaning that we are essentially looking at the raw differences as residuals.

DA.slope

If this is TRUE, a slope of the differences in the verages is estimated, otherwise the relationship is assumed constant.

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.

A

Intercept in the linear relation of y1 on y2.

B

Slope in the linear relation of y1 on y2.

S

SD for the linear relation of y1 on y2. Can be NA.

Details

If the input object contains replicate measurements these are taken as separate items in the order they appear in the dataset.

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

DA2y takes 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".

y2DA takes intercept(A), slope(B) and sd(S) from the relationship y1=A+B y2 + E with sd(E)=E, and returns a vector of length 3 with names "int(t-f)","slope(t-f)","sd(t-f)", where t refers to "to" (y1 and f to "from" y2.

Value

DA.reg returns a MethComp object, i.e. a list with three components, Conv, VarComp, and data. Conv is a three-dimensional array, with dimensions To, From (both with levels equal to the methods in data) and an unnamed dimension with levels "alpha", "beta", "sd.pred", "beta=1", referring to the linear relationship of To to From, "int(t-f)", "slope(t-f)", "sd(t-f)", referring to the regression of the differences on the averages, and "int(sd)", "slope(sd)", and "s.d.=K", referring to the regression of the absoulte residuals on the averages, and LoA-lo, LoA-hi, the limits of agreement.

Converting from method l to method k using

y_{k|l}=α+β y_l

with prediction standard deviation σ, just requires the entries [k,l,c("alpha","beta","sd.pred")], if we assume the s.d. is constant.

The next entry is the p-values for the hypothesis β=1, intercept and slope of the SD of the differences as a linear function of the average and finally p-value of the hypothesis that standard errors are constant over the range. The latter three are derived by regressing the absolute values of the residuals on the averages, and can be used to produce LoA where the s.d. increases (or decreases) by the mean, using the function DA2y.

The VarComp element of the list is NULL, and only present for compatibility with the print method for MethComp objects.

The data element is the input dataframe. The measurements in y are left un-transformed, even if data are transformed (i.e. if the Transform attribute of the object is non-null).

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.

y2DA returns a 3-component vector with names c("DA-int","DA-slope","DA-sd"), referring to differences D=y1-y2 as a linear function of A=(y1+y2)/2.

Author(s)

Bendix Carstensen, Steno Diabetes Center, bxc$steno.dk, http://BendixCarstensen.com/MethComp

References

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

Examples

1
2
3
4
5
6
7
8
data( milk )
DA.reg( milk )
data( sbp )
print( DA.reg(sbp), digits=3 )
# Slope, intercept : y1 = 0.7 + 1.2*y2 (0.4)
A <- c(0.7,1.2,0.4)
( y2DA( A ) )
( DA2y( y2DA( A ) ) )

Example output

Loading required package: nlme

 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

 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
  int(t-f) slope(t-f)    sd(t-f) 
 0.6363636  0.1818182  0.3636364 
            int     slope        sd
y1|2  0.7000000 1.2000000 0.4000000
y2|1 -0.5833333 0.8333333 0.3333333

MethComp documentation built on May 2, 2019, 5:06 p.m.

Related to DA.reg in MethComp...