File: sir_exp.Rd

package info (click to toggle)
r-cran-popepi 0.4.13%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: sh: 13; makefile: 2
file content (121 lines) | stat: -rw-r--r-- 3,161 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sir.R
\name{sir_exp}
\alias{sir_exp}
\alias{sir_lex}
\alias{sir_ag}
\title{Calculate SMR}
\usage{
sir_exp(
  x,
  obs,
  exp,
  pyrs = NULL,
  print = NULL,
  conf.type = "profile",
  test.type = "homogeneity",
  conf.level = 0.95,
  subset = NULL
)

sir_lex(x, print = NULL, breaks = NULL, ...)

sir_ag(
  x,
  obs = "from0to1",
  print = attr(x, "aggre.meta")$by,
  exp = "d.exp",
  pyrs = "pyrs",
  ...
)
}
\arguments{
\item{x}{Data set e.g. \code{aggre} or \code{Lexis} object
(see: \verb{[lexpand]})}

\item{obs}{Variable name of the observed cases in the data set}

\item{exp}{Variable name or expression for expected cases}

\item{pyrs}{Variable name for person-years (optional)}

\item{print}{Variables or expression to stratify the results}

\item{conf.type}{select confidence interval type: (default=) \code{profile}, \code{wald}, \code{univariate}}

\item{test.type}{Test for equal SIRs. Test available are 'homogeneity' and 'trend'}

\item{conf.level}{Level of type-I error in confidence intervals, default 0.05 is 95\% CI}

\item{subset}{a logical vector for subsetting data}

\item{breaks}{a named list to split age group (age), period (per) or follow-up (fot).}

\item{...}{pass arguments to \code{sir_exp}}
}
\value{
A sir object
}
\description{
Calculate Standardized Mortality Ratios (SMRs) using
a single data set that includes
observed and expected cases and additionally person-years.

\code{sir_lex} solves SMR from an \verb{[Epi::Lexis]} object
calculated with \verb{[lexpand]}.

\code{sir_ag} solves SMR from a \verb{[aggre]} object
calculated using \verb{[lexpand]}.
}
\details{
These functions are intended to calculate SMRs from a single data set
that includes both observed and expected number of cases. For example utilizing the
argument \code{pop.haz} of the \verb{[lexpand]}.

\code{sir_lex} automatically exports the transition \code{fromXtoY} using the first
state in \code{lex.Str} as \code{0} and all other as \code{1}. No missing values
is allowed in observed, pop.haz or person-years.
}
\section{Functions}{
\itemize{
\item \code{sir_lex()}: 

\item \code{sir_ag()}: 

}}
\examples{

\donttest{
BL <- list(fot = 0:5, per = c("2003-01-01","2008-01-01", "2013-01-01"))

## Aggregated data
x1 <- lexpand(sire, breaks = BL, status = status != 0,
              birth = bi_date, entry = dg_date, exit = ex_date,
              pophaz=popmort,
              aggre=list(sex, period = per, surv.int = fot))
sir_ag(x1, print = 'period')


# no aggreate or breaks
x2 <- lexpand(sire, status = status != 0,
              birth = bi_date, entry = dg_date, exit = ex_date,
              pophaz=popmort)
sir_lex(x2, breaks = BL, print = 'per')
}

}
\seealso{
\verb{[lexpand]}
\href{../doc/sir.html}{A SIR calculation vignette}

Other sir functions: 
\code{\link{lines.sirspline}()},
\code{\link{plot.sirspline}()},
\code{\link{sir}()},
\code{\link{sir_ratio}()},
\code{\link{sirspline}()}
}
\author{
Matti Rantanen
}
\concept{sir functions}