{
  "_id": "6a2922eb732311cd8759d24f",
  "Package": "segregation",
  "Type": "Package",
  "Title": "Entropy-Based Segregation Indices",
  "Version": "1.1.0.9000",
  "Authors@R": "person(\"Benjamin\", \"Elbers\", email = \"be2239@columbia.edu\",\nrole = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0001-5392-3448\"))",
  "Description": "Computes segregation indices, including the Index of\nDissimilarity, as well as the information-theoretic indices\ndeveloped by Theil (1971) <isbn:978-0471858454>, namely the\nMutual Information Index (M) and Theil's Information Index (H).\nThe M, further described by Mora and Ruiz-Castillo (2011)\n<doi:10.1111/j.1467-9531.2011.01237.x> and Frankel and Volij\n(2011) <doi:10.1016/j.jet.2010.10.008>, is a measure of\nsegregation that is highly decomposable. The package provides\ntools to decompose the index by units and groups (local\nsegregation), and by within and between terms. The package also\nprovides a method to decompose differences in segregation as\ndescribed by Elbers (2021) <doi:10.1177/0049124121986204>. The\npackage includes standard error estimation by bootstrapping,\nwhich also corrects for small sample bias. The package also\ncontains functions for visualizing segregation patterns.",
  "License": "MIT + file LICENSE",
  "Encoding": "UTF-8",
  "LazyData": "true",
  "URL": "https://elbersb.github.io/segregation/",
  "BugReports": "https://github.com/elbersb/segregation/issues",
  "RoxygenNote": "7.3.2",
  "VignetteBuilder": "knitr",
  "SystemRequirements": "C++17",
  "Repository": "https://elbersb.r-universe.dev",
  "Date/Publication": "2025-12-12 08:52:04 UTC",
  "RemoteUrl": "https://github.com/elbersb/segregation",
  "RemoteRef": "HEAD",
  "RemoteSha": "510a3692c7f564f25f9238a54534db61037b7716",
  "NeedsCompilation": "yes",
  "Packaged": {
    "Date": "2026-06-10 08:10:40 UTC",
    "User": "root"
  },
  "Author": "Benjamin Elbers [aut, cre] (ORCID:\n<https://orcid.org/0000-0001-5392-3448>)",
  "Maintainer": "Benjamin Elbers <be2239@columbia.edu>",
  "MD5sum": "56f16dfadce4ff7cfa0ead2fe43df450",
  "_user": "elbersb",
  "_type": "src",
  "_file": "segregation_1.1.0.9000.tar.gz",
  "_fileid": "72ebdb8a06988e83d12fde02ef908c1012478e6c2c2c6b6bdef60b64772a4915",
  "_filesize": 346752,
  "_sha256": "72ebdb8a06988e83d12fde02ef908c1012478e6c2c2c6b6bdef60b64772a4915",
  "_created": "2026-06-10T08:10:40.000Z",
  "_published": "2026-06-10T08:40:11.276Z",
  "_distro": "noble",
  "_jobs": [
    {
      "job": 80511730558,
      "time": 132,
      "config": "linux-devel-arm64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7530098448"
    },
    {
      "job": 80511730554,
      "time": 146,
      "config": "linux-devel-x86_64",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7530103002"
    },
    {
      "job": 80511730659,
      "time": 231,
      "config": "linux-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530133363"
    },
    {
      "job": 80511730647,
      "time": 142,
      "config": "linux-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530101420"
    },
    {
      "job": 80511730672,
      "time": 107,
      "config": "macos-oldrel-arm64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7530653630"
    },
    {
      "job": 80511730609,
      "time": 291,
      "config": "macos-oldrel-x86_64",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7530630816"
    },
    {
      "job": 80511730526,
      "time": 134,
      "config": "macos-release-arm64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530679362"
    },
    {
      "job": 80511730534,
      "time": 392,
      "config": "macos-release-x86_64",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530450778"
    },
    {
      "job": 80511055504,
      "time": 229,
      "config": "source",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530049417"
    },
    {
      "job": 80511730500,
      "time": 118,
      "config": "wasm-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530093066"
    },
    {
      "job": 80511730514,
      "time": 119,
      "config": "windows-devel",
      "r": "4.7.0",
      "check": "OK",
      "artifact": "7530093003"
    },
    {
      "job": 80511730593,
      "time": 140,
      "config": "windows-oldrel",
      "r": "4.5.3",
      "check": "OK",
      "artifact": "7530100570"
    },
    {
      "job": 80511730576,
      "time": 129,
      "config": "windows-release",
      "r": "4.6.0",
      "check": "OK",
      "artifact": "7530097533"
    }
  ],
  "_buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120",
  "_status": "success",
  "_host": "GitHub-Actions",
  "_upstream": "https://github.com/elbersb/segregation",
  "_commit": {
    "id": "510a3692c7f564f25f9238a54534db61037b7716",
    "author": "Benjamin Elbers <elbersb@gmail.com>",
    "committer": "GitHub <noreply@github.com>",
    "message": "Add `mutual_local_expected` (#19)\n\n* Add `mutual_local_expected`\n\n* simplify logic\n\n* more comments\n\n* more refactors\n\n* More tests",
    "time": 1765529524
  },
  "_maintainer": {
    "name": "Benjamin Elbers",
    "email": "be2239@columbia.edu",
    "login": "elbersb",
    "orcid": "0000-0001-5392-3448",
    "description": "",
    "uuid": 116477
  },
  "_registered": true,
  "_dependencies": [
    {
      "package": "R",
      "version": ">= 3.5.0",
      "role": "Depends"
    },
    {
      "package": "Rcpp",
      "role": "LinkingTo"
    },
    {
      "package": "RcppProgress",
      "role": "LinkingTo"
    },
    {
      "package": "data.table",
      "role": "Imports"
    },
    {
      "package": "checkmate",
      "role": "Imports"
    },
    {
      "package": "Rcpp",
      "role": "Imports"
    },
    {
      "package": "RcppProgress",
      "role": "Imports"
    },
    {
      "package": "testthat",
      "role": "Suggests"
    },
    {
      "package": "covr",
      "role": "Suggests"
    },
    {
      "package": "knitr",
      "role": "Suggests"
    },
    {
      "package": "rmarkdown",
      "role": "Suggests"
    },
    {
      "package": "dplyr",
      "role": "Suggests"
    },
    {
      "package": "ggplot2",
      "role": "Suggests"
    },
    {
      "package": "scales",
      "role": "Suggests"
    },
    {
      "package": "tidycensus",
      "role": "Suggests"
    },
    {
      "package": "tigris",
      "role": "Suggests"
    },
    {
      "package": "rrapply",
      "role": "Suggests"
    },
    {
      "package": "dendextend",
      "role": "Suggests"
    },
    {
      "package": "patchwork",
      "role": "Suggests"
    }
  ],
  "_owner": "elbersb",
  "_selfowned": true,
  "_usedby": 0,
  "_updates": [
    {
      "week": "2025-27",
      "n": 1
    },
    {
      "week": "2025-48",
      "n": 2
    },
    {
      "week": "2025-49",
      "n": 1
    },
    {
      "week": "2025-50",
      "n": 1
    }
  ],
  "_tags": [],
  "_topics": [
    "entropy",
    "segregation",
    "statistics",
    "cpp"
  ],
  "_stars": 36,
  "_contributors": [
    {
      "user": "elbersb",
      "count": 224,
      "uuid": 116477
    },
    {
      "user": "mattdowle",
      "count": 2,
      "uuid": 2779998
    }
  ],
  "_userbio": {
    "uuid": 116477,
    "type": "user",
    "name": "Benjamin Elbers"
  },
  "_downloads": {
    "count": 381,
    "source": "https://cranlogs.r-pkg.org/downloads/total/last-month/segregation"
  },
  "_devurl": "https://github.com/elbersb/segregation",
  "_pkgdown": "https://elbersb.github.io/segregation/",
  "_searchresults": 66,
  "_rbuild": "4.6.0",
  "_assets": [
    "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",
    "extra/segregation.html",
    "manual.pdf"
  ],
  "_homeurl": "https://github.com/elbersb/segregation",
  "_realowner": "elbersb",
  "_cranurl": true,
  "_releases": [
    {
      "version": "0.0.1",
      "date": "2018-04-17"
    },
    {
      "version": "0.1.0",
      "date": "2018-06-15"
    },
    {
      "version": "0.2.0",
      "date": "2019-01-14"
    },
    {
      "version": "0.3.0",
      "date": "2019-09-20"
    },
    {
      "version": "0.4.0",
      "date": "2021-01-08"
    },
    {
      "version": "0.5.0",
      "date": "2021-02-08"
    },
    {
      "version": "0.6.0",
      "date": "2021-09-02"
    },
    {
      "version": "1.0.0",
      "date": "2023-08-24"
    },
    {
      "version": "1.1.0",
      "date": "2023-12-02"
    }
  ],
  "_exports": [
    "compress",
    "dissimilarity",
    "dissimilarity_expected",
    "entropy",
    "exposure",
    "get_crosswalk",
    "ipf",
    "isolation",
    "matrix_to_long",
    "merge_units",
    "mutual_difference",
    "mutual_local",
    "mutual_local_expected",
    "mutual_total",
    "mutual_total_expected",
    "mutual_total_nested",
    "mutual_within",
    "scree_plot",
    "segcurve",
    "segplot"
  ],
  "_datasets": [
    {
      "name": "school_ses",
      "title": "Student-level data including SES status",
      "object": "school_ses",
      "class": [
        "data.frame"
      ],
      "fields": [
        "school_id",
        "ethnic_group",
        "ses_quintile"
      ],
      "rows": 5153,
      "table": true,
      "tojson": true
    },
    {
      "name": "schools00",
      "title": "Ethnic/racial composition of schools for 2000/2001",
      "object": "schools00",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "state",
        "district",
        "school",
        "race",
        "n"
      ],
      "rows": 8142,
      "table": true,
      "tojson": true
    },
    {
      "name": "schools05",
      "title": "Ethnic/racial composition of schools for 2005/2006",
      "object": "schools05",
      "class": [
        "tbl_df",
        "tbl",
        "data.frame"
      ],
      "fields": [
        "state",
        "district",
        "school",
        "race",
        "n"
      ],
      "rows": 8013,
      "table": true,
      "tojson": true
    }
  ],
  "_help": [
    {
      "page": "compress",
      "title": "Compresses a data matrix based on mutual information (segregation)",
      "topics": [
        "compress"
      ]
    },
    {
      "page": "dissimilarity",
      "title": "Calculates Index of Dissimilarity",
      "topics": [
        "dissimilarity"
      ]
    },
    {
      "page": "dissimilarity_expected",
      "title": "Calculates expected values when true segregation is zero",
      "topics": [
        "dissimilarity_expected"
      ]
    },
    {
      "page": "entropy",
      "title": "Calculates the entropy of a distribution",
      "topics": [
        "entropy"
      ]
    },
    {
      "page": "exposure",
      "title": "Calculates pairwise exposure indices",
      "topics": [
        "exposure"
      ]
    },
    {
      "page": "get_crosswalk",
      "title": "Create crosswalk after compression",
      "topics": [
        "get_crosswalk"
      ]
    },
    {
      "page": "ipf",
      "title": "Adjustment of marginal distributions using iterative proportional fitting",
      "topics": [
        "ipf"
      ]
    },
    {
      "page": "isolation",
      "title": "Calculates isolation indices",
      "topics": [
        "isolation"
      ]
    },
    {
      "page": "matrix_to_long",
      "title": "Turns a contingency table into long format",
      "topics": [
        "matrix_to_long"
      ]
    },
    {
      "page": "merge_units",
      "title": "Creates a compressed dataset",
      "topics": [
        "merge_units"
      ]
    },
    {
      "page": "mutual_difference",
      "title": "Decomposes the difference between two M indices",
      "topics": [
        "mutual_difference"
      ]
    },
    {
      "page": "mutual_local",
      "title": "Calculates local segregation scores based on M",
      "topics": [
        "mutual_local"
      ]
    },
    {
      "page": "mutual_local_expected",
      "title": "Calculates expected local segregation scores when true segregation is zero",
      "topics": [
        "mutual_local_expected"
      ]
    },
    {
      "page": "mutual_total",
      "title": "Calculates the Mutual Information Index M and Theil's Entropy Index H",
      "topics": [
        "mutual_total"
      ]
    },
    {
      "page": "mutual_total_expected",
      "title": "Calculates expected values when true segregation is zero",
      "topics": [
        "mutual_total_expected"
      ]
    },
    {
      "page": "mutual_total_nested",
      "title": "Calculates a nested decomposition of segregation for M and H",
      "topics": [
        "mutual_total_nested"
      ]
    },
    {
      "page": "mutual_within",
      "title": "Calculates detailed within-category segregation scores for M and H",
      "topics": [
        "mutual_within"
      ]
    },
    {
      "page": "school_ses",
      "title": "Student-level data including SES status",
      "topics": [
        "school_ses"
      ]
    },
    {
      "page": "schools00",
      "title": "Ethnic/racial composition of schools for 2000/2001",
      "topics": [
        "schools00"
      ]
    },
    {
      "page": "schools05",
      "title": "Ethnic/racial composition of schools for 2005/2006",
      "topics": [
        "schools05"
      ]
    },
    {
      "page": "scree_plot",
      "title": "Scree plot for segregation compression",
      "topics": [
        "scree_plot"
      ]
    },
    {
      "page": "segcurve",
      "title": "A visual representation of two-group segregation",
      "topics": [
        "segcurve"
      ]
    },
    {
      "page": "segplot",
      "title": "A visual representation of segregation",
      "topics": [
        "segplot"
      ]
    }
  ],
  "_readme": "https://github.com/elbersb/segregation/raw/HEAD/README.md",
  "_rundeps": [
    "backports",
    "checkmate",
    "data.table",
    "Rcpp",
    "RcppProgress"
  ],
  "_sysdeps": [
    {
      "shlib": "libstdc++",
      "package": "libstdc++6",
      "source": "gcc",
      "version": "14.2.0-4ubuntu2~24.04.1",
      "name": "c++",
      "homepage": "http://gcc.gnu.org/",
      "description": "GNU Standard C++ Library v3"
    }
  ],
  "_vignettes": [
    {
      "source": "segregation.Rmd",
      "filename": "segregation.html",
      "title": "A walkthrough of the segregation package",
      "engine": "knitr::rmarkdown",
      "headings": [
        "The basic mathematics",
        "Data format",
        "Computing the M and H indices",
        "Between-Within decomposition",
        "Local segregation",
        "Inference",
        "Decomposing differences in indices",
        "References"
      ],
      "created": "2021-01-10 15:46:51",
      "modified": "2025-12-05 12:07:35",
      "commits": 9
    },
    {
      "source": "faq.Rmd",
      "filename": "faq.html",
      "title": "FAQ",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Can index X be added to the package?",
        "How can I compute indices for different areas at once?",
        "How can I use Census data from tidycensus to compute segregation indices?",
        "Can I compute local segregation scores for the H index?",
        "How can I compute margins-adjusted local segregation scores?"
      ],
      "created": "2021-08-21 08:52:57",
      "modified": "2024-01-30 21:53:08",
      "commits": 9
    },
    {
      "source": "plotting.Rmd",
      "filename": "plotting.html",
      "title": "Visualizing and compressing segregation",
      "engine": "knitr::rmarkdown",
      "headings": [
        "Segregation curve",
        "Segplot",
        "Compressing segregation information"
      ],
      "created": "2022-06-29 14:43:06",
      "modified": "2023-12-01 13:27:49",
      "commits": 10
    }
  ],
  "_score": 7.1539976866928,
  "_indexed": true,
  "_nocasepkg": "segregation",
  "_universes": [
    "elbersb"
  ],
  "_binaries": [
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:13:01.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "c559f89046a8244571bbf3746be98b4dbd8d4cec6a45f8564c27319dd74cfd36",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.7.0",
      "os": "linux",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:13:09.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "82656d3871b390e2b0f48af1c8d79fdd1405c6eae6fec606a5ab5def75a5c850",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:14:22.000Z",
      "distro": "noble",
      "arch": "aarch64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "b08fb15e7707f2be38eecce6763dd9a3efa9fa15f1cb1f70d10c86c5bcca0422",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.6.0",
      "os": "linux",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:13:06.000Z",
      "distro": "noble",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "f4a5fbf34ae74ad5f444c10f673a5d322b478ff77d224dd7bc5a4dcbceefcc29",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:38:22.000Z",
      "arch": "aarch64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "dfd2374077a58ac3237b9f03a6a6f02f127114156b5079da4b3b06e17b95e6f0",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.5.3",
      "os": "mac",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:36:32.000Z",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "e74a06ad78b49a3b17d284178154eeb414a60c49ed12bf80050d53dabff502a6",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:39:27.000Z",
      "arch": "aarch64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "2513ef76d75d10e988b426e4424e5967c8038f4abedb35246052101475601d6e",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.6.0",
      "os": "mac",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:28:20.000Z",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "50ad969994052489bdc7c10612ec1c23d6f991dbb5aab1956bc6324c8b6e311d",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.6.0",
      "os": "wasm",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:13:00.000Z",
      "arch": "emscripten",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "320e54611f366f2cee61ba871181730c32b70dbc7da344417c8e6d2c3ba0cfa2",
      "status": "success",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.7.0",
      "os": "win",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:12:16.000Z",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "2b9e4d2cdc67736e197d8e937e6f0587ae36bbb9d767929aaf69183a9d5eb095",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.5.3",
      "os": "win",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:12:37.000Z",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "04d0813d75aeb81cc967455e7162776e25a7eff2f69bd8444da4a9fe7fd85993",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    },
    {
      "r": "4.6.0",
      "os": "win",
      "version": "1.1.0.9000",
      "date": "2026-06-10T08:12:27.000Z",
      "arch": "x86_64",
      "commit": "510a3692c7f564f25f9238a54534db61037b7716",
      "fileid": "256fb441b5b5f6856dd78a2afa9848e1e410ce708162cdf73e9672fd21e1e867",
      "status": "success",
      "check": "OK",
      "buildurl": "https://github.com/r-universe/elbersb/actions/runs/27262381120"
    }
  ]
}