gen.data.fixed: Fixed data generation

Description Usage Arguments Value Author(s) See Also Examples

Description

This function generates grouped, misclassified current status data with a finite number of fixed censoring times. Probability of an event is determined from a user-provided "distribution" - only requirement is the vector true.F must be monotonically increasing and between 0 and 1.

Usage

1
gen.data.fixed.Rd(n, k, Cs, true.F, alpha=1, beta=1)

Arguments

n

number of individuals

k

grouping size

Cs

a vector of the observed censoring times

true.F

a vector of event probabilities at each one of the Cs. This vector must be the same length as Cs.

alpha

Sensitivity: probability of a positive test results given that the individual is truly diseased (or that the group contains at least one person who is truly diseased). Default is 1 - no misclassification

beta

Specificity: probability of a negative test results given that the individual is truly not diseased (or that the group contains noone who is truly diseased). Default is 1 - no misclassification

Value

This function returns a data frame with the following columns:

Cs: individual observation times
groups: group identifier
initial.p: initial values for the EM-PAV hybrid algorithm
delta.ind: indicator of event (1) or censoring (0) - true test result
y.ind: misclassified test result
delta.group: true group test result, indicator that at least one individual had delta.ind==1
y.group: misclassified group test result

Author(s)

Lucia Petito

See Also

gen.data.weibull.unif

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Generate data on 10 individuals with 5% misclassification rates each
data <- gen.data.fixed(10, 2, 1:5, seq(0.1, 0.5, 0.1), 0.95, 0.95)
data

#Now examine generated data in 1,000 individuals 
data <- gen.data.fixed(1000, 2, 1:5, seq(0.1, 0.5, 0.1), 0.9, 0.9)
#Look at true individual test results
with(data, xtabs(~Cs + delta.ind))
#Look at misclassification
with(data, xtabs(~delta.ind + y.ind + Cs))

#Do the same in the grouped tests 
with(data, xtabs(~Cs + delta.group))
with(data, xtabs(~delta.group + y.group + Cs))

lpetito/groupedCS documentation built on May 21, 2019, 7:51 a.m.