Learn R Programming

PairedData (version 0.9.1)

rpaired.contaminated: Simulate paired samples

Description

Simulate paired data with a given correlation (Kendall's tau=(2/pi)arcsine(r)) and marginals being contaminated normal distributions: (1-eps)*F(x)+eps*F(x/K) where F is the cumulative standard normal distribution, eps the percentage of contamination and K a scale parameter. Moreover, this marginal can be multiplied by another scale parameter sigma but usually sigma=1.

Usage

rpaired.contaminated(n, d1 = c(0.1, 10, 1), d2 = c(0.1, 10, 1), r = 0.5)

Arguments

n
sample size.
d1
vector of 3 parameters for the first contaminated normal distribution (eps,K,sigma).
d2
vector of 3 parameters for the second contaminated normal distribution.
r
correlation.

Value

  • An object of class paired.

References

P.M. Grambsch. Simple robust tests for scale differences in paired data. Biometrika, 81, 359-372, 1994.

See Also

rpaired.gld

Examples

Run this code
rpaired.contaminated(n=30,r=0.25)

Run the code above in your browser using DataLab