simdat: Simulation of normal paired data

Description Usage Arguments Value Examples

View source: R/simdat.R

Description

Simulates samples of normally distributed paired data according to specified sample size, intra-pair correlation and effect size of a given treatment.

Usage

1
simdat(npairs = NULL, eff = NULL, rho = NULL)

Arguments

npairs

integer. Supplies the number of pairs to be simulated. Resulting in two samples of size "npairs".

eff

numeric. Supplies the difference in means between both groups. Can be interpreted as effect size based on the fact that standard normal variates are the basis of simulation.

rho

numeric. Supplies the correlation coefficient between both groups.

Value

A sample of paired data, i.e. two samples of size "npairs" with theoretical correlation coefficient "rho". Realised empirical correlation may vary and is not guaranteed to be an exact match of "rho".

Examples

1
2
data <- simdat(npairs = 10, eff = 0, rho = -0.8)
cor(data$y_Tr, data$y_NTr)

AlexanderRitz/pairedpowR documentation built on March 16, 2020, 12:16 a.m.