From 37516e23941e912ce34a52dbf844b7f536904ae3 Mon Sep 17 00:00:00 2001 From: Alessandro Gasparini Date: Wed, 8 Jan 2020 16:10:13 +0100 Subject: [PATCH] Updated pkgdown site --- docs/LICENSE.html | 216 ++++++++-------- docs/articles/comorbidityscores.html | 308 ++++++++++++----------- docs/index.html | 358 +++++++++++++-------------- docs/news/index.html | 4 +- docs/pkgdown.yml | 4 +- docs/reference/comorbidity.html | 2 +- docs/reference/index.html | 16 +- docs/sitemap.xml | 8 +- 8 files changed, 457 insertions(+), 459 deletions(-) diff --git a/docs/LICENSE.html b/docs/LICENSE.html index 9cb30ac..13981dc 100644 --- a/docs/LICENSE.html +++ b/docs/LICENSE.html @@ -127,10 +127,10 @@

NA

-
                GNU GENERAL PUBLIC LICENSE
-                   Version 3, 29 June 2007
+
                GNU GENERAL PUBLIC LICENSE
+                   Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. http://fsf.org/ Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

-
                        Preamble
+
                        Preamble

The GNU General Public License is a free, copyleft license for software and other kinds of works.

The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program–to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.

When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.

@@ -142,7 +142,7 @@

NA

Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users’ freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.

Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.

The precise terms and conditions for copying, distribution and modification follow.

-
                   TERMS AND CONDITIONS
+
                   TERMS AND CONDITIONS
  1. Definitions.
@@ -183,71 +183,71 @@

NA

  • Conveying Modified Source Versions.
  • You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:

    -
    a) The work must carry prominent notices stating that you modified
    -it, and giving a relevant date.
    -
    -b) The work must carry prominent notices stating that it is
    -released under this License and any conditions added under section
    -7.  This requirement modifies the requirement in section 4 to
    -"keep intact all notices".
    -
    -c) You must license the entire work, as a whole, under this
    -License to anyone who comes into possession of a copy.  This
    -License will therefore apply, along with any applicable section 7
    -additional terms, to the whole of the work, and all its parts,
    -regardless of how they are packaged.  This License gives no
    -permission to license the work in any other way, but it does not
    -invalidate such permission if you have separately received it.
    -
    -d) If the work has interactive user interfaces, each must display
    -Appropriate Legal Notices; however, if the Program has interactive
    -interfaces that do not display Appropriate Legal Notices, your
    -work need not make them do so.
    +
    a) The work must carry prominent notices stating that you modified
    +it, and giving a relevant date.
    +
    +b) The work must carry prominent notices stating that it is
    +released under this License and any conditions added under section
    +7.  This requirement modifies the requirement in section 4 to
    +"keep intact all notices".
    +
    +c) You must license the entire work, as a whole, under this
    +License to anyone who comes into possession of a copy.  This
    +License will therefore apply, along with any applicable section 7
    +additional terms, to the whole of the work, and all its parts,
    +regardless of how they are packaged.  This License gives no
    +permission to license the work in any other way, but it does not
    +invalidate such permission if you have separately received it.
    +
    +d) If the work has interactive user interfaces, each must display
    +Appropriate Legal Notices; however, if the Program has interactive
    +interfaces that do not display Appropriate Legal Notices, your
    +work need not make them do so.

    A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an “aggregate” if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation’s users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.

    1. Conveying Non-Source Forms.

    You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:

    -
    a) Convey the object code in, or embodied in, a physical product
    -(including a physical distribution medium), accompanied by the
    -Corresponding Source fixed on a durable physical medium
    -customarily used for software interchange.
    -
    -b) Convey the object code in, or embodied in, a physical product
    -(including a physical distribution medium), accompanied by a
    -written offer, valid for at least three years and valid for as
    -long as you offer spare parts or customer support for that product
    -model, to give anyone who possesses the object code either (1) a
    -copy of the Corresponding Source for all the software in the
    -product that is covered by this License, on a durable physical
    -medium customarily used for software interchange, for a price no
    -more than your reasonable cost of physically performing this
    -conveying of source, or (2) access to copy the
    -Corresponding Source from a network server at no charge.
    -
    -c) Convey individual copies of the object code with a copy of the
    -written offer to provide the Corresponding Source.  This
    -alternative is allowed only occasionally and noncommercially, and
    -only if you received the object code with such an offer, in accord
    -with subsection 6b.
    -
    -d) Convey the object code by offering access from a designated
    -place (gratis or for a charge), and offer equivalent access to the
    -Corresponding Source in the same way through the same place at no
    -further charge.  You need not require recipients to copy the
    -Corresponding Source along with the object code.  If the place to
    -copy the object code is a network server, the Corresponding Source
    -may be on a different server (operated by you or a third party)
    -that supports equivalent copying facilities, provided you maintain
    -clear directions next to the object code saying where to find the
    -Corresponding Source.  Regardless of what server hosts the
    -Corresponding Source, you remain obligated to ensure that it is
    -available for as long as needed to satisfy these requirements.
    -
    -e) Convey the object code using peer-to-peer transmission, provided
    -you inform other peers where the object code and Corresponding
    -Source of the work are being offered to the general public at no
    -charge under subsection 6d.
    +
    a) Convey the object code in, or embodied in, a physical product
    +(including a physical distribution medium), accompanied by the
    +Corresponding Source fixed on a durable physical medium
    +customarily used for software interchange.
    +
    +b) Convey the object code in, or embodied in, a physical product
    +(including a physical distribution medium), accompanied by a
    +written offer, valid for at least three years and valid for as
    +long as you offer spare parts or customer support for that product
    +model, to give anyone who possesses the object code either (1) a
    +copy of the Corresponding Source for all the software in the
    +product that is covered by this License, on a durable physical
    +medium customarily used for software interchange, for a price no
    +more than your reasonable cost of physically performing this
    +conveying of source, or (2) access to copy the
    +Corresponding Source from a network server at no charge.
    +
    +c) Convey individual copies of the object code with a copy of the
    +written offer to provide the Corresponding Source.  This
    +alternative is allowed only occasionally and noncommercially, and
    +only if you received the object code with such an offer, in accord
    +with subsection 6b.
    +
    +d) Convey the object code by offering access from a designated
    +place (gratis or for a charge), and offer equivalent access to the
    +Corresponding Source in the same way through the same place at no
    +further charge.  You need not require recipients to copy the
    +Corresponding Source along with the object code.  If the place to
    +copy the object code is a network server, the Corresponding Source
    +may be on a different server (operated by you or a third party)
    +that supports equivalent copying facilities, provided you maintain
    +clear directions next to the object code saying where to find the
    +Corresponding Source.  Regardless of what server hosts the
    +Corresponding Source, you remain obligated to ensure that it is
    +available for as long as needed to satisfy these requirements.
    +
    +e) Convey the object code using peer-to-peer transmission, provided
    +you inform other peers where the object code and Corresponding
    +Source of the work are being offered to the general public at no
    +charge under subsection 6d.

    A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.

    A “User Product” is either (1) a “consumer product”, which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, “normally used” refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.

    “Installation Information” for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.

    @@ -260,28 +260,28 @@

    NA

    “Additional permissions” are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.

    When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.

    Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:

    -
    a) Disclaiming warranty or limiting liability differently from the
    -terms of sections 15 and 16 of this License; or
    -
    -b) Requiring preservation of specified reasonable legal notices or
    -author attributions in that material or in the Appropriate Legal
    -Notices displayed by works containing it; or
    -
    -c) Prohibiting misrepresentation of the origin of that material, or
    -requiring that modified versions of such material be marked in
    -reasonable ways as different from the original version; or
    -
    -d) Limiting the use for publicity purposes of names of licensors or
    -authors of the material; or
    -
    -e) Declining to grant rights under trademark law for use of some
    -trade names, trademarks, or service marks; or
    -
    -f) Requiring indemnification of licensors and authors of that
    -material by anyone who conveys the material (or modified versions of
    -it) with contractual assumptions of liability to the recipient, for
    -any liability that these contractual assumptions directly impose on
    -those licensors and authors.
    +
    a) Disclaiming warranty or limiting liability differently from the
    +terms of sections 15 and 16 of this License; or
    +
    +b) Requiring preservation of specified reasonable legal notices or
    +author attributions in that material or in the Appropriate Legal
    +Notices displayed by works containing it; or
    +
    +c) Prohibiting misrepresentation of the origin of that material, or
    +requiring that modified versions of such material be marked in
    +reasonable ways as different from the original version; or
    +
    +d) Limiting the use for publicity purposes of names of licensors or
    +authors of the material; or
    +
    +e) Declining to grant rights under trademark law for use of some
    +trade names, trademarks, or service marks; or
    +
    +f) Requiring indemnification of licensors and authors of that
    +material by anyone who conveys the material (or modified versions of
    +it) with contractual assumptions of liability to the recipient, for
    +any liability that these contractual assumptions directly impose on
    +those licensors and authors.

    All other non-permissive additional terms are considered “further restrictions” within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.

    If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.

    Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.

    @@ -340,32 +340,32 @@

    NA

  • Interpretation of Sections 15 and 16.
  • If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.

    -
                     END OF TERMS AND CONDITIONS
    -
    -        How to Apply These Terms to Your New Programs
    +
                     END OF TERMS AND CONDITIONS
    +
    +        How to Apply These Terms to Your New Programs

    If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.

    To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the “copyright” line and a pointer to where the full notice is found.

    -
    <one line to give the program's name and a brief idea of what it does.>
    -Copyright (C) <year>  <name of author>
    -
    -This program is free software: you can redistribute it and/or modify
    -it under the terms of the GNU General Public License as published by
    -the Free Software Foundation, either version 3 of the License, or
    -(at your option) any later version.
    -
    -This program is distributed in the hope that it will be useful,
    -but WITHOUT ANY WARRANTY; without even the implied warranty of
    -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    -GNU General Public License for more details.
    -
    -You should have received a copy of the GNU General Public License
    -along with this program.  If not, see <http://www.gnu.org/licenses/>.
    +
    <one line to give the program's name and a brief idea of what it does.>
    +Copyright (C) <year>  <name of author>
    +
    +This program is free software: you can redistribute it and/or modify
    +it under the terms of the GNU General Public License as published by
    +the Free Software Foundation, either version 3 of the License, or
    +(at your option) any later version.
    +
    +This program is distributed in the hope that it will be useful,
    +but WITHOUT ANY WARRANTY; without even the implied warranty of
    +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    +GNU General Public License for more details.
    +
    +You should have received a copy of the GNU General Public License
    +along with this program.  If not, see <http://www.gnu.org/licenses/>.

    Also add information on how to contact you by electronic and paper mail.

    If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:

    -
    <program>  Copyright (C) <year>  <name of author>
    -This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    -This is free software, and you are welcome to redistribute it
    -under certain conditions; type `show c' for details.
    +
    <program>  Copyright (C) <year>  <name of author>
    +This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
    +This is free software, and you are welcome to redistribute it
    +under certain conditions; type `show c' for details.

    The hypothetical commands show w' andshow c’ should show the appropriate parts of the General Public License. Of course, your program’s commands might be different; for a GUI interface, you would use an “about box”.

    You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see http://www.gnu.org/licenses/.

    The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read http://www.gnu.org/philosophy/why-not-lgpl.html.

    diff --git a/docs/articles/comorbidityscores.html b/docs/articles/comorbidityscores.html index c32bbcc..3fb447e 100644 --- a/docs/articles/comorbidityscores.html +++ b/docs/articles/comorbidityscores.html @@ -79,13 +79,13 @@ -
    +

    @@ -590,16 +590,14 @@

    Contents

    Simulating ICD-10 codes

    The comorbidity packages includes a function named sample_diag() that allows simulating ICD diagnostic codes in a straightforward way. For instance, we could simulate ICD-10 codes:

    -
    # load the comorbidity package
    -library(comorbidity)
    -# set a seed for reproducibility
    -set.seed(1)
    -# simulate 50 ICD-10 codes for 5 individuals
    -x <- data.frame(
    -  id = sample(1:5, size = 50, replace = TRUE),
    -  code = sample_diag(n = 50),
    -  stringsAsFactors = FALSE
    -)
    -x <- x[order(x$id, x$code), ]
    -print(head(x, n = 15), row.names = FALSE)
    -##  id code
    -##   1  B02
    -##   1 B582
    -##   1 I749
    -##   1 J450
    -##   1 L893
    -##   1 Q113
    -##   1  Q26
    -##   1 Q978
    -##   1 T224
    -##   1 V101
    -##   1 V244
    -##   1  V46
    -##   2 A665
    -##   2 C843
    -##   2 D838
    +

    It is also possible to simulate from two different versions of the ICD-10 coding system. The default is to simulate ICD-10 codes from the 2011 version:

    -
    set.seed(1)
    -x1 <- data.frame(
    -  id = sample(1:3, size = 30, replace = TRUE),
    -  code = sample_diag(n = 30),
    -  stringsAsFactors = FALSE
    -)
    -set.seed(1)
    -x2 <- data.frame(
    -  id = sample(1:3, size = 30, replace = TRUE),
    -  code = sample_diag(n = 30, version = "ICD10_2011"),
    -  stringsAsFactors = FALSE
    -)
    -# should return TRUE
    -all.equal(x1, x2)
    -## [1] TRUE
    +
    set.seed(1)
    +x1 <- data.frame(
    +  id = sample(1:3, size = 30, replace = TRUE),
    +  code = sample_diag(n = 30),
    +  stringsAsFactors = FALSE
    +)
    +set.seed(1)
    +x2 <- data.frame(
    +  id = sample(1:3, size = 30, replace = TRUE),
    +  code = sample_diag(n = 30, version = "ICD10_2011"),
    +  stringsAsFactors = FALSE
    +)
    +# should return TRUE
    +all.equal(x1, x2)
    +## [1] TRUE

    Alternatively, you could use the 2009 version:

    -
    set.seed(1)
    -x1 <- data.frame(
    -  id = sample(1:3, size = 30, replace = TRUE),
    -  code = sample_diag(n = 30, version = "ICD10_2009"),
    -  stringsAsFactors = FALSE
    -)
    -set.seed(1)
    -x2 <- data.frame(
    -  id = sample(1:3, size = 30, replace = TRUE),
    -  code = sample_diag(n = 30, version = "ICD10_2011"),
    -  stringsAsFactors = FALSE
    -)
    -# should not return TRUE
    -all.equal(x1, x2)
    -## [1] "Component \"code\": 30 string mismatches"
    +
    set.seed(1)
    +x1 <- data.frame(
    +  id = sample(1:3, size = 30, replace = TRUE),
    +  code = sample_diag(n = 30, version = "ICD10_2009"),
    +  stringsAsFactors = FALSE
    +)
    +set.seed(1)
    +x2 <- data.frame(
    +  id = sample(1:3, size = 30, replace = TRUE),
    +  code = sample_diag(n = 30, version = "ICD10_2011"),
    +  stringsAsFactors = FALSE
    +)
    +# should not return TRUE
    +all.equal(x1, x2)
    +## [1] "Component \"code\": 30 string mismatches"

    Simulating ICD-9 codes

    ICD-9 codes can be easily simulated too:

    -
    set.seed(2)
    -x9 <- data.frame(
    -  id = sample(1:3, size = 30, replace = TRUE),
    -  code = sample_diag(n = 30, version = "ICD9_2015"),
    -  stringsAsFactors = FALSE
    -)
    -x9 <- x9[order(x9$id, x9$code), ]
    -print(head(x9, n = 15), row.names = FALSE)
    -##  id  code
    -##   1 01130
    -##   1 01780
    -##   1 30151
    -##   1  3073
    -##   1 36907
    -##   1 37845
    -##   1 64212
    -##   1 66704
    -##   1 72633
    -##   1  9689
    -##   1  V289
    -##   2  0502
    -##   2 09169
    -##   2 20046
    -##   2 25082
    +

    Computing comorbidity scores

    The main function of the comorbidity package is named comorbidity(), and it can be used to compute any supported comorbidity score; scores can be specified by setting the score argument, which is required.

    Say we have 3 individuals with a total of 30 ICD-10 diagnostic codes:

    -
    set.seed(1)
    -x <- data.frame(
    -  id = sample(1:3, size = 30, replace = TRUE),
    -  code = sample_diag(n = 30),
    -  stringsAsFactors = FALSE
    -)
    +
    set.seed(1)
    +x <- data.frame(
    +  id = sample(1:3, size = 30, replace = TRUE),
    +  code = sample_diag(n = 30),
    +  stringsAsFactors = FALSE
    +)

    We could compute the Charlson score, index, and each comorbidity domain:

    -
    charlson <- comorbidity(x = x, id = "id", code = "code", score = "charlson", icd = "icd10", assign0 = FALSE)
    -charlson
    -##   id ami chf pvd cevd dementia copd rheumd pud mld diab diabwc hp rend canc msld metacanc aids
    -## 1  1   0   0   0    0        0    0      0   0   0    0      0  0    0    1    0        0    1
    -## 2  2   0   0   0    0        0    0      0   0   0    0      0  0    0    1    0        0    0
    -## 3  3   0   0   0    0        0    0      0   0   0    0      0  0    0    0    0        0    0
    -##   score index wscore windex
    -## 1     2   1-2      8    >=5
    -## 2     1   1-2      2    1-2
    -## 3     0     0      0      0
    +

    We set the assign0 argument to FALSE to not apply a hierarchy of comorbidity codes, as described in ?comorbidity::comorbidity. The default is to assume ICD-10 codes are passed to comorbidity:

    -
    charlson.default <- comorbidity(x = x, id = "id", code = "code", score = "charlson", assign0 = FALSE)
    -all.equal(charlson, charlson.default)
    -## [1] TRUE
    +
    charlson.default <- comorbidity(x = x, id = "id", code = "code", score = "charlson", assign0 = FALSE)
    +all.equal(charlson, charlson.default)
    +## [1] TRUE

    Alternatively, we could compute the Elixhauser score:

    -
    elixhauser <- comorbidity(x = x, id = "id", code = "code", score = "elixhauser", icd = "icd10", assign0 = FALSE)
    -elixhauser
    -##   id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf ld pud aids lymph
    -## 1  1   0     0    0   0   0      0    0    0   0   0       0     0       0  0  0   0    1     0
    -## 2  2   0     0    1   0   0      0    0    0   0   0       0     0       0  0  0   0    0     0
    -## 3  3   0     0    0   0   0      0    0    0   1   0       0     0       0  0  0   0    0     0
    -##   metacanc solidtum rheumd coag obes wloss fed blane dane alcohol drug psycho depre score index
    -## 1        0        1      0    0    0     0   0     0    0       0    0      0     0     2   1-4
    -## 2        0        1      0    0    0     0   0     0    0       0    0      0     0     2   1-4
    -## 3        0        0      0    0    0     0   0     0    0       0    0      0     0     1   1-4
    -##   wscore_ahrq wscore_vw windex_ahrq windex_vw
    -## 1           7         4         >=5       1-4
    -## 2           7         3         >=5       1-4
    -## 3           5         6         >=5       >=5
    +

    Conversely, say we have 5 individuals with a total of 100 ICD-9 diagnostic codes:

    -
    set.seed(3)
    -x <- data.frame(
    -  id = sample(1:5, size = 100, replace = TRUE),
    -  code = sample_diag(n = 100, version = "ICD9_2015"),
    -  stringsAsFactors = FALSE
    -)
    +
    set.seed(3)
    +x <- data.frame(
    +  id = sample(1:5, size = 100, replace = TRUE),
    +  code = sample_diag(n = 100, version = "ICD9_2015"),
    +  stringsAsFactors = FALSE
    +)

    The Charlson and Elixhauser comorbidity codes can be easily computed:

    We could compute the Charlson score, index, and each comorbidity domain:

    -
    charlson9 <- comorbidity(x = x, id = "id", code = "code", score = "charlson", icd = "icd9", assign0 = FALSE)
    -charlson9
    -##   id ami chf pvd cevd dementia copd rheumd pud mld diab diabwc hp rend canc msld metacanc aids
    -## 1  1   0   0   1    0        0    0      0   0   0    0      0  0    0    1    0        0    0
    -## 2  2   0   0   0    1        0    0      0   0   0    0      0  0    0    0    0        0    0
    -## 3  3   0   0   0    0        0    0      0   1   0    0      0  0    0    0    0        0    0
    -## 4  4   0   0   1    1        0    0      0   0   0    0      0  0    0    1    0        0    0
    -## 5  5   0   0   0    0        0    0      0   0   0    0      0  0    0    1    0        0    0
    -##   score index wscore windex
    -## 1     2   1-2      3    3-4
    -## 2     1   1-2      1    1-2
    -## 3     1   1-2      1    1-2
    -## 4     3   3-4      4    3-4
    -## 5     1   1-2      2    1-2
    +

    Alternatively, we could compute the Elixhauser score:

    -
    elixhauser9 <- comorbidity(x = x, id = "id", code = "code", score = "elixhauser", icd = "icd9", assign0 = FALSE)
    -elixhauser9
    -##   id chf carit valv pcd pvd hypunc hypc para ond cpd diabunc diabc hypothy rf ld pud aids lymph
    -## 1  1   0     0    0   0   1      0    0    0   0   0       0     0       0  0  0   0    0     0
    -## 2  2   0     0    0   0   0      0    0    0   1   0       0     0       0  0  0   0    0     0
    -## 3  3   0     0    0   0   0      0    0    0   0   0       0     0       0  0  0   0    0     0
    -## 4  4   0     0    0   1   1      0    0    0   0   0       0     0       0  0  0   0    0     0
    -## 5  5   0     0    0   0   0      0    0    0   0   0       0     0       0  0  0   0    0     0
    -##   metacanc solidtum rheumd coag obes wloss fed blane dane alcohol drug psycho depre score index
    -## 1        0        0      0    0    0     0   0     0    0       0    0      0     0     1   1-4
    -## 2        0        0      0    0    0     0   0     0    0       0    0      0     0     1   1-4
    -## 3        0        0      0    0    0     0   0     0    0       0    0      1     0     1   1-4
    -## 4        0        0      0    0    0     0   0     0    0       0    0      0     0     2   1-4
    -## 5        0        0      1    0    0     0   0     0    0       0    0      0     0     1   1-4
    -##   wscore_ahrq wscore_vw windex_ahrq windex_vw
    -## 1           3         2         1-4       1-4
    -## 2           5         6         >=5       >=5
    -## 3          -5         0          <0         0
    -## 4           9         6         >=5       >=5
    -## 5           0         0           0         0
    +

    The weighted Elixhauser score is computed using both the AHRQ and the van Walraven algorithm (wscore_ahrq and wscore_vw).

    Citation

    If you find comorbidity useful, please cite it in your publications:

    -
    citation("comorbidity")
    -## 
    -## To cite the comorbidity package in publications, please use:
    -## 
    -##   Gasparini, (2018). comorbidity: An R package for computing comorbidity scores. Journal
    -##   of Open Source Software, 3(23), 648, https://doi.org/10.21105/joss.00648
    -## 
    -## A BibTeX entry for LaTeX users is
    -## 
    -##   @Article{,
    -##     author = {Alessandro Gasparini},
    -##     title = {comorbidity: An R package for computing comorbidity scores},
    -##     journal = {Journal of Open Source Software},
    -##     year = {2018},
    -##     volume = {3},
    -##     issue = {23},
    -##     pages = {648},
    -##     doi = {10.21105/joss.00648},
    -##     url = {https://doi.org/10.21105/joss.00648},
    -##   }
    +

    References

    This package is based on the ICD-10-based formulations of the Charlson score and Elixhauser score proposed by Quan et al. in 2005. The ICD-9 formulation of the Charlson score is also from Quan et al. The ICD-9-based Elixhauser score is according to the AHRQ formulation (Moore et al., 2017). Weights for the Charlson score are based on the original formulation by Charlson et al. in 1987, while weights for the Elixhauser score are based on work by van Walraven et al. Finally, the categorisation of scores and weighted scores is based on work by Menendez et al. Further details on each algorithm are included in the package vignette, which you can access by typing the following in the R console:

    -
    vignette("comorbidityscores", package = "comorbidity")
    +
    vignette("comorbidityscores", package = "comorbidity")
    • Quan H, Sundararajan V, Halfon P, Fong A, Burnand B, Luthi JC, et al. Coding algorithms for defining comorbidities in ICD-9-CM and ICD-10 administrative data. Medical Care 2005; 43(11):1130-1139. DOI: 10.1097/01.mlr.0000182534.19832.83
    • diff --git a/docs/news/index.html b/docs/news/index.html index 1dafb7e..27a6761 100644 --- a/docs/news/index.html +++ b/docs/news/index.html @@ -180,7 +180,7 @@

      BREAKING CHANGES

      -

      Modified the behaviour of the assign0 argument after further discussion with Anders Alexandersson in Issue #9: now there is no default, forcing the user to decide whether to apply a hierarchy of comorbidity codes or not. This will make the algorithm more transparent to the end user, allowing an informed choice. See ?comorbidity::comorbidity and vignette("comorbidityscores", package = "comorbidity") for further details on the hierarchy being applied.

      +

      Modified the behaviour of the assign0 argument after further discussion with Anders Alexandersson in Issue #9: now there is no default, forcing the user to decide whether to apply a hierarchy of comorbidity codes or not. This will make the algorithm more transparent to the end user, allowing an informed choice. See ?comorbidity::comorbidity and vignette("comorbidityscores", package = "comorbidity") for further details on the hierarchy being applied.

    @@ -191,7 +191,7 @@

    BREAKING CHANGES

    comorbidity now returns two Elixhauser scores, one computed using the algorithm of val Walraven et al. (2009) and a second one computed using the AHRQ algorithm (Moore et al., 2017). Thanks to Yumiko Abe-Jones for feedback and the discussion regarding weighted Elixhauser scores.

    -

    More information can be found on the package vignette: vignette("comorbidityscores", package = "comorbidity").

    +

    More information can be found on the package vignette: vignette("comorbidityscores", package = "comorbidity").

    diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 84b726e..8c85c95 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,8 +1,8 @@ -pandoc: 2.9.1 +pandoc: 2.7.2 pkgdown: 1.4.1 pkgdown_sha: ~ articles: - comorbidityscores: comorbidityscores.html + comorbidityscores: ../../../../../../../Z:/R-Dev/comorbidity/vignettes/comorbidityscores.html urls: reference: https://ellessenne.github.io/comorbidity/reference article: https://ellessenne.github.io/comorbidity/articles diff --git a/docs/reference/comorbidity.html b/docs/reference/comorbidity.html index 6f899b0..19c95fc 100644 --- a/docs/reference/comorbidity.html +++ b/docs/reference/comorbidity.html @@ -268,7 +268,7 @@

    Value

    Labels are presented to the user when using the RStudio viewer (e.g. via the utils::View() function) for convenience.

    Details

    -

    The ICD-10 and ICD-9-CM coding for the Charlson and Elixhauser scores is based on work by Quan et al. (2005). Weights for the Charlson score are based on the original formulation by Charlson et al. in 1987, while weights for the Elixhauser score are based on work by Moore et al. and van Walraven et al. Finally, the categorisation of scores and weighted scores is based on work by Menendez et al. See vignette("comorbidityscores", package = "comorbidity") for further details on the comorbidity scores and the weighting algorithm. +

    The ICD-10 and ICD-9-CM coding for the Charlson and Elixhauser scores is based on work by Quan et al. (2005). Weights for the Charlson score are based on the original formulation by Charlson et al. in 1987, while weights for the Elixhauser score are based on work by Moore et al. and van Walraven et al. Finally, the categorisation of scores and weighted scores is based on work by Menendez et al. See vignette("comorbidityscores", package = "comorbidity") for further details on the comorbidity scores and the weighting algorithm. ICD-10 and ICD-9 codes must be in upper case and with alphanumeric characters only in order to be properly recognised; set tidy.codes = TRUE to properly tidy the codes automatically. As a convenience, a message is printed to the R console when non-alphanumeric characters are found.

    References

    diff --git a/docs/reference/index.html b/docs/reference/index.html index c1cd65a..ffdca6d 100644 --- a/docs/reference/index.html +++ b/docs/reference/index.html @@ -162,27 +162,27 @@

    icd10_2009

    +

    icd10cm_2017

    -

    ICD-10 Diagnostic Codes, 2009 Version

    +

    ICD-10-CM Diagnostic Codes, 2017 Version

    -

    icd10_2011

    +

    icd10cm_2018

    -

    ICD-10 Diagnostic Codes, 2011 Version

    +

    ICD-10-CM Diagnostic Codes, 2018 Version

    -

    icd10cm_2017

    +

    icd10_2009

    -

    ICD-10-CM Diagnostic Codes, 2017 Version

    +

    ICD-10 Diagnostic Codes, 2009 Version

    -

    icd10cm_2018

    +

    icd10_2011

    -

    ICD-10-CM Diagnostic Codes, 2018 Version

    +

    ICD-10 Diagnostic Codes, 2011 Version

    diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 20506d2..024db1a 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -13,16 +13,16 @@ https://ellessenne.github.io/comorbidity/reference/comorbidity.html - https://ellessenne.github.io/comorbidity/reference/icd10_2009.html + https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html - https://ellessenne.github.io/comorbidity/reference/icd10_2011.html + https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html - https://ellessenne.github.io/comorbidity/reference/icd10cm_2017.html + https://ellessenne.github.io/comorbidity/reference/icd10_2009.html - https://ellessenne.github.io/comorbidity/reference/icd10cm_2018.html + https://ellessenne.github.io/comorbidity/reference/icd10_2011.html https://ellessenne.github.io/comorbidity/reference/icd9_2015.html