getSMR {diseasemapping} | R Documentation |
The getSMR function calculates the rate of observe value over expected value. It will also merge back the observed value, expected value and the ratio back to the population data set.
getSMR(popdata, model, casedata, regionCode = "CSDUID", regionCodeCases = "CSD2006", area = FALSE, area.scale = 1, ...) ## S3 method for class 'data.frame': getSMR(popdata, model, casedata, regionCode = "CSDUID", regionCodeCases = "CSD2006", area = FALSE, area.scale = 1, ...) ## S3 method for class 'list': getSMR(popdata, model, casedata = NULL, regionCode = "CSDUID", regionCodeCases = "CSD2006", area = FALSE, area.scale = 1, years = NULL, year.range = NULL, ...) ## S3 method for class 'SpatialPolygonsDataFrame': getSMR(popdata, ...)
popdata |
the name of population data set |
model |
the estimated coefficients we calculated from getRates function. |
... |
additional arguments |
casedata |
the name of case data set |
regionCode |
the name of district area column in population data set |
regionCodeCases |
the name of district area column in case data set |
area |
if TRUE , calculate the expected number of cases per area in each region |
area.scale |
control the unit of area. e.g $10^6$: per square kilometers |
years |
the vector of years |
year.range |
the range of the year vector |
If there is no rate calculates from the getRates function, it will leave NA in the merged population data set.
Returns a new population data set contains expected number of cases, observed number of cases and SMR. It has the same format as the population data set which put into the function.
data(casedata) data(popdata) therates = getRates(casedata, popdata, ~age*sex,breaks=c(seq(0, 80, by=10), Inf) ) thesmr = getSMR(popdata, therates, casedata) head(thesmr@data)