{"id":29016745,"url":"https://github.com/jackmwolf/joint","last_synced_at":"2025-06-25T22:41:26.592Z","repository":{"id":301062396,"uuid":"774172659","full_name":"jackmwolf/joint","owner":"jackmwolf","description":"Fit Joint Endpoint Models to Efficiently Estimate Treatment Effects","archived":false,"fork":false,"pushed_at":"2025-06-25T00:10:35.000Z","size":248,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T01:25:32.824Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackmwolf.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2024-03-19T04:21:27.000Z","updated_at":"2025-06-25T00:10:38.000Z","dependencies_parsed_at":"2025-06-25T01:35:55.364Z","dependency_job_id":null,"html_url":"https://github.com/jackmwolf/joint","commit_stats":null,"previous_names":["jackmwolf/joint"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackmwolf/joint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmwolf%2Fjoint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmwolf%2Fjoint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmwolf%2Fjoint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmwolf%2Fjoint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackmwolf","download_url":"https://codeload.github.com/jackmwolf/joint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackmwolf%2Fjoint/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261966516,"owners_count":23237623,"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":[],"created_at":"2025-06-25T22:41:21.675Z","updated_at":"2025-06-25T22:41:26.564Z","avatar_url":"https://github.com/jackmwolf.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# joint\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\n`joint` is an R package designed to efficiently estimate treatment effects in\nrandomized trials by jointly modeling primary and secondary efficacy endpoints.\n\n## Installation\n\nYou can install the development version of joint from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"devtools\")\ndevtools::install_github(\"jackmwolf/joint\")\n```\n\n## Example\n\n```{r}\nlibrary(joint)\n```\n\nThe example dataset includes $n = 200$ observations.\nParticipants were randomly assigned to the treatment (`A == 1`) or control (`A == 0`) conditions and four endpoints were measured (`Y1`, `Y2`, `Y3`, and `Y4`). \nCategorical versions of `Y3` (`Y3_cat`; binary) and `Y4` (`Y4_cat`; ordinal with three levels) are also provided.\n\n```{r}\ndata(\"joint_example\")\nhead(joint_example)\n```\n\nTo estimate the average treatment effect (ATE) on `Y1` while leveraging data from `Y2` and `Y3`, we could assume that the following one-factor structural equation model is correctly specified:\n\n$$ \\begin{pmatrix} Y_1 \\\\ Y_2 \\\\ Y_3 \\end{pmatrix} |A \\sim N\\left\\{\\vec\\nu + \\gamma\\vec\\lambda A, \\text{diag}(\\vec\\theta)+\\vec\\lambda\\vec\\lambda^T \\right\\}$$\nand estimate the ATE via the maximum likelihood estimator, $\\widehat\\tau_\\text{SEM}=\\widehat\\gamma\\widehat\\lambda_1$.\nThis is accomplished by `joint_sem()`:\n\n```{r}\nfit_sem \u003c- joint_sem(\n  data0 = joint_example,\n  endpoints = c(\"Y1\", \"Y2\", \"Y3\"),\n  treatment = \"A\"\n)\n```\n\nATE estimates along with variance estimates can be extracted using `estimate_effects()`:\n\n```{r}\nestimate_effects(fit_sem)\n```\nHowever, we suspect that the model may be misspecified, we may wish to use model averaging and additionally consider a saturated means model (which would result in unbiased and consistent treatment effect estimation) and the estimator $\\widehat\\tau_\\text{MA}(\\omega)=\\omega\\widehat\\tau_\\text{SEM}+(1-\\omega)\\widehat\\tau_\\text{Saturated}$ for $\\omega \\in [0,1]$.\nWe could then select $\\omega$ using super learning (`joint_sl()`) or Bayesian model averaging (`joint_bma()`):\n\n```{r}\nset.seed(1)\nfit_sl \u003c- joint_sl(\n  data0 = joint_example,\n  endpoints = c(\"Y1\", \"Y2\", \"Y3\"),\n  treatment = \"A\",\n  primary = \"Y1\",\n  n_boot = 5 # note the choice of n_boot = 5; more are recommended in practice\n)\nfit_sl$summary\n```\n\n## Future Work\n\n- Support parallel computation for `joint_sl` and `joint_bma`\n\n- Develop `summary` methods for `joint_sl` and `joint_bma` output\n\n## References\n\n- Wolf, J. M., Koopmeiners, J. S., \u0026 Vock, D. M. (2025). Jointly modeling multiple endpoints for efficient treatment effect estimation in randomized controlled trials. arXiv preprint arXiv:2506.03393\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmwolf%2Fjoint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackmwolf%2Fjoint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackmwolf%2Fjoint/lists"}