Learn R Programming

MethComp (version 1.30.2)

perm.repl: Manipulate the replicate numbering within (item,method)

Description

Replicate numbers are generated within (item,method) in a dataframe representing a method comparison study. The function assumes that observations are in the correct order within each (item,method), i.e. if replicate observations are non-exchangeable within method, linked observations are assumed to be in the same order within each (item,method).

Usage

perm.repl(data)

Value

make.repl returns a dataframe with a column, repl

added or replaced, whereas has.repl returns a logical indicating wheter a combination of (meth,item) wioth more that one valid \(y\)- value.

perm.repl returns a dataframe of class Meth where the rows (i.e. replicates) are randomly permuted within (meth,item), and subsequently ordered by (meth,item,repl).

Arguments

data

A Meth object or a data frame with columns meth, item and y.

Author

Bendix Carstensen, Steno Diabetes Center, https://bendixcarstensen.com/

Details

make.repl just adds replicate numbers in the order of the data.frame rows. perm.repl is designed to explore the effect of permuting the replicates within (item,method). If replicates are truly exchangeable within methods, the inference should be independent of this permutation.

See Also

perm.repl

Examples

Run this code

  data(ox)
  xx <- subset( ox, item<4 )[,-3]
  cbind( xx, make.repl(xx) )
  cbind( make.repl(xx), perm.repl(xx) )
  data( ox )
  xx <- subset( ox, item<4 )
  cbind( xx, perm.repl(xx) )
  # Replicates are linked in the oximetry dataset, so randomly permuting
  # them clearly inflates the limits of agreement:
  par( mfrow=c(1,2), mar=c(4,4,1,4) )
  BA.plot(           ox , ymax=30, digits=1 )
  BA.plot( perm.repl(ox), ymax=30, digits=1 )

  

Run the code above in your browser using DataLab