Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

LRT.value.trend

Compute a test of trend in prevalences based on a likelihood-ratio statistic


Description

This function takes a series of point estimates and their associated standard errors and computes the p-value for the test of a monotone decrease in the population prevalences (in sequence order). The p-value for a monotone increase is also reported. More formally, let the K population prevalences in sequence order be p_1, …, p_K. We test the null hypothesis:

H_0 : p_1 = … = p_K

vs

H_1 : p_1 ≥ p_2 … ≥ p_K

with at least one equality strict. A likelihood ratio statistic for this test has been derived (Bartholomew 1959). The null distribution of the likelihood ratio statistic is very complex but can be determined by a simple Monte Carlo process.
We also test the null hypothesis:

H_0 : p_1 ≥ p_2 … ≥ p_K

vs

H_1 : \overline{H_0}

The null distribution of the likelihood ratio statistic is very complex but can be determined by a simple Monte Carlo process. The function requires the isotone library.

Usage

LRT.value.trend(x, sigma)

Arguments

x

A vector of prevalence estimates in the order (e.g., time).

sigma

A vector of standard error estimates corresponding to x.

Value

A list with components

  • pvalue.increasing: The p-value for the test of a monotone increase in population prevalence.

  • pvalue.decreasing: The p-value for the test of a monotone decrease in population prevalence.

  • L: The value of the likelihood-ratio statistic.

  • x: The passed vector of prevalence estimates in the order (e.g., time).

  • sigma The passed vector of standard error estimates corresponding to x.

Author(s)

Mark S. Handcock

References

Bartholomew, D. J. (1959). A test of homogeneity for ordered alternatives. Biometrika 46 36-48.

Examples

## Not run: 
x <- c(0.16,0.15,0.3)
sigma <- c(0.04,0.04,0.1)
LRT.value.trend(x,sigma)

## End(Not run)

RDS

Respondent-Driven Sampling

v0.9-3
LGPL-2.1
Authors
Mark S. Handcock [aut, cre], Krista J. Gile [aut], Ian E. Fellows [aut], W. Whipple Neely [aut]
Initial release
2021-03-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.