Skip to content

Commit

Permalink
Update primarycensoreddist.Rmd
Browse files Browse the repository at this point in the history
  • Loading branch information
seabbs authored Oct 4, 2024
1 parent 4944ac8 commit 1f0413c
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions vignettes/primarycensoreddist.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ pwindow <- 1
# Random samples without secondary censoring
samples <- rprimarycensoreddist(
n,
rdist = rlnorm, rprimary = stats::runif,
rdist = rlnorm, rprimary = runif,
pwindow = pwindow, swindow = 0, D = obs_time,
meanlog = meanlog, sdlog = sdlog
)
# Random samples with secondary censoring
samples_sc <- rprimarycensoreddist(
n,
rdist = rlnorm, rprimary = stats::runif,
rdist = rlnorm, rprimary = runif,
pwindow = pwindow, swindow = 1, D = obs_time,
meanlog = meanlog, sdlog = sdlog
)
Expand Down Expand Up @@ -174,8 +174,7 @@ Let's compare the empirical CDF of our samples without secondary censoring to th
empirical_cdf <- ecdf(samples)
theoretical_cdf <- pprimarycensoreddist(
seq(0, obs_time, length.out = 100),
pdist = plnorm,
dprimary = stats::dunif,
pdist = plnorm, dprimary = dunif,
pwindow = pwindow, D = obs_time,
meanlog = meanlog, sdlog = sdlog
)
Expand Down Expand Up @@ -229,8 +228,7 @@ Let's compare the empirical PMF of our samples with secondary censoring to the t
# Calculate the theoretical PMF using dprimarycensoreddist
theoretical_pmf <- dprimarycensoreddist(
0:(obs_time - 1),
pdist = plnorm,
dprimary = stats::dunif,
pdist = plnorm, dprimary = dunif,
pwindow = pwindow, swindow = 1, D = obs_time,
meanlog = meanlog, sdlog = sdlog
)
Expand Down

0 comments on commit 1f0413c

Please sign in to comment.