Learn R Programming

rprev (version 0.2.3)

test_prevalence_fit: Test simulated prevalence fit.

Description

Calculates a Chi squared test between predicted yearly contributions to prevalence, and the observed values obtained from the registry, indicating whether the simulated prevalence values are accurate.

Usage

test_prevalence_fit(object)

Arguments

object
A prevalence object.

Value

P-value from a chi-squared test of difference between prevalence prediction and counted prevalence at the index date.

See Also

Other prevalence functions: prevalence_counted, prevalence_simulated, prevalence

Examples

Run this code
data(prevsim)

## Not run: 
# 
# obj <- prevalence(Surv(time, status) ~ age(age) + sex(sex) + entry(entrydate) + event(eventdate),
#                   data=prevsim, num_years_to_estimate = c(5, 10), population_size=1e6,
#                   start = "2005-09-01",
#                   num_reg_years = 8, cure = 5)
# 
# test_prevalence_fit(obj)
# ## End(Not run)

Run the code above in your browser using DataLab