{"id":27966182,"url":"https://github.com/anestistouloumis/simcormultres","last_synced_at":"2025-05-07T20:17:15.672Z","repository":{"id":56934870,"uuid":"94232274","full_name":"AnestisTouloumis/SimCorMultRes","owner":"AnestisTouloumis","description":"Simulates correlated multinomial responses conditional on a marginal model specification.","archived":false,"fork":false,"pushed_at":"2024-03-18T21:08:15.000Z","size":1070,"stargazers_count":7,"open_issues_count":1,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-07T20:17:10.067Z","etag":null,"topics":["binary","longitudinal-studies","multinomial","r","simulation"],"latest_commit_sha":null,"homepage":"https://CRAN.R-project.org/package=SimCorMultRes","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AnestisTouloumis.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-06-13T16:10:23.000Z","updated_at":"2022-09-12T23:09:33.000Z","dependencies_parsed_at":"2023-10-20T17:27:12.273Z","dependency_job_id":null,"html_url":"https://github.com/AnestisTouloumis/SimCorMultRes","commit_stats":{"total_commits":87,"total_committers":2,"mean_commits":43.5,"dds":0.06896551724137934,"last_synced_commit":"78aae714deebae3b4772527d38bcccd003ef6598"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnestisTouloumis%2FSimCorMultRes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnestisTouloumis%2FSimCorMultRes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnestisTouloumis%2FSimCorMultRes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AnestisTouloumis%2FSimCorMultRes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AnestisTouloumis","download_url":"https://codeload.github.com/AnestisTouloumis/SimCorMultRes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252949246,"owners_count":21830154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary","longitudinal-studies","multinomial","r","simulation"],"created_at":"2025-05-07T20:17:14.667Z","updated_at":"2025-05-07T20:17:15.651Z","avatar_url":"https://github.com/AnestisTouloumis.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\nreferences:\n- id: Touloumis2016\n  title: \"Simulating Correlated Binary and Multinomial Responses under Marginal Model Specification: The SimCorMultRes Package\"\n  author:\n  - family: Touloumis\n    given: Anestis\n  container-title: The R Journal\n  volume: 8\n  URL: 'https://journal.r-project.org/archive/2016/RJ-2016-034/index.html'\n  issue: 2\n  page: 79-91\n  type: article-journal\n  issued:\n    year: 2016\ncsl: biometrics.csl    \n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r setup, include=FALSE}\nknitr::opts_chunk$set(\n  tidy = TRUE,\n  tidy.opts = list(width.cutoff = 80),\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"README-\"\n)\n```\n\n# SimCorMultRes: Simulates Correlated Multinomial Responses\n\n[![Github version](`r paste0(\"https://img.shields.io/badge/GitHub%20-\", as.vector(read.dcf('DESCRIPTION')[, 'Version']),\"-orange.svg\")`)](\"commits/master\")\n[![R-CMD-check](https://github.com/AnestisTouloumis/SimCorMultRes/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/AnestisTouloumis/SimCorMultRes/actions/workflows/R-CMD-check.yaml)\n[![Project Status: Active The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active) \n[![Codecov test coverage](https://codecov.io/gh/AnestisTouloumis/SimCorMultRes/branch/master/graph/badge.svg)](https://codecov.io/gh/AnestisTouloumis/SimCorMultRes?branch=master)\n\n[![CRAN Version](https://www.r-pkg.org/badges/version/SimCorMultRes?color=blue)](https://cran.r-project.org/package=SimCorMultRes)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/grand-total/SimCorMultRes?color=blue)](https://cranlogs.r-pkg.org/badges/grand-total/SimCorMultRes)\n[![CRAN Downloads](https://cranlogs.r-pkg.org/badges/SimCorMultRes)](https://cran.r-project.org/package=SimCorMultRes)\n\n\n## Installation\n\nYou can install the release version of `SimCorMultRes`:\n\n```{r eval=FALSE}\ninstall.packages(\"SimCorMultRes\")\n```\n\nThe source code for the release version of `SimCorMultRes` is available on CRAN at:\n\n- https://CRAN.R-project.org/package=SimCorMultRes\n\nOr you can install the development version of `SimCorMultRes`:\n\n```{r eval=FALSE}\n# install.packages(\"devtools\")\ndevtools::install_github(\"AnestisTouloumis/SimCorMultRes\")\n```\n\nThe source code for the development version of `SimCorMultRes` is available on github at:\n\n- https://github.com/AnestisTouloumis/SimCorMultRes\n\nTo use `SimCorMultRes`, you should load the package as follows:\n\n```{r}\nlibrary(\"SimCorMultRes\")\n```\n\n## Usage and functions\n\nThis package provides five core functions to simulate correlated binary (`rbin`), nominal (`rmult.bcl`) and ordinal (`rmult.acl`, `rmult.clm` and `rmult.crm`) responses, which are drawn as realizations of a latent regression model for continuous random vectors as proposed by @Touloumis2016:\n\n- `rbin` to simulate correlated binary responses under a marginal model with logit, probit, cloglog and cauchit link function,\n- `rmult.bcl` to simulate correlated nominal multinomial responses under a marginal baseline-category logit model,\n- `rmult.acl` to simulate correlated ordinal responses under a marginal adjacent-category logit model,\n- `rmult.clm` to simulate correlated ordinal responses under a marginal cumulative link model,\n- `rmult.crm` to simulate correlated ordinal responses under a marginal continuation-ratio link model.\n\nAll five functions, assume that you provide either the correlation matrix of the multivariate normal distribution in NORTA (via `cor.matrix`) or the values of the latent responses (via the `rlatent`). Based on a simulation study (see Section 3.5 of the vignette and dataset `simulation`), it is indicated that the correlation matrix of the multivariate normal distribution used in the NORTA method (via `cor.matrix`) can be considered a reliable approximation of the actual correlation matrix of the latent responses generated by the NORTA method. This appears to be the case irrespective of the marginal distributions of the latent responses for all the threshold approaches implemented in `SimCorMultRes`.\n\nThere are also two utility functions:\n\n- `rnorta` for simulating continuous or discrete random vectors with prescribed marginal distributions using the NORTA method,\n- `rsmvnorm` for simulating continuous random vectors from a multivariate normal distribution.\n\n\n## Example\n\nThe following R code illustrates how to use the core function `rbin`:\n\n```{r}\n## See Example 3.5 in the Vignette.\nset.seed(123)\n## define number of random vectors\nsample_size \u003c- 100\n## define size of each random vector\ncluster_size \u003c- 4\n## define intercept of the binary probit regression model\nbeta_intercepts \u003c- 0\n## define coefficients of the explanatory variables\nbeta_coefficients \u003c- 0.2\n## provide explanatory variables\nx \u003c- rep(rnorm(sample_size), each = cluster_size)\n## define correlation matrix for the multivariate normal distribution in NORTA\nlatent_correlation_matrix \u003c- toeplitz(c(1, 0.9, 0.9, 0.9))\n## use rbin function to create the desired dataset\nsimulated_binary_responses \u003c- rbin(clsize = cluster_size,\n                                   intercepts = beta_intercepts,\n                                   betas = beta_coefficients, \n                                   xformula = ~  x,\n                                   cor.matrix = latent_correlation_matrix,\n                                   link = \"probit\")\nlibrary(\"gee\")\nbinary_gee_model \u003c- gee(y ~ x, family = binomial(\"probit\"), id = id,\n                        data = simulated_binary_responses$simdata)\nsummary(binary_gee_model)$coefficients\n```\n\nAdditional examples can be found in @Touloumis2016 and in the vignette of `SimCorMultRes`. To access these two documents, run the following command:\n\n```{r eval=FALSE}\nbrowseVignettes(\"SimCorMultRes\")\n```\n\n## How to cite\n\n```{r echo=FALSE, comment=\"\"}\ncitation(\"SimCorMultRes\")\n```\n\n# References\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestistouloumis%2Fsimcormultres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanestistouloumis%2Fsimcormultres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanestistouloumis%2Fsimcormultres/lists"}