{"id":32204091,"url":"https://github.com/diogoferrari/hdpglm","last_synced_at":"2025-10-22T04:51:02.696Z","repository":{"id":62459182,"uuid":"120543494","full_name":"DiogoFerrari/hdpGLM","owner":"DiogoFerrari","description":"Hierarchical Dirichlet Process Generalized Linear Models","archived":false,"fork":false,"pushed_at":"2025-04-19T00:04:45.000Z","size":44419,"stargazers_count":12,"open_issues_count":2,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-18T23:33:50.539Z","etag":null,"topics":["dirichlet-process-mixtures","hierarchical-clustering","nonparametric","nonparametricbayes","npb","semi-parametric"],"latest_commit_sha":null,"homepage":"http://www.diogoferrari.com/hdpGLM/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DiogoFerrari.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE","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":"2018-02-07T00:55:34.000Z","updated_at":"2025-04-18T23:52:00.000Z","dependencies_parsed_at":"2025-04-19T01:20:08.991Z","dependency_job_id":"91a9d804-df60-4cf7-9863-c57e639bb46e","html_url":"https://github.com/DiogoFerrari/hdpGLM","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/DiogoFerrari/hdpGLM","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiogoFerrari%2FhdpGLM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiogoFerrari%2FhdpGLM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiogoFerrari%2FhdpGLM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiogoFerrari%2FhdpGLM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiogoFerrari","download_url":"https://codeload.github.com/DiogoFerrari/hdpGLM/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiogoFerrari%2FhdpGLM/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280382978,"owners_count":26321423,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dirichlet-process-mixtures","hierarchical-clustering","nonparametric","nonparametricbayes","npb","semi-parametric"],"created_at":"2025-10-22T04:51:01.686Z","updated_at":"2025-10-22T04:51:02.689Z","avatar_url":"https://github.com/DiogoFerrari.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"# hdpGLM \u003cimg src='man/figures/hdpGLM_logo.png'   align=\"right\" height=\"139\" style=\"float:right; height:139px;\" /\u003e\n\n[![CRAN status](https://www.r-pkg.org/badges/version/hdpGLM?color=green)](https://cran.r-project.org/package=hdpGLM)\n\nOverview\n========\n\nThe package implements the hierarchical Dirichlet process Generalized\nLinear Models proposed in the paper Modeling Context-Dependent Latent\nEffect Heterogeneity. The model can be used to estimate latent\nheterogeneity in the marginal effect of GLM linear coefficients, cluster\ndata points based on that latent heterogeneity, and investigate if\nSimpson’s Paradox occurs due to latent or omitted features. It also can\nbe used with hierarchical data to estimate the effect of upper-level\ncovariates on the latent heterogeneity in the effect of lower-level\nfeatures.\n\nFor details of the model and the MCMC algorithm, see Ferrari, D. (2020) [Modeling\nContext-Dependent Latent Effect\nHeterogeneity](https://www.cambridge.org/core/journals/political-analysis/article/modeling-contextdependent-latent-effect-heterogeneity/B7B0AF067DF97A1A8F0B50646EF64F24), [Political\nAnalysis](https://www.cambridge.org/core/journals/political-analysis), Volume 28, Issue 1, January, pp. 20-46. \u003cDOI: 10.1017/pan.2019.13\u003e.\n\nInstalation\n===========\n\n```\n\ndevtools::install_github(\"DiogoFerrari/hdpGLM\")\n# If you don't want to update the dependencies, use: (you may need to install some dependencies manually)\ndevtools::install_github(\"DiogoFerrari/hdpGLM\", dependencies=F)\n\n```\n\nNOTE: it may be necessary to create a token to install the package from\nthe git repository in case it is private (see note at the bottom of help\npage in R by running `help(install_github)`).\n\nUsage\n=====\n\nHere is a simple example of how to use the package:\n\n```\nlibrary(hdpGLM)\n\n## Example for the dpGLM (no hierarchical structure)\n## -------------- ------\nset.seed(10)\nK    = 3 # number of latent clusters\nnCov = 3 # number of observed covariates\nsimdata = hdpGLM_simulateData(400, nCov=nCov, K=K, family='gaussian')\ndata    = simdata$data\nmcmc    = list(burn.in=1, n.iter=400)\nsamples = hdpGLM(y~., data=data, mcmc=mcmc, n.display=200)\n\nsummary(samples)\ncoef(samples)\nclassify(data, samples)\nplot(samples)\nplot(samples, terms=\"X1\")\nplot(samples, separate=T)\nplot(samples, true.beta=summary(simdata)$beta)\nplot(samples, true.beta=summary(simdata)$beta, separate=T)\n\n## Example for the hdpGLM (with hierarchical structure)\n## -------------- -------\nset.seed(6667)\nsimdata = hdpGLM_simulateData(40, 3, 2, nCovj=2, J=4, family='gaussian')\ndata    = simdata$data\nmcmc    = list(burn.in=1, n.iter=100)\nsamples = hdpGLM(y~X1+X2, y~W1+W2, data=data, mcmc=mcmc, n.display=10)\n\nsummary(samples)\nclassify(data, samples)\ncoef(samples)\nplot(samples)\nplot(samples, terms = 'X1', j.idx=2:4)\nplot_hdpglm(samples, ncol.tau=2)\nplot_tau(samples)\nplot_tau(samples, X='X1')\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogoferrari%2Fhdpglm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiogoferrari%2Fhdpglm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiogoferrari%2Fhdpglm/lists"}