Description Usage Arguments Value Author(s) See Also Examples
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.
1 | gen.data.weibull.unif(n, k, shape, scale, quantile = 0.99, alpha=1, beta=1)
|
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 |
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 |
Lucia Petito
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.