sim.meth {MethComp}R Documentation

Simulate a dataframe containing replicate measurements on the same items using different methods.

Description

A dataframe is simulated that represents data from a method comparison study based on parameters specified by the user.

Usage

  sim.meth( Ni = 100,
            Nm = 2,
            Nr = 3,
            nr = Nr,
         alpha = rep(0,Nm),
          beta = rep(1,Nm),
      mu.range = c(0, 100),
      sigma.mi = rep(5,Nm),
      sigma.ir = 2.5,
     sigma.mir = rep(5,Nm),
        m.thin = 1,
        i.thin = 1 )
  

Arguments

Ni The number of items (patient, animal, sample, unit etc.)
Nm The number of methods of measurement.
Nr The (maximal) number of replicate measurements for each (item,method) pair.
nr The minimal number of replicate measurements for each (item,method) pair. If nr<Nr, the number of replicates for each (meth,item) pair is uniformly distributed on the points nr:Nr, otherwise nr is ignored. Different number of replicates is only meaningful if replicates are not linked, hence nr is also ignored when sigma.ir>0.
alpha A vector of method-specific intercepts for the linear equation relating the "true" underlying item mean measurement to the mean measurement on each method.
beta A vector of method-specific slopes for the linear equation relating the "true" underlying item mean measurement to the mean measurement on each method.
mu.range The range across items of the "true" mean measurement. Item means are uniformly spaced across the range.
sigma.mi A vector of method-specific standard deviations for a method by item random effect. Some or all components can be zero.
sigma.ir Method-specific standard deviations for the item by replicate random effect.
sigma.mir A vector of method-specific residual standard deviations for a method by item by replicate random effect (residual variation). All components must be greater than zero.
m.thin Fraction of the observations from each method to keep.
i.thin Fraction of the observations from each item to keep. If both m.thin and i.thin are given the thinning is by their componentwise product.

Details

Data are simulated according to the following model for an observation y_mir:

y_{mir} = α_m + β_m(μ_i+b_{ir} + c_{mi}) + e_{mir}

{y_mir = alpha_m + beta_m*(mu_i+b_ir+c_mi) + e_mir} where $b_{ir}$ is a random item by repl interaction (with standard deviation for method m the corresponding component of the vector sigma_ir), c_mi is a random meth by item interaction (with standard deviation for method m the corresponding component of the vector sigma_mi) and e_mir is a residual error term (with standard deviation for method $m$ the corresponding component of the vector sigma_mir). The mu_i's are uniformly spaced in a range specified by mu.range.

Value

A dataframe with columns meth, item, repl and y, representing results from a method comparison study.

Author(s)

Lyle Gurrin, University of Melbourne, http://www.epi.unimelb.edu.au/about/staff/gurrin-lyle, Bendix Carstensen, Steno Diabetes Center, http://www.biostat.ku.dk/~bxc

See Also

tab.repl, plot.meth, MethComp

Examples

  sim.meth( Ni=4, Nr=3 )
  xx <- sim.meth( Nm=3, Nr=5, nr=2, alpha=1:3, beta=c(0.7,0.9,1.2), m.thin=0.7 )
  tab.repl( xx )
  plot.meth( xx )
  

[Package MethComp version 0.1.15 Index]