Common Public Health Statistics and their Confidence Intervals

Functions to calculate commonly used public health statistics and their confidence intervals using methods approved for use in the production of Public Health England indicators such as those presented via Fingertips (< http://fingertips.phe.org.uk/>). It provides functions for the generation of proportions, crude rates, means, directly standardised rates, indirectly standardised rates, standardised mortality ratios, slope and relative index of inequality and life expectancy. Statistical methods are referenced in the following publications. Breslow NE, Day NE (1987) . Dobson et al (1991) . Armitage P, Berry G (2002) . Wilson EB. (1927) . Altman DG et al (2000, ISBN: 978-0-727-91375-3). Chiang CL. (1968, ISBN: 978-0-882-75200-6). Newell C. (1994, ISBN: 978-0-898-62451-9). Eayres DP, Williams ES (2004) . Silcocks PBS et al (2001) . Low and Low (2004) .


BuildStatus

CoverageStatus

This is an R package to support analysts in the execution of statistical methods approved for use in the production of PHE indicators such as those presented via Fingertips. It provides functions for the generation of Proportions, Rates, DSRs, ISRs, SMRs and Means including confidence intervals for these statistics.

Any feedback would be appreciated and can be provided using the Issues section of the GitHub repository, or by emailing [email protected]



Installation

From GitHub using devtools

You can install the latest version of PHEindicatormethods from GitHub with:

if (!require(devtools)) install.packages("devtools")
 
devtools::install_github("PublicHealthEngland/PHEindicatormethods",
                         build_vignettes = TRUE,
                         dependencies = "suggests")

Some users may receive a Lazy Load error following installation and loading of this package using devtools in RStudio. In these cases, please close and re-open RStudio and then re-load the package using the library command.

From zip

Download this repository from GitHub and either build from source or do:

source <- devtools:::source_pkg("C:/path/to/PHEindicatormethods-master")
devtools::install(source)



Package Versioning

Following installation of this package, type ‘packageVersion(“PHEindicatormethods”)’ in the R console to show the package version. If it is suffixed with a 9000 number then you are using an unapproved development version.

Released versions of this package will have version numbers consisting of three parts: .. In-development versions of this package will have a fourth component, the development version number, which will increment from 9000.

See http://r-pkgs.had.co.nz/description.html for further information on package versioning

Package Contents

The package contains the following functions, datasets and vignettes - see individual item documentation for full details

Functions:
- byars_lower
- byars_upper
- phe_dsr
- phe_isr
- phe_mean
- phe_proportion
- phe_rate
- phe_smr
- wilson_lower
- wilson_upper

Datasets:
- esp2013

Vignettes:
- Vignette for calculating DSRs for multiple geographies and time periods
(type ‘browseVignettes(“PHEindicatormethods”)’ to view in HTML)

News

PHEindicatormethods v1.1.1

The following changes may affect backwards compatibility with earlier versions of the package:

  • phe_proportion: Replaced logical PERCENTAGE argument with a numeric MULTIPLIER argument to enable proportions to be expressed more flexibly (eg per 1000). Default is now multiplier = 1 which gives equivalent output to the previous default of percentage = FALSE. There is loss of backwards compatibility where the percentage argument has previously been specified in the function call - please replace 'percentage=TRUE' with 'multiplier=100' and 'percentage=FALSE' with 'multiplier=1'.

  • all functions using the TYPE argument: Altered the default value for the TYPE argument from 'standard' to 'full'. This may affect backwards compatibility with earlier versions of the package - where type has not been specified output will now contain additional metadata columns - to remove these please specify type = "standard" as a function argument.

  • byars_lower(), byars_upper(), wilson_lower() and wilson_upper() functions have been moved to the package utilities and are less readily available to be used as stand-alone functions within the package. These functions are intended to be called using other 'phe-' prefixed package functions.


The following changes will not affect backwards compatibility with earlier versions of the package:

  • phe_life_expectancy() function added for calculation of life expectancy at different ages based on population and death data

  • phe_quantile() function added for assigning data to quantiles

  • phe_sii() function added for calculation of slope index of inequality and relative index of inequality

  • phe_proportion() and phe_rate() functions now return aggregate data when grouped data is passed

  • Altered handling of NA values in phe_proportion(), phe_rate() and phe_mean() functions to enable results to be returned for the records which do not contain invalid NAs

  • Altered handling of NA values in phe_dsr() function such that NA values in the age-specific count data are assumed to be equal to zero and no longer cause the function to error

  • Altered handling of NA values in phe_isr() and phe_smr() functions such that NA values in the age-specific count, age-specific population and/or reference count data are assumed to be equal to zero and no longer cause the functions to error

PHEindicatormethods V1.0.8

This is the first release of this package to CRAN

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("PHEindicatormethods")

1.1.3 by Anderson Georgina, a month ago


Report a bug at https://github.com/PublicHealthEngland/PHEindicatormethods/issues


Browse source code at https://github.com/cran/PHEindicatormethods


Authors: Anderson Georgina [aut, cre] , Fox Sebastian [ctb] , Francis Matthew [ctb] , Fryers Paul [ctb] , Clegg Emma [ctb]


Documentation:   PDF Manual  


GPL-3 license


Imports dplyr, rlang, broom, tidyr, purrr, stats

Suggests knitr, readxl, rmarkdown, RODBC, testthat


See at CRAN