test_prevalence_fit: Test simulated prevalence fit.

Description Usage Arguments Value See Also Examples

View source: R/diagnostics.R

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

1

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()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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)

rprev documentation built on May 4, 2021, 5:08 p.m.