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

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/perm.repl.R

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

1

Arguments

data

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

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.

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).

Author(s)

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

See Also

perm.repl

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  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 )

  

MethComp documentation built on Jan. 20, 2020, 1:12 a.m.

Related to perm.repl in MethComp...