perturb_y: Simulates misclassification in binary phenotype

Description Usage Arguments Value

View source: R/utils.R

Description

This function simulates misclassification of binary phenotype (vector y) by switching fraction lambda of 0 (controls) to 1 (cases) and fraction c_alpha of 1 (cases) to 0 (controls).

Usage

1
perturb_y(y, lambda = NULL, c_alpha = NULL, seed = 1000)

Arguments

y

Vector of values of 0s and 1s.

lambda

Fraction of controls switched to cases. Default is NULL (no switch).

c_alpha

Fraction of cases switched to controls. Default is NULL (no switch).

seed

Seed number to ensure different switches take place everytime. Default is 1000.

Value

Vector with switched 0s and 1s according to defined lambda and alpha.


afrahshafquat/phelex documentation built on Feb. 5, 2020, 7:44 p.m.