popEpi

Epidemiological analysis for population-based data.

https://github.com/finnishcancerregistry/popepi

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (12.7%) to scientific vocabulary

Keywords

adjust-estimates age-adjusting direct-adjusting epidemiology indirect-adjusting r r-package survival
Last synced: 11 months ago · JSON representation

Repository

Epidemiological analysis for population-based data.

Basic Info
  • Host: GitHub
  • Owner: FinnishCancerRegistry
  • License: other
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 11.3 MB
Statistics
  • Stars: 8
  • Watchers: 4
  • Forks: 7
  • Open Issues: 39
  • Releases: 7
Topics
adjust-estimates age-adjusting direct-adjusting epidemiology indirect-adjusting r r-package survival
Created almost 11 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog License

README.Rmd

---
output:
  md_document:
    variant: markdown_github
---


```{r, echo = FALSE, results='hide', message = FALSE, warning=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "README-"
)
library(popEpi)
```

[![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/popEpi)](https://cran.r-project.org/package=popEpi)
[![Codecov test coverage](https://codecov.io/gh/FinnishCancerRegistry/popEpi/branch/master/graph/badge.svg)](https://app.codecov.io/gh/FinnishCancerRegistry/popEpi?branch=master)
[![CRAN_DLs_via_RStudio](https://cranlogs.r-pkg.org/badges/popEpi)](https://cran.r-project.org/package=popEpi)
[![R-CMD-check](https://github.com/FinnishCancerRegistry/popEpi/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/FinnishCancerRegistry/popEpi/actions/workflows/R-CMD-check.yaml)

# popEpi: Epidemiology with population data

The purpose of popEpi is to facilitate computing certain epidemiological 
statistics where population data is used. Current main attractions:

## Splitting, merging population hazards, and aggregating

the `lexpand` function allows users to split their subject-level follow-up data into sub-intervals along age, follow-up time and calendar time, 
merge corresponding population hazard information to those intervals, 
and to aggregate the resulting data if needed.

```{r lexpand}
data(sire)
sr <- sire[1,]
print(sr)
```

```{r lexpand2}
x <- lexpand(sr, birth = bi_date, entry = dg_date, exit = ex_date,
             status = status %in% 1:2, 
             fot = 0:5, per = 1994:2000)
print(x)
```

```{r lexpand3}
data(popmort)
x <- lexpand(sr, birth = bi_date, entry = dg_date, exit = ex_date,
             status = status %in% 1:2, 
             fot = 0:5, per = 1994:2000, pophaz = popmort)
print(x)
```

```{r aggre}
a <- lexpand(sr, birth = bi_date, entry = dg_date, exit = ex_date,
             status = status %in% 1:2,
             fot = 0:5, per = 1994:2000, aggre = list(fot, per))
print(a)
```


## SIRs / SMRs

One can make use of the `sir` function to estimate indirectly standardised incidence or
mortality ratios (SIRs/SMRs). The data can be aggregated by `lexpand` or by other means.
While `sir` is simple and flexible in itself, one may also use `sirspline` to fit
spline functions for the effect of e.g. age as a continuous variable on SIRs.

```{r sir}
data(popmort)
data(sire)
c <- lexpand( sire, status = status %in% 1:2, birth = bi_date, exit = ex_date, entry = dg_date,
              breaks = list(per = 1950:2013, age = 1:100, fot = c(0,10,20,Inf)), 
              aggre = list(fot, agegroup = age, year = per, sex) )

se <- sir( coh.data = c, coh.obs = 'from0to1', coh.pyrs = 'pyrs', 
           ref.data = popmort, ref.rate = 'haz', 
           adjust = c('agegroup', 'year', 'sex'), print = 'fot')
se
```


## (Relative) survival

The `survtab` function computes observed, net/relative and cause-specific
survivals as well as  cumulative incidence functions for `Lexis` data. 
Any of the supported survival time functions can be
easily adjusted by any number of categorical variables if needed.

One can also use `survtab_ag` for aggregated data. This means the data does
not have to be on the subject-level to compute survival time function estimates.

```{r survtab}
library(Epi)

data(sibr)
sire$cancer <- "rectal"
sibr$cancer <- "breast"
sr <- rbind(sire, sibr)

sr$cancer <- factor(sr$cancer)
sr <- sr[sr$dg_date < sr$ex_date, ]

sr$status <- factor(sr$status, levels = 0:2, 
                    labels = c("alive", "canD", "othD"))

x <- Lexis(entry = list(FUT = 0, AGE = dg_age, CAL = get.yrs(dg_date)), 
           exit = list(CAL = get.yrs(ex_date)), 
           data = sr,
           exit.status = status)

st <- survtab(FUT ~ cancer, data = x,
              breaks = list(FUT = seq(0, 5, 1/12)),
              surv.type = "cif.obs")
st
```


Owner

  • Name: Finnish Cancer Registry
  • Login: FinnishCancerRegistry
  • Kind: organization
  • Location: Finland

GitHub Events

Total
  • Push event: 7
Last Year
  • Push event: 7

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 982
  • Total Committers: 7
  • Avg Commits per committer: 140.286
  • Development Distribution Score (DDS): 0.436
Past Year
  • Commits: 30
  • Committers: 1
  • Avg Commits per committer: 30.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Joonas Miettinen j****n@g****m 554
Joonas Miettinen j****n@c****i 389
Matti Rantanen m****n@c****i 31
= = 4
unknown m****n@T****l 2
Joonas Miettinen J****n 1
mattdowle m****e@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 12 months ago

All Time
  • Total issues: 98
  • Total pull requests: 2
  • Average time to close issues: about 1 month
  • Average time to close pull requests: 12 days
  • Total issue authors: 8
  • Total pull request authors: 2
  • Average comments per issue: 0.52
  • Average comments per pull request: 1.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • WetRobot (66)
  • mattirantanen (21)
  • kseppa (6)
  • MichaelChirico (1)
  • jangorecki (1)
  • anddis (1)
  • oladav (1)
  • jwdebelius (1)
Pull Request Authors
  • mattdowle (1)
  • MichaelChirico (1)
Top Labels
Issue Labels
bug (42) enhancement (35) minor (19) major (14) feature change (3) docs (1) suggestion (1) deprecated (1) duplicate (1) wontfix (1) help wanted (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 1,797 last-month
  • Total docker downloads: 43,477
  • Total dependent packages: 1
  • Total dependent repositories: 4
  • Total versions: 17
  • Total maintainers: 1
cran.r-project.org: popEpi

Functions for Epidemiological Analysis using Population Data

  • Versions: 17
  • Dependent Packages: 1
  • Dependent Repositories: 4
  • Downloads: 1,797 Last month
  • Docker Downloads: 43,477
Rankings
Docker downloads count: 0.6%
Forks count: 8.0%
Downloads: 10.3%
Average: 11.9%
Dependent repos count: 14.7%
Dependent packages count: 18.3%
Stargazers count: 19.5%
Maintainers (1)
Last synced: 12 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.2.0 depends
  • Epi >= 2.0 imports
  • data.table >= 1.10.4 imports
  • survival * imports
  • covr * suggests
  • date * suggests
  • ggplot2 * suggests
  • knitr * suggests
  • methods * suggests
  • mstate * suggests
  • relsurv * suggests
  • reshape2 * suggests
  • rmarkdown * suggests
  • roxygen2 * suggests
  • splines * suggests
  • testthat * suggests