gen.data.weibull.unif: Data Generation

Description Usage Arguments Value Author(s) See Also Examples

Description

This function generates grouped, misclassified current status data with event times from a Weibull distribution with parameters shape and scale (as defined in the stats package) and observation times from a Uniform distribution that allows roughly quantile percent of the events to be observed.

Usage

1
gen.data.weibull.unif(n, k, shape, scale, quantile = 0.99, alpha=1, beta=1)

Arguments

n

number of individuals

k

grouping size

shape

shape for the Weibull distribution

scale

scale for the Weibull distribution (defaults to 1)

quantile

The maximum probability of the event in the population (default is 0.99)

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 returns a data frame with the following columns:

groups: group identifier
Ts: true individual event times
Cs: individual observation times
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
initial.p: initial values for the EM-PAV hybrid algorithm

Author(s)

Lucia Petito

See Also

gen.data.fixed

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
#Generate data for 10 people with group sizes of 2 from a Weibull(4, 25) distribution where at most 50% of the population can be diseased, from a test with a 10% false positive and negative rate. 
data <- gen.data.weibull.unif(10, 2, 4, 25, 0.5, 0.9, 0.9)
data

#Redo the above scenario, but use 1,000 people and summarize censoring and misclassification rates.
data <- gen.data.weibull.unif(1000, 2, 4, 25, 0.5, 0.9, 0.9)
head(data)
#Number of individual events
with(data, xtabs(~delta.ind))
#Number of group events
with(data, xtabs(~delta.group))
#Summary of misclassification of individual events
with(data, xtabs(~delta.ind + y.ind))
#Summary of misclassification of group events
with(data, xtabs(~delta.group + y.group))

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