Description Usage Arguments Value Author(s) References See Also Examples
Calculates the standardized mortality ratio and its confidence interval. SMR, for a group, is defined as the ratio of the observed deaths in this group and the sum of the predicted individual probabilities of death by any model (expected deaths).
SMR.table
estimates at once the overall SMR and the SMR across several groups, e.g. ICU units or clinical characteristics. The SMR.table
can be ordered by the SMR estimate or its confidence intervals, facilitating the comparison of the units ranks.
forest.SMR
shows the SMR.table
output as a forest plot. The plot opens two windows and plot at the left side the values from the SMR.table
and at the right side the points and lines graphically representing each SMR and its confidence interval.
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 | SMR(obs.var, pred.var, digits = 5, ci.method = c("Hosmer", "Byar"),
ci.level = 0.95)
SMR.table(data, group.var, obs.var, pred.var, digits = 5,
use.label = FALSE, var.labels = attr(data,
"var.labels")[match(group.var, names(data))], ci.method = c("Hosmer",
"Byar"), ci.level = 0.95, reorder = c("no", "SMR", "lower.Cl",
"upper.Cl"), decreasing = FALSE)
forest.SMR(x, mar1 = c(5.1, 1, 4.1, 1), mar.SMR = c(5.1, 7, 4.1, 1),
overall.arg = list(x = 0.01, font = 2, las = 1, labels = var.labels[1],
xpd = NA, adj = 0), NOE.overall.args = list(x = c(N.values.arg$x,
O.values.arg$x, E.values.arg$x), font = 2, las = 1, xpd = NA),
var.labels.arg = list(x = 0.01, font = 2, las = 1, cex = 1, xpd = NA,
adj = 0), cat.labels.arg = list(x = 0.1, font = 3, las = 1, cex = 0.95,
col = gray(0.4), xpd = NA, adj = 0), N.values.arg = list(x = 0.5, col =
gray(0.4), xpd = NA), O.values.arg = list(x = 0.675, col = gray(0.4),
xpd = NA), E.values.arg = list(x = 0.85, col = gray(0.4), xpd = NA),
NOE.head.arg = list(font = 2, labels = c("N", "O", "E"), xpd = NA),
Overall.seg.arg = list(col = "navyblue", xpd = NA, lwd = 2),
Overall.p.arg = list(pch = 23, cex = 2, col = "black", bg = gray(0.4),
xpd = NA), Overall.est.arg = list(x = smr.xlim[1] - 0.06, las = 1, font
= 2, xpd = NA, adj = 1), cat.seg.arg = list(col = "navyblue", xpd = NA,
lwd = 2), cat.p.arg = list(pch = 22, cex = 1, col = "black", bg =
gray(0.4), xpd = NA), cat.est.arg = list(x = smr.xlim[1] - 0.06, las =
1, col = gray(0.4), xpd = NA, adj = 1), SMR.head.arg = list(smr.xlim[1]
- 0.06, font = 2, labels = "SMR [95% CIs]", xpd = NA, adj = 1),
smr.xlab = "Standardized Mortality Ratio", smr.xlim = "auto",
grid = TRUE, digits = 3)
|
obs.var |
Observed death. Accepted values are 0 (absence) or 1 (presence) in a vector. For |
pred.var |
Death individual predictions (ranging from 0 to 1) in a vector. For |
digits |
Number of digits for rounding the output. |
ci.method |
Method to estimate the confidence interval. "Hosmer" (default) or "Byar" are acceptable values. |
ci.level |
Level of the confidence interval. Default is 0.95. |
data |
For |
group.var |
For |
use.label |
Logical. Default is FALSE. For |
var.labels |
A character vector with variables labels. The default is to replace the variable name by the label stored at attr(data, "var.labels"). But one may specify labels directly. |
reorder |
Default is "no". Possible values are: "no", "SMR","lower.Cl", and "upper.Cl". It will make the |
decreasing |
Logical. When 'reorderd' is TRUE, should the order be decreasing or incresing? See |
x |
For the |
mar1, mar.SMR |
Values to set the margins (mar parameter) of left and right windows. See |
overall.arg |
A list of arguments passed to |
NOE.overall.args |
A list of arguments passed to |
var.labels.arg |
A list of arguments passed to |
cat.labels.arg |
A list of arguments passed to |
N.values.arg |
A list of arguments passed to |
O.values.arg |
A list of arguments passed to |
E.values.arg |
A list of arguments passed to |
NOE.head.arg |
A list of arguments passed to |
Overall.seg.arg |
A list of arguments passed to |
Overall.p.arg |
A list of arguments passed to |
Overall.est.arg |
A list of arguments passed to |
cat.seg.arg |
A list of arguments passed to |
cat.p.arg |
A list of arguments passed to |
cat.est.arg |
A list of arguments passed to |
SMR.head.arg |
A list of arguments passed to |
smr.xlab |
Label of the x axis. Default is "Standardized Mortality Ratio". |
smr.xlim |
Limits of x axis of the |
grid |
Logical. If TRUE (default), it will draw a grid with the |
If SMR, then:
N
Number of subjects analyzed.
O
Observed number of deaths.
E
Expected number of deaths.
SMR
Standardized mortality ratio.
lower.Cl
lower confidence limit.
upper.Cl
upper confidence limit.
If SMR.table, then a data.frame with the same information as above, and the additional information is returned: "Variables" (variables names), "Levels" (variables levels).
If forest.SMR, then a plot is returned.
Lunna Borges and Pedro Brasil
David W. Hosmer and Stanley Lemeshow. Confidence intervals estimates of an index of quality performance basend on logistic regression models. Statistics in Medicine , vol. 14, 2161-2172 (1995)
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 | # Loading a example data
data(icu)
# Setting variable labels to data
attr(icu, "var.labels")[match(c("Unit", "IsMechanicalVentilation1h",
"AdmissionTypeName_pri","Vasopressors_D1"), names(icu))] <-
c("ICU unit","Mechanichal ventilation","Admission type","Vasopressors at admission")
# Some editing
icu$Saps3DeathProbabilityStandardEquation <- icu$Saps3DeathProbabilityStandardEquation /100
icu$IsMechanicalVentilation1h <- as.factor(ifelse(icu$IsMechanicalVentilation1h == 1, "Yes", "No"))
icu$AdmissionTypeName_pri <- as.factor(icu$AdmissionTypeName_pri)
levels(icu$AdmissionTypeName_pri) <- c("Clinical","Elective surgery", "Urgent surgery")
icu$Vasopressors_D1 <- as.factor(ifelse(icu$Vasopressors_D1 == 1, "Yes", "No"))
# The overall SMR for the whole sample
SMR(icu$UnitDischargeName, icu$Saps3DeathProbabilityStandardEquation)
# The overall SMR and for some subgroups
x <- SMR.table(data = icu, obs.var = "UnitDischargeName",
pred.var = "Saps3DeathProbabilityStandardEquation",
group.var = c( "IsMechanicalVentilation1h",
"AdmissionTypeName_pri","Vasopressors_D1"),
reorder = "no",
decreasing = TRUE,
use.label = TRUE)
x
# A forest plot for all groups SMR (resize the window may be required)
forest.SMR(x, digits = 2)
# The same thing but reordering the categories
x <- SMR.table(data = icu, obs.var = "UnitDischargeName",
pred.var = "Saps3DeathProbabilityStandardEquation",
group.var = c( "IsMechanicalVentilation1h",
"AdmissionTypeName_pri", "Vasopressors_D1"),
reorder = "SMR",
decreasing = TRUE,
use.label = TRUE)
forest.SMR(x, digits = 2)
# The overall SMR and for all Units
x <- SMR.table(data = icu, obs.var = "UnitDischargeName",
pred.var = "Saps3DeathProbabilityStandardEquation",
group.var = "Unit",
reorder = "no",
decreasing = TRUE,
use.label = TRUE)
x
# A forest plot for all Units
forest.SMR(x, digits = 2)
# The same thing but reordering the categories
x <- SMR.table(data = icu, obs.var = "UnitDischargeName",
pred.var = "Saps3DeathProbabilityStandardEquation",
group.var = "Unit",
reorder = "SMR",
decreasing = TRUE,
use.label = TRUE)
forest.SMR(x, digits = 2)
rm(x, icu)
|
N Observed Expected SMR lower.Cl upper.Cl
13709.00000 1000.00000 1929.72560 0.51821 0.48337 0.55555
Variables Levels N Observed Expected SMR
1 Overall <NA> 13709 1000 1929.7256 0.51821
2 Mechanichal ventilation No 11992 475 1379.1279 0.34442
3 <NA> Yes 1690 519 549.9631 0.94370
4 Admission type Clinical 9689 850 1664.8627 0.51055
5 <NA> Elective surgery 3297 62 134.8148 0.45989
6 <NA> Urgent surgery 723 88 130.0481 0.67667
7 Vasopressors at admission No 11990 496 1382.3766 0.35880
8 <NA> Yes 1692 498 546.7144 0.91090
lower.Cl upper.Cl
1 0.48337 0.55555
2 0.30189 0.39295
3 0.89012 1.00051
4 0.47339 0.55063
5 0.32906 0.64273
6 0.55843 0.81995
7 0.31625 0.40708
8 0.85709 0.96808
Variables Levels N Observed Expected SMR lower.Cl upper.Cl
1 Overall <NA> 13709 1000 1929.7256 0.51821 0.48337 0.55555
2 ICU unit A 760 56 78.8304 0.71039 0.54313 0.92914
3 <NA> B 662 30 59.6522 0.50292 0.32563 0.77672
4 <NA> C 729 44 105.6499 0.41647 0.28978 0.59855
5 <NA> D 2985 102 328.9128 0.31011 0.22862 0.42066
6 <NA> E 2658 136 324.9898 0.41847 0.33582 0.52147
7 <NA> F 1635 124 241.9412 0.51252 0.41901 0.62690
8 <NA> G 580 34 70.6007 0.48158 0.31765 0.73010
9 <NA> H 1188 90 198.6324 0.45310 0.35866 0.57240
10 <NA> I 1182 72 205.3119 0.35069 0.26040 0.47228
11 <NA> J 1330 312 315.2043 0.98983 0.91490 1.07091
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.