{
  "_id": "6a1973e5acfb0bcc41defc88",
  "Package": "AgeTopicModels",
  "Title": "Inferring Age-Dependent Disease Topic from Diagnosis Data",
  "Version": "0.3.0",
  "Authors@R": "person(\"Xilin\", \"Jiang\", , \"jiangxilin1@gmail.com\", role = c(\"aut\", \"cre\"),\ncomment = c(ORCID = \"0000-0001-6773-9182\"))",
  "Description": "We propose an age-dependent topic modelling (ATM) model,\nproviding a low-rank representation of longitudinal records of\nhundreds of distinct diseases in large electronic health record\ndata sets. The model assigns to each individual topic weights\nfor several disease topics; each disease topic reflects a set\nof diseases that tend to co-occur as a function of age,\nquantified by age-dependent topic loadings for each disease.\nThe model assumes that for each disease diagnosis, a topic is\nsampled based on the individual’s topic weights (which sum to 1\nacross topics, for a given individual), and a disease is\nsampled based on the individual’s age and the age-dependent\ntopic loadings (which sum to 1 across diseases, for a given\ntopic at a given age). The model generalises the Latent\nDirichlet Allocation (LDA) model by allowing topic loadings for\neach topic to vary with age. References: Jiang (2023)\n<doi:10.1038/s41588-023-01522-8>.",
  "License": "MIT + file LICENSE",
  "Config/testthat/edition": "3",
  "Encoding": "UTF-8",
  "LazyData": "true",
  "LazyDataCompression": "xz",
  "RoxygenNote": "7.3.3",
  "NeedsCompilation": "no",
  "Packaged": {
    "Date": "2026-05-29 09:33:03 UTC",
    "User": "root"
  },
  "Author": "Xilin Jiang [aut, cre] (ORCID:\n<https://orcid.org/0000-0001-6773-9182>)",
  "Maintainer": "Xilin Jiang <jiangxilin1@gmail.com>",
  "Config/pak/sysreqs": "libicu-dev",
  "Repository": "https://xilin-jiang.r-universe.dev",
  "Date/Publication": "2026-02-28 12:20:02 UTC",
  "RemoteUrl": "https://github.com/cran/AgeTopicModels",
  "RemoteRef": "HEAD",
  "RemoteSha": "78cbce78d9a57fb36cdf72840d6c6decba707354",
  "MD5sum": "07bc993543f786e75e426914d4c87398",
  "_user": "xilin-jiang",
  "_type": "src",
  "_file": "AgeTopicModels_0.3.0.tar.gz",
  "_fileid": "b28b74c8cd8b932e9f484351ae7ec1b9f48045d319c9c7aa32422c72a8031a73",
  "_filesize": 5069861,
  "_sha256": "b28b74c8cd8b932e9f484351ae7ec1b9f48045d319c9c7aa32422c72a8031a73",
  "_created": "2026-05-29T09:33:03.000Z",
  "_published": "2026-05-29T11:09:25.337Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 78475279393,
      "time": 267,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7287686889"
    },
    {
      "job": 78475279428,
      "time": 262,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7287685688"
    },
    {
      "job": 78475279375,
      "time": 293,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7289249279"
    },
    {
      "job": 78475279380,
      "time": 215,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7289225418"
    },
    {
      "job": 78474797554,
      "time": 185,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7287605234"
    },
    {
      "job": 78475279417,
      "time": 134,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7287646804"
    },
    {
      "job": 78475279401,
      "time": 305,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7287697743"
    },
    {
      "job": 78475279402,
      "time": 261,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7287684850"
    },
    {
      "job": 78475279413,
      "time": 302,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7287697385"
    }
  ],
  "_buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/cran/AgeTopicModels",
  "_commit": {
    "id": "78cbce78d9a57fb36cdf72840d6c6decba707354",
    "author": "Xilin Jiang <jiangxilin1@gmail.com>",
    "committer": "cran-robot <csardi.gabor+cran@gmail.com>",
    "message": "version 0.3.0\n",
    "time": 1772281202
  },
  "_maintainer": {
    "name": "Xilin Jiang",
    "email": "jiangxilin1@gmail.com",
    "login": "xilin-jiang",
    "orcid": "0000-0001-6773-9182",
    "description": "apprentice statistician/geneticist",
    "uuid": 32958552
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5",
      "role": "Depends"
    },
    {
      "package": "data.table",
      "role": "Imports"
    },
    {
      "package": "dplyr",
      "role": "Imports"
    },
    {
      "package": "ggplot2",
      "role": "Imports"
    },
    {
      "package": "ggrepel",
      "role": "Imports"
    },
    {
      "package": "grDevices",
      "role": "Imports"
    },
    {
      "package": "gtools",
      "role": "Imports"
    },
    {
      "package": "magrittr",
      "role": "Imports"
    },
    {
      "package": "pROC",
      "role": "Imports"
    },
    {
      "package": "reshape2",
      "role": "Imports"
    },
    {
      "package": "rlang",
      "role": "Imports"
    },
    {
      "package": "stats",
      "role": "Imports"
    },
    {
      "package": "stringr",
      "role": "Imports"
    },
    {
      "package": "tibble",
      "role": "Imports"
    },
    {
      "package": "tidyr",
      "role": "Imports"
    },
    {
      "package": "utils",
      "role": "Imports"
    },
    {
      "package": "testthat",
      "version": ">= 3.0.0",
      "role": "Suggests"
    }
  ],
  "_owner": "cran",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-43",
      "n": 1
    },
    {
      "week": "2026-09",
      "n": 1
    }
  ],
  "_tags": [
    {
      "name": "0.1.0",
      "date": "2025-10-21"
    },
    {
      "name": "0.3.0",
      "date": "2026-02-28"
    }
  ],
  "_stars": 0,
  "_contributors": [
    {
      "user": "xilin-jiang",
      "count": 2,
      "uuid": 32958552
    }
  ],
  "_userbio": {
    "uuid": 32958552,
    "type": "user",
    "name": "Xilin-Jiang",
    "description": "apprentice statistician/geneticist"
  },
  "_downloads": {
    "count": 210,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/AgeTopicModels"
  },
  "_searchresults": 2,
  "_rbuild": "4.6.0",
  "_assets": [
    "extra/AgeTopicModels.html",
    "extra/citation.cff",
    "extra/citation.html",
    "extra/citation.json",
    "extra/citation.txt",
    "extra/contents.json",
    "extra/NEWS.html",
    "extra/NEWS.txt",
    "extra/readme.html",
    "extra/readme.md",
    "manual.pdf"
  ],
  "_realowner": "xilin-jiang",
  "_cranurl": false,
  "_releases": [
    {
      "version": "0.1.0",
      "date": "2025-10-21"
    },
    {
      "version": "0.3.0",
      "date": "2026-02-28"
    }
  ],
  "_exports": [
    "%>%",
    "age_imputation",
    "diseasematrix2longdata",
    "icd2phecode",
    "loading2weights",
    "longdata2diseasematrix",
    "plot_age_topics",
    "plot_lfa_topics",
    "prediction_OR",
    "simulate_genetic_disease_from_topic",
    "simulate_topics",
    "wrapper_ATM",
    "wrapper_LFA"
  ],
  "_datasets": [
    {
      "name": "disease_info_phecode_icd10",
      "title": "Disease information linking PheCodes and ICD-10",
      "object": "disease_info_phecode_icd10",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "ICD10",
        "phecode",
        "phenotype",
        "exclude_range",
        "exclude_name"
      ],
      "rows": 1755,
      "table": true,
      "tojson": true
    },
    {
      "name": "HES_age_example",
      "title": "Example HES diagnosis ages",
      "object": "HES_age_example",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "eid",
        "diag_icd10",
        "age_diag"
      ],
      "rows": 31118,
      "table": true,
      "tojson": true
    },
    {
      "name": "HES_icd10_example",
      "title": "Example HES ICD-10 diagnoses",
      "object": "HES_icd10_example",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "eid",
        "diag_icd10",
        "age_diag"
      ],
      "rows": 38760,
      "table": true,
      "tojson": true
    },
    {
      "name": "phecode_icd10",
      "title": "ICD-10 <-> PheCode mapping",
      "object": "phecode_icd10",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "ICD10",
        "PheCode",
        "Excl..Phecodes",
        "Excl..Phenotypes"
      ],
      "rows": 9165,
      "table": true,
      "tojson": true
    },
    {
      "name": "phecode_icd10cm",
      "title": "ICD-10-CM <-> PheCode mapping",
      "object": "phecode_icd10cm",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "ICD10",
        "phecode",
        "exclude_range",
        "exclude_name"
      ],
      "rows": 82991,
      "table": true,
      "tojson": true
    },
    {
      "name": "short_icd10",
      "title": "Short labels (at most first for letters/digits) for ICD-10 codes",
      "object": "short_icd10",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "ICD10",
        "parent_phecode",
        "Excl..Phecodes",
        "Excl..Phenotypes",
        "occ"
      ],
      "rows": 9165,
      "table": true,
      "tojson": true
    },
    {
      "name": "short_icd10cm",
      "title": "Short labels (at most first for letters/digits) for ICD-10-CM codes",
      "object": "short_icd10cm",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "ICD10",
        "parent_phecode",
        "exclude_range",
        "exclude_name",
        "occ"
      ],
      "rows": 10020,
      "table": true,
      "tojson": true
    },
    {
      "name": "SNOMED_ICD10CM",
      "title": "SNOMED <-> ICD-10(-CM) mapping (excerpt)",
      "object": "SNOMED_ICD10CM",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "SNOMED",
        "SNOMED_description",
        "ICD10",
        "ICD10_name",
        "occ"
      ],
      "rows": 103390,
      "table": true,
      "tojson": true
    },
    {
      "name": "UKB_349_disease",
      "title": "List of 349 UK Biobank diseases (example)",
      "object": "UKB_349_disease",
      "class": [
        "data.frame"
      ],
      "fields": [
        "diag_icd10",
        "occ"
      ],
      "rows": 349,
      "table": true,
      "tojson": true
    },
    {
      "name": "UKB_HES_10topics",
      "title": "Example topic model output (10 topics, UKB HES)",
      "object": "UKB_HES_10topics",
      "class": [
        "array"
      ],
      "fields": [],
      "table": false,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "age_imputation",
      "title": "imputing missing age if you can't find some of them The function does two stage imputation: i. if the individual has other age label - use the mean, min, or max of other age labels for the missing ones. ii. if the individual has no age label - use the mean, min, max for all the diagnosis codes iii. if there is no age info available for any of this code, we will impute it as the mean of all age codes in the data",
      "topics": [
        "age_imputation"
      ]
    },
    {
      "page": "disease_info_phecode_icd10",
      "title": "Disease information linking PheCodes and ICD-10",
      "topics": [
        "disease_info_phecode_icd10"
      ]
    },
    {
      "page": "diseasematrix2longdata",
      "title": "Disease matrix reformatting for ATM",
      "topics": [
        "diseasematrix2longdata"
      ]
    },
    {
      "page": "HES_age_example",
      "title": "Example HES diagnosis ages",
      "topics": [
        "HES_age_example"
      ]
    },
    {
      "page": "HES_icd10_example",
      "title": "Example HES ICD-10 diagnoses",
      "topics": [
        "HES_icd10_example"
      ]
    },
    {
      "page": "icd2phecode",
      "title": "Mapping the disease code from icd10 to phecode",
      "topics": [
        "icd2phecode"
      ]
    },
    {
      "page": "loading2weights",
      "title": "Mapping individuals to fixed topic loadings.",
      "topics": [
        "loading2weights"
      ]
    },
    {
      "page": "longdata2diseasematrix",
      "title": "Title",
      "topics": [
        "longdata2diseasematrix"
      ]
    },
    {
      "page": "phecode_icd10",
      "title": "ICD-10 <-> PheCode mapping",
      "topics": [
        "phecode_icd10"
      ]
    },
    {
      "page": "phecode_icd10cm",
      "title": "ICD-10-CM <-> PheCode mapping",
      "topics": [
        "phecode_icd10cm"
      ]
    },
    {
      "page": "plot_age_topics",
      "title": "Title plot the topic loadings across age.",
      "topics": [
        "plot_age_topics"
      ]
    },
    {
      "page": "plot_lfa_topics",
      "title": "Title plot topic loadings for LFA.",
      "topics": [
        "plot_lfa_topics"
      ]
    },
    {
      "page": "prediction_OR",
      "title": "Title Compute prediction odds ratio for a testing data set using pre-training ATM topic loading. Note only diseases listed in the ds_list will be used. The prediction odds ratio is the odds predicted by ATM versus a naive prediction using disease probability.",
      "topics": [
        "prediction_OR"
      ]
    },
    {
      "page": "short_icd10",
      "title": "Short labels (at most first for letters/digits) for ICD-10 codes",
      "topics": [
        "short_icd10"
      ]
    },
    {
      "page": "short_icd10cm",
      "title": "Short labels (at most first for letters/digits) for ICD-10-CM codes",
      "topics": [
        "short_icd10cm"
      ]
    },
    {
      "page": "simulate_genetic_disease_from_topic",
      "title": "Simulate genetic-disease-topic structure (step 2)",
      "topics": [
        "simulate_genetic_disease_from_topic"
      ]
    },
    {
      "page": "simulate_topics",
      "title": "Simulate genetic-disease-topic structure (step 1)",
      "topics": [
        "simulate_topics"
      ]
    },
    {
      "page": "SNOMED_ICD10CM",
      "title": "SNOMED <-> ICD-10(-CM) mapping (excerpt)",
      "topics": [
        "SNOMED_ICD10CM"
      ]
    },
    {
      "page": "UKB_349_disease",
      "title": "List of 349 UK Biobank diseases (example)",
      "topics": [
        "UKB_349_disease"
      ]
    },
    {
      "page": "UKB_HES_10topics",
      "title": "Example topic model output (10 topics, UKB HES)",
      "topics": [
        "UKB_HES_10topics"
      ]
    },
    {
      "page": "wrapper_ATM",
      "title": "Run ATM on diagnosis data.",
      "topics": [
        "wrapper_ATM"
      ]
    },
    {
      "page": "wrapper_LFA",
      "title": "Run LFA on diagnosis data.",
      "topics": [
        "wrapper_LFA"
      ]
    }
  ],
  "_readme": "https://github.com/cran/AgeTopicModels/raw/HEAD/README.md",
  "_rundeps": [
    "cli",
    "cpp11",
    "data.table",
    "dplyr",
    "farver",
    "generics",
    "ggplot2",
    "ggrepel",
    "glue",
    "gtable",
    "gtools",
    "isoband",
    "labeling",
    "lifecycle",
    "magrittr",
    "pillar",
    "pkgconfig",
    "plyr",
    "pROC",
    "purrr",
    "R6",
    "RColorBrewer",
    "Rcpp",
    "reshape2",
    "rlang",
    "S7",
    "scales",
    "stringi",
    "stringr",
    "tibble",
    "tidyr",
    "tidyselect",
    "utf8",
    "vctrs",
    "viridisLite",
    "withr"
  ],
  "_score": 2,
  "_indexed": true,
  "_nocasepkg": "agetopicmodels",
  "_universes": [
    "xilin-jiang"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "0.3.0",
      "date": "2026-05-29T09:35:26.000Z",
      "distro": "noble",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "4534761f6961c33b9af36aab7b28ea1698b71793e53b9a2d01454adaef5d68ae",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "0.3.0",
      "date": "2026-05-29T09:35:25.000Z",
      "distro": "noble",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "658d094ad536f62a3867b343f7c8bc72f4fd6587cd7af8c593187ffdfbddf4b0",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "0.3.0",
      "date": "2026-05-29T11:06:22.000Z",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "eeea0a31bc57b62f63813b3f3c2e7959609099ba1305b7c25f3aea5909dfe2ec",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "0.3.0",
      "date": "2026-05-29T11:05:43.000Z",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "496fee19a9a9465630a1709a39ae02ffcb6357df772c32cef0888742d72afeb6",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "0.3.0",
      "date": "2026-05-29T09:35:39.000Z",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "5b2098a797b537cd2d30dffb8afd07724a58b521f42caae4bf020c0d894313a1",
      "status": "success",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "0.3.0",
      "date": "2026-05-29T09:34:44.000Z",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "08f8dcd9feeddeedc95d3d0f9b2b472c07bd0cac78f9ae9b66d045a630c92509",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "0.3.0",
      "date": "2026-05-29T09:34:28.000Z",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "a4b58a4c7a8fdc4a43415e34f2d3cc123334d651f9ca991832e1f8e50dfa5777",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "0.3.0",
      "date": "2026-05-29T09:34:32.000Z",
      "commit": "78cbce78d9a57fb36cdf72840d6c6decba707354",
      "fileid": "76dd7f8a37dbce872d3c6c07594662e2ec915c5182859ad99b3c653fb9309f3c",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/xilin-jiang/actions/runs/26629565531"
    }
  ]
}