{"id":19769626,"url":"https://github.com/kaz-yos/multinomial-ps-trimming","last_synced_at":"2025-09-10T08:38:13.041Z","repository":{"id":73807412,"uuid":"157718562","full_name":"kaz-yos/multinomial-ps-trimming","owner":"kaz-yos","description":"Multinomial Propensity Score Trimming (Am J Epidemiol 2018)","archived":false,"fork":false,"pushed_at":"2018-11-27T20:23:35.000Z","size":3508,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-11T00:44:45.080Z","etag":null,"topics":["epidemiology","propensity-score","statistics"],"latest_commit_sha":null,"homepage":"https://www.ncbi.nlm.nih.gov/pubmed/30517602","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/kaz-yos.png","metadata":{"files":{"readme":"README.org","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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-15T13:46:46.000Z","updated_at":"2024-03-19T10:16:59.000Z","dependencies_parsed_at":"2023-04-14T18:19:09.839Z","dependency_job_id":null,"html_url":"https://github.com/kaz-yos/multinomial-ps-trimming","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaz-yos%2Fmultinomial-ps-trimming","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaz-yos%2Fmultinomial-ps-trimming/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaz-yos%2Fmultinomial-ps-trimming/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaz-yos%2Fmultinomial-ps-trimming/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaz-yos","download_url":"https://codeload.github.com/kaz-yos/multinomial-ps-trimming/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241101197,"owners_count":19909855,"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":["epidemiology","propensity-score","statistics"],"created_at":"2024-11-12T04:44:12.575Z","updated_at":"2025-02-28T04:25:45.722Z","avatar_url":"https://github.com/kaz-yos.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"* Multinomial Propensity Score Trimming\n\n[[./src/title_figure.png]]\n\nThis is the code repository for our upcoming paper on propensity score (PS) trimming in settings with multiple (3 or more) treatment groups. In this paper, we proposed definitions to extend three existing PS trimming methods ([[https://www.jstor.org/stable/27798811][Crump et al. Biometrika 2009;96:187]], [[https://www.ncbi.nlm.nih.gov/pubmed/20716704][Stürmer et al. Am J Epidemiol 2010;172:843]], and [[https://www.dovepress.com/a-tool-for-assessing-the-feasibility-of-comparative-effectiveness-rese-peer-reviewed-article-CER][Walker et al. Comp Eff Res 2013;3:11]]) for multinomial exposures.\n\n* Related resources\n- Paper: in press\n- ICPE 2018 poster: [[https://github.com/kaz-yos/icpe-2018-org-mode-poster]]\n- Web app: https://kaz-yos.shinyapps.io/shiny_trim_ternary/\n- Web app source code: https://github.com/kaz-yos/shiny-trim-ternary\n\n* Files and folders in this repo\n- =*.R=: Main R script files for generating simulation data, analyzing data, and reporting results. Execution each file will generate a plain text report file named *.R.txt under =log/=.\n- =*_o2.sh=: Example shell scripts for the Linux SLURM batch job system. These are designed for Harvard Medical School's O2 cluster specifically, and are not expected to work without modification elsewhere.\n- =data/=: Folder for simulation data. Due to file size issues, only the summary file for running =06_assess_results.R= is kept.\n- =log/=: Folder for log files.\n- =out/=: Folder for figure PDFs.\n\n* Simulation\n** Installation\nTwo custom R packages must be installed before running the R scripts provided in this repository.\n#+BEGIN_SRC sh\n## Install devtools (if you do not have it already)\ninstall.packages(\"devtools\")\n## Install the data generation package\ndevtools::install_github(repo = \"kaz-yos/datagen3\")\n## Install the simulation package\ndevtools::install_github(repo = \"kaz-yos/trim3\")\n#+END_SRC\nAdditionally, packages =doParallel=, =doRNG=, =grid=, =gtable=, and =tidyverse=, are required in the scripts.\n\n** Data generation\nRunning the following will generate raw data files under the =data/= folder using 8 cores.\n#+BEGIN_SRC sh\nRscript ./01_generate_data.R 8\n#+END_SRC\n\nIf you have access to a SLURM-based computing cluster, the following can be used with appropriate modifications to the shell script.\n#+BEGIN_SRC sh\nsh ./01_generate_data_o2.sh\n#+END_SRC\n\n** Data preparation\nRunning the following will process the specified data file (PS estimation and trimming) and generate a new file with the same name except that raw changes to prepared.\n#+BEGIN_SRC sh\nRscript ./02_prepare_data.R ./data/scenario_raw001_part001_r50.RData 8\n#+END_SRC\n\nIf you have access to a SLURM-based computing cluster, the following can be used with appropriate modifications to the shell script. This will dispatch a SLURM job for each file.\n#+BEGIN_SRC sh\nsh ./02_prepare_data_o2.sh ./data/scenario_raw*\n#+END_SRC\n\n** Data analysis\nRunning the following will analyze the specified data file (outcome model estimation) and generate a new file with the same name except that prepared changes to analyzed.\n#+BEGIN_SRC sh\nRscript ./03_analyze_data.R ./data/scenario_prepared001_part001_r50.RData 8\n#+END_SRC\n\nIf you have access to a SLURM-based computing cluster, the following can be used with appropriate modifications to the shell script. This will dispatch a SLURM job for each file.\n#+BEGIN_SRC sh\nsh ./03_analyze_data_o2.sh ./data/scenario_prepared*\n#+END_SRC\n\n** Result aggregation\nRunning the following will aggregate all the analyzed data files under =data/= and generate a single new file named =all_analysis_results.RData=.\n#+BEGIN_SRC sh\nRscript ./04_aggregate_results.R 1\n#+END_SRC\n\nIf you have access to a SLURM-based computing cluster, the following can be used with appropriate modifications to the shell script.\n#+BEGIN_SRC sh\nsh ./04_aggregate_results_o2.sh\n#+END_SRC\n\n** Result summarization\nRunning the following will summarize the results (scenario-level summaries) and generate a new file named =all_analysis_summary.RData=.\n#+BEGIN_SRC sh\nRscript ./05_summarize_results.R ./data/all_analysis_results.RData 1\n#+END_SRC\n\nIf you have access to a SLURM-based computing cluster, the following can be used with appropriate modifications to the shell script.\n#+BEGIN_SRC sh\nsh ./05_summarize_results_o2.sh ./data/all_analysis_results.RData\n#+END_SRC\n\n** Assessment\nRunning the following will create figures under =out/= describing the summary statistics in =all_analysis_summary.RData=.\n#+BEGIN_SRC sh\n./Rscriptee ./06_assess_results.R ./data/all_analysis_summary.RData 1\n#+END_SRC\n\n\n* Author\n[[https://twitter.com/kaz_yos][Kazuki Yoshida]] \u003ckazukiyoshida@mail.harvard.edu\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaz-yos%2Fmultinomial-ps-trimming","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaz-yos%2Fmultinomial-ps-trimming","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaz-yos%2Fmultinomial-ps-trimming/lists"}