Package: Epi 2.55

Epi: Statistical Analysis in Epidemiology

Functions for demographic and epidemiological analysis in the Lexis diagram, i.e. register and cohort follow-up data. In particular representation, manipulation, rate estimation and simulation for multistate data - the Lexis suite of functions, which includes interfaces to 'mstate', 'etm' and 'cmprsk' packages. Contains functions for Age-Period-Cohort and Lee-Carter modeling and a function for interval censored data and some useful functions for tabulation and plotting, as well as a number of epidemiological data sets.

Authors:Bendix Carstensen [aut, cre], Martyn Plummer [aut], Esa Laara [ctb], Michael Hills [ctb]

Epi_2.55.tar.gz
Epi_2.55.zip(r-4.5)Epi_2.55.zip(r-4.4)Epi_2.55.zip(r-4.3)
Epi_2.55.tgz(r-4.4-x86_64)Epi_2.55.tgz(r-4.4-arm64)Epi_2.55.tgz(r-4.3-x86_64)Epi_2.55.tgz(r-4.3-arm64)
Epi_2.55.tar.gz(r-4.5-noble)Epi_2.55.tar.gz(r-4.4-noble)
Epi_2.55.tgz(r-4.4-emscripten)Epi_2.55.tgz(r-4.3-emscripten)
Epi.pdf |Epi.html
Epi/json (API)

# Install 'Epi' in R:
install.packages('Epi', repos = c('https://bxc147.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Datasets:
  • B.dk - Births in Denmark by year and month of birth and sex
  • BrCa - Clinical status, relapse, metastasis and death in 2982 women with breast cancer.
  • DMconv - Conversion to diabetes
  • DMepi - Epidemiological rates for diabetes in Denmark 1996-2015
  • DMlate - The Danish National Diabetes Register.
  • DMrand - The Danish National Diabetes Register.
  • M.dk - Mortality in Denmark 1974 ff.
  • N.dk - Population size in Denmark
  • S.typh - Salmonella Typhimurium outbreak 1996 in Denmark.
  • Y.dk - Population risk time in Denmark
  • bdendo - A case-control study of endometrial cancer
  • bdendo11 - A case-control study of endometrial cancer
  • births - Births in a London Hospital
  • blcaIT - Bladder cancer mortality in Italian males
  • brv - Bereavement in an elderly cohort
  • diet - Diet and heart data
  • ewrates - Rates of lung and nasal cancer mortality, and total mortality.
  • gmortDK - Population mortality rates for Denmark in 5-years age groups.
  • hivDK - HivDK: seroconversion in a cohort of Danish men
  • lep - An unmatched case-control study of leprosy incidence
  • lungDK - Male lung cancer incidence in Denmark
  • mortDK - Population mortality rates for Denmark in 1-year age-classes.
  • nickel - A Cohort of Nickel Smelters in South Wales
  • occup - A small occupational cohort
  • pr - Diabetes prevance as of 2010-01-01 in Denmark
  • st2alb - Clinical trial: Steno2 baseline and follow-up.
  • st2clin - Clinical trial: Steno2 baseline and follow-up.
  • steno2 - Clinical trial: Steno2 baseline and follow-up.
  • testisDK - Testis cancer incidence in Denmark, 1943-1996
  • thoro - Thorotrast Study

On CRAN:

This package does not link to any Github/Gitlab/R-forge repository. No issue tracker or development information is available.

181 exports 4 stars 6.40 score 30 dependencies 9 dependents 805 mentions 592 scripts 6.1k downloads

Last updated 7 days agofrom:d532afb3fa. Checks:OK: 9. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 11 2024
R-4.5-win-x86_64OKSep 11 2024
R-4.5-linux-x86_64OKSep 11 2024
R-4.4-win-x86_64OKSep 11 2024
R-4.4-mac-x86_64OKSep 11 2024
R-4.4-mac-aarch64OKSep 11 2024
R-4.3-win-x86_64OKSep 11 2024
R-4.3-mac-x86_64OKSep 11 2024
R-4.3-mac-aarch64OKSep 11 2024

Exports:[.LexisAaJ.LexisabsorbingaddCov.LexisaddDrug.Lexisafterapc.fitapc.frameapc.LCaapc.linesapc.plotAplotas.Date.cal.yrbeforebootLexisboxarrboxesboxes.Lexisboxes.matrixboxes.MSbreakscal.yrcbind.Lexisccwcci.Criskci.cumci.etaci.expci.linci.matci.pdci.predci.ratioci.survclearclogisticcoarse.Lexiscontr.2ndcontr.cumcontr.diffcontr.orthcountLexiscoxph.Lexiscp.linescp.matlinescp.matpointscp.matshadecp.pointsCplotcrr.LexiscutLexisdboxdecurvedetrenddureffxeffx.matchentryerlerl1etm.Lexisexitfactorizefactorize.Lexisfgrepfillarrfit.addfit.multfloatftrendgam.Lexisgen.expglm.LexisharmIcensid.spanidSpanin.spaninSpanLCa.fitlegendboxlevels.LexisLexisLexis.diagramLexis.linesLexis2msmlgrepLife.lineslines.apclines.Lexislines.pStatelinesEstllsmat2polmatshademcutLexismerge.Lexismhmsdatamsdata.LexisN2YNArrayncutngrepnicenidnid.LexisNsnStateorder.LexisorderLexispc.linespc.matlinespc.matpointspc.matshadepc.pointspctabplot.apcplot.LCaplot.Lexisplot.pStateplotCIFplotEstploteventpoints.LexispointsEstpoisregPplotprecedingpredict.LCaprint.floatedprint.Icensprint.LCaprint.Lexisprint.mhprint.summary.Lexisprojection.ippStatePY.annPY.ann.Lexisrateplotrbind.LexisrcutLexisRelevelRelevel.factorRelevel.Lexisrm.trROCshow.apc.LCasimLexissortLexissplitLexisstack.LexisstackedCIFstat.tablestatussubset.Lexissubset.stacked.Lexissucceedingsummary.Icenssummary.LCasummary.Lexissurv1surv2tboxTermplotthinColtimeBandtimeScalestimeSincetmattmat.Lexistransform.Lexistransform.stacked.LexistransienttsNA20twoby2unLexisWaldyllZArray

Dependencies:clicmprskdata.tabledplyretmfansigenericsgluelatticelifecyclemagrittrMASSMatrixmgcvnlmenumDerivpillarpkgconfigplyrR6RcppRcppArmadillorlangsurvivaltibbletidyselectutf8vctrswithrzoo

01: Analysis of follow-up data using the Lexis functions in Epi

Rendered fromflup.rnwusingutils::Sweaveon Sep 11 2024.

Last update: 2024-07-11
Started: 2018-01-30

02: Years of life lost (YLL)

Rendered fromyll.rnwusingutils::Sweaveon Sep 11 2024.

Last update: 2024-07-11
Started: 2017-02-23

03: Competing risks with Lexis, parametric rates and simulation based confidence intervals

Rendered fromcrisk.rnwusingutils::Sweaveon Sep 11 2024.

Last update: 2024-07-11
Started: 2021-01-27

04: Time dependent covariates in Lexis objects: addCov & addDrug

Rendered fromaddLexis.rnwusingutils::Sweaveon Sep 11 2024.

Last update: 2024-07-11
Started: 2022-04-13

05: Simulation of multistate models with multiple timescales: simLexis

Rendered fromsimLexis.rnwusingutils::Sweaveon Sep 11 2024.

Last update: 2024-07-11
Started: 2016-01-06

Readme and manuals

Help Manual

Help pageTopics
The Aalen-Johansen estimator of state probabilities from a multistate 'Lexis' object.AaJ.Lexis
Add covariates (typically clinical measurements) taken at known times to a Lexis object.addCov.Lexis
Expand a Lexis object with information of drug exposure based on purchase dates and -amountsaddDrug.Lexis coarse.Lexis
Fit an Age-Period-Cohort model to tabular data.apc.fit
Produce an empty frame for display of parameter-estimates from Age-Period-Cohort-models.apc.frame
Fit Age-Period-Cohort models and Lee-Carter models with effects modeled by natural splines.apc.LCa show.apc.LCa
Plot APC-estimates in an APC-frame.apc.lines lines.apc
Births in Denmark by year and month of birth and sexB.dk
A case-control study of endometrial cancerbdendo bdendo11
Births in a London Hospitalbirths
Bladder cancer mortality in Italian malesblcaIT
Create a bootstrap sample of persons (as identified by 'lex.id') from a Lexis objectbootLexis nid nid.Lexis
Draw boxes and arrows for illustration of multistate models.boxarr boxes boxes.Lexis boxes.matrix boxes.MS dbox fillarr tbox
Clinical status, relapse, metastasis and death in 2982 women with breast cancer.BrCa
Bereavement in an elderly cohortbrv
Functions to convert character, factor and various date objects into a number, and vice versa.as.Date.cal.yr cal.yr
Combining a Lexis objects with data frames or other Lexis objectscbind.Lexis rbind.Lexis
Generate a nested case-control studyccwc
Compute cumulative risks and expected sojourn times from models for cause-specific rates.ci.Crisk
Compute cumulative sum of estimates.ci.cum ci.surv
Linear predictor ('eta') from a formula, coefficients, vcov and a prediction frame.ci.eta
Compute linear functions of parameters with standard errors and confidence limits, optionally transforming to a different scale.ci.exp ci.lin ci.mat ci.pred ci.ratio Wald
Compute confidence limits for a difference of two independent proportions.ci.pd
Conditional logistic regressionclogistic
Contrast matricescontr.2nd contr.cum contr.diff contr.orth
Fit a competing risks regression model (Fine-Gray model) using a Lexis object)crr.Lexis
Cut follow-up at a specified date for each person.countLexis cutLexis
Projection of a model matrix on the orthogonal complement of a trend or curvature.decurve detrend
Diet and heart datadiet
Conversion to diabetesDMconv
Epidemiological rates for diabetes in Denmark 1996-2015DMepi
The Danish National Diabetes Register.DMlate DMrand
Function to calculate effectseffx
Function to calculate effects for individually matched case-control studieseffx.match
Time series and other methods for Lexis objectsabsorbing after before dur entry exit preceding status succeeding transient
Epi: Functions for manipulation and statistical analysis of epidemiological dataEpi-package Epi
Compute survival functions from rates and expected residual lifetime in an illness-death model as well as years of life lost to disease.erl erl1 surv1 surv2 yll
Rates of lung and nasal cancer mortality, and total mortality.ewrates
Function to expand data for regression analysis of interval censored data.expand.data
Fit an additive excess risk model to interval censored data.fit.add
Fit a piecewise contsnt intesity model for interval censored data.fit.baseline
Fits a multiplicative relative risk model to interval censored data.fit.mult
Calculate floated variancesfloat print.floated
Create a data structures suitable for use with packages 'mstate' or 'etm'.etm etm.Lexis msdata msdata.Lexis
Fit a floating trend to a factor in generalized linear modelftrend
Generate covariates for drug-exposure follow-up from drug purchase records.gen.exp
Population mortality rates for Denmark in 5-years age groups.gmortDK
Create a basis of harmonic functions.harm
hivDK: seroconversion in a cohort of Danish menhivDK
Fits a regression model to interval censored data.Icens print.Icens summary.Icens
Is 'x' in the column span of matrix 'A' and what columns are linearly dependent?id.span idSpan in.span inSpan thinCol
Fit Lee-Carter-type models for rates to arbitrarily shaped observations of rates in a Lexis diagram.LCa.fit plot.LCa predict.LCa print.LCa summary.LCa
Draw a box with text explaining the numbers in and between boxes from 'boxes.MS' and 'boxes.Lexis'legendbox
An unmatched case-control study of leprosy incidencelep
Create a Lexis object of follow-upLexis print.Lexis
Plot a Lexis diagramLexis.diagram
Draw life lines in a Lexis diagram.Lexis.lines
Convert a Lexis obejct to a data set suitable for input to the 'msm:msm' function.Lexis2msm
Convenience versions of grepfgrep lgrep ngrep
Compute dates/ages for life lines in a Lexis diagramLife.lines
Functions to manage and explore the workspaceclear lls
Male lung cancer incidence in DenmarklungDK
Mortality in Denmark 1974 ff.M.dk
Plot columns of a matrix as stacked areas.mat2pol
Plot confidence intervals as shaded areas around lines.matshade
Cut follow-up at multiple event dates and keep track of order of eventsmcutLexis
Merge a Lexis object with a data framemerge.Lexis
Mantel-Haenszel analyses of cohort and case-control studiesmh print.mh
Fit intensity models to follow-up data in Lexis objectscoxph.Lexis gam.Lexis glm.Lexis
Population mortality rates for Denmark in 1-year age-classes.mortDK
Population size in DenmarkN.dk
Create risk time ("Person-Years") in Lexis triangles from population count data.N2Y
Set up an array of NAs, solely from the list of dimnamesNArray ZArray
Function to group a variable in intervals.ncut
Nice breakpoints for axes on plotsnice
A Cohort of Nickel Smelters in South Walesnickel
Natural splines - (cubic splines linear beyond outermost knots) with convenient specification of knots and possibility of centering, detrending and clamping.Ns
A small occupational cohortoccup
Plot period and cohort effects in an APC-frame.cp.lines cp.matlines cp.matpoints cp.matshade cp.points pc.lines pc.matlines pc.matpoints pc.matshade pc.points
Create percentages in a tablepctab
Plot the estimates from a fitted Age-Period-Cohort modelapc.plot plot.apc
Lexis diagramslines.Lexis plot.Lexis points.Lexis PY.ann PY.ann.Lexis
Plotting Aalen-Johansen curves for competing eventsplotCIF stackedCIF
Plot estimates with confidence limits (forest plot)linesEst plotEst pointsEst
Plot Equivalence Classesplotevent
Family Object for Poisson Regressionpoisreg
Diabetes prevance as of 2010-01-01 in Denmarkpr
Projection of columns of a matrix.projection.ip
Functions to plot rates from a table classified by age and calendar time (period)Aplot Cplot Pplot rateplot
A function to cut follow-up at intermediate event times.rcutLexis
Reorder and combine levels of a factorRelevel Relevel.factor
Remove transitions from a Lexis object.rm.tr
Function to compute and draw ROC-curves.ROC
Salmonella Typhimurium outbreak 1996 in Denmark.S.typh
Simulate a Lexis object representing follow-up in a multistate model.lines.pState nState plot.pState pState simLexis
Split follow-up time in a Lexis objectsplitLexis
Functions to facilitate analysis of multistate models.stack.Lexis tmat tmat.Lexis
Tables of summary statisticsprint.stat.table stat.table
Special functions for use in stat.tablecount percent ratio
Clinical trial: Steno2 baseline and follow-up.st2alb st2clin steno2
Subsetting Lexis (and stacked.Lexis) objectssubset.Lexis subset.stacked.Lexis [.Lexis
Summarize transitions and risk time from a Lexis objectprint.summary.Lexis summary.Lexis
A wrapper for 'termplot' that optionally (but by default) exponentiates terms, and plot them on a common log-scale. Also scales x-axes to the same physical scale.Termplot
Testis cancer incidence in Denmark, 1943-1996testisDK
Thorotrast Studythoro
Extract time band data from a split Lexis objectbreaks timeBand
The time scales of a Lexis objecttimeScales timeSince tsNA20
Transform a Lexis (or stacked.Lexis) objectfactorize factorize.Lexis levels.Lexis order.Lexis orderLexis Relevel.Lexis sortLexis transform.Lexis transform.stacked.Lexis
Analysis of a two by two tabletwoby2
Remove Lexis attributes from a 'Lexis' object.unLexis
Population risk time in DenmarkY.dk