{"id":39924072,"url":"https://github.com/ejikeugba/gofcat","last_synced_at":"2026-01-18T17:36:39.510Z","repository":{"id":41977255,"uuid":"441933535","full_name":"ejikeugba/gofcat","owner":"ejikeugba","description":"Goodness-of-fit tests for categorical response models","archived":false,"fork":false,"pushed_at":"2023-02-02T05:08:15.000Z","size":323,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T01:42:50.732Z","etag":null,"topics":["brant-test","brier-scores","hosmer-lemeshow-test","likelihood-ratio-test","lipsitz-test","log-loss-score-metric","logistic-regression","misclassification","ordinal-regression","proportional-odds-test","pseudo-r2","pulkstenis-robinson-test"],"latest_commit_sha":null,"homepage":"https://ejikeugba.github.io/gofcat/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ejikeugba.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-12-26T16:18:45.000Z","updated_at":"2023-02-12T10:54:19.000Z","dependencies_parsed_at":"2023-02-17T14:20:21.296Z","dependency_job_id":null,"html_url":"https://github.com/ejikeugba/gofcat","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/ejikeugba/gofcat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejikeugba%2Fgofcat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejikeugba%2Fgofcat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejikeugba%2Fgofcat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejikeugba%2Fgofcat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ejikeugba","download_url":"https://codeload.github.com/ejikeugba/gofcat/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ejikeugba%2Fgofcat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28545243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["brant-test","brier-scores","hosmer-lemeshow-test","likelihood-ratio-test","lipsitz-test","log-loss-score-metric","logistic-regression","misclassification","ordinal-regression","proportional-odds-test","pseudo-r2","pulkstenis-robinson-test"],"created_at":"2026-01-18T17:36:38.572Z","updated_at":"2026-01-18T17:36:39.504Z","avatar_url":"https://github.com/ejikeugba.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 setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  message = FALSE,\n  warning = FALSE,\n  out.width = \"100%\"\n)\n```\n\n# gofcat\n\n\u003c!-- badges: start --\u003e\n[![Project Status: Active – The project has reached a stable, usable\nstate and is being\nactivelydeveloped](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![Codecov test coverage](https://codecov.io/gh/ejikeugba/gofcat/branch/main/graph/badge.svg)](https://app.codecov.io/gh/ejikeugba/gofcat?branch=main)\n[![Total Downloads](http://cranlogs.r-pkg.org/badges/grand-total/gofcat)](https://CRAN.R-project.org/package=gofcat)\n[![CRAN status](https://www.r-pkg.org/badges/version/gofcat )](https://CRAN.R-project.org/package=gofcat)\n[![license](https://img.shields.io/badge/license-GPL--2-blue.svg)](https://www.gnu.org/licenses/gpl-2.0.en.html)\n[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/github/ejikeugba/gofcat?branch=main\u0026svg=true)](https://ci.appveyor.com/project/ejikeugba/gofcat)\n[![R build status](https://github.com/ejikeugba/gofcat/workflows/R-CMD-check/badge.svg)](https://github.com/ejikeugba/gofcat/actions)\n\u003c!-- badges: end --\u003e\n\n\n### Overview\nCrucial post-estimation (goodness-of-fit) tests for some widely used categorical response models (CRM) are implemented in this package. It currently supports inputs from objects of class serp(), clm(), polr(), multinom(), mlogit(), vglm() and glm(). Available tests include the Hosmer-Lemeshow tests for the binary, multinomial and ordinal logistic regression; the Lipsitz and the Pulkstenis-Robinson tests for the ordinal models. The proportional odds, adjacent-category, and constrained continuation-ratio models are particularly supported at ordinal level. Tests for the proportional odds assumptions in ordinal models are also possible with the Brant and the Likelihood-Ratio tests. Moreover, several summary measures of predictive strength (Pseudo R-squared), and some useful error metrics, including, the brier score, misclassification rate and logloss are also available for the binary, multinomial and ordinal models.\n\n\n### Example\n\n``` r\nrequire(serp)\nset.seed(1)\nn \u003c- 200\ndt \u003c- data.frame(y = ordered(rbinom(n,2,0.5)), x1 = factor(rbinom(n,2,0.7)), x2 = runif(n))\nsp \u003c- serp(y ~ x1 + x2, slope=\"parallel\", link = \"logit\", reverse= TRUE, data = dt)\n```\n\n``` r\n## Goodness-of-fit\n# Hosmer-Lemeshow test\nhosmerlem(sp, tables = TRUE)\nhosmerlem(sp, tables = TRUE, customFreq = rep(20,10))\n\n# Lipsitz test\nlipsitz(sp)\nlipsitz(sp, customFreq = rep(20, 10))\n\n# Pulkstenis-Robinson test\npulkroben(sp, test = \"chisq\", tables = TRUE)\npulkroben(sp, test = \"deviance\", tables = TRUE)\n``` \n\n``` r\n## Proportional odds test\nbrant.test(sp)\nbrant.test(sp, global = TRUE, call = TRUE)\nLR.test(sp, call = TRUE)\n```\n\n``` r\n## Error metrics\nerroR(sp, type = \"brier\")\nerroR(sp, type = \"logloss\")\nerroR(sp, type = \"misclass\")\n\n# with dataframe and custom threshold\ndf \u003c- data.frame(y, sp$fitted.values)\nerroR(df, type = \"misclass\", thresh = 0.7)\n```\n\n``` r\n## Summary metrics\nRsquared(sp, measure = \"ugba\")\nRsquared(sp, measure = \"mcfadden\")\n```\n\n### Installation and Use\n\nBefore installing `gofcat`, it is encouraged to have a recent version of [R](https://cran.r-project.org/bin/windows/base/) installed. The released version of `gofcat` can be installed from [CRAN](https://cran.r-project.org/package=gofcat) with:\n\n``` r\ninstall.packages(\"gofcat\")\n```\n\nor the development version from [GitHub](https://github.com/ejikeugba/gofcat) with:\n\n``` r\nif (!require(\"devtools\")) install.packages(\"devtools\")\ndevtools::install_github(\"ejikeugba/gofcat\")\n```\n\nLoad `gofcat` into R environment with:\n```{r, eval = FALSE}\nlibrary(gofcat)\n```\n\n### Community Guidelines\n\nPull requests are welcomed! Please submit your contributions to `gofcat`\nthrough the list of `Pull Requests`, following the [contributing\nguidelines](https://github.com/ejikeugba/gofcat/blob/main/.github/contributing.md). To\nreport issues and/or seek support, please file a new ticket in the\n[issue](https://github.com/ejikeugba/gofcat/issues) tracker, and expect \na feedback ASAP!\n\n### Code of Conduct\n\nPlease note that `gofcat` is released with a [Contributor Code of\nConduct](https://github.com/ejikeugba/gofcat/blob/main/CODE_OF_CONDUCT.md).\nBy contributing to this project, you agree to abide by its terms.\n\n### References\n\nFagerland, M. W. and Hosmer, D. W. (2017). How to test for goodness of fit\nin ordinal logistic regression models. *Stata Journal*, 17, 668-686.\n\nUgba, E. R. and Gertheiss, J. (2018). An Augmented Likelihood Ratio Index \nfor Categorical Response Models. In *Proceedings of 33rd International Workshop on Statistical Modelling*, Bristol, 293-298.\n\u003chttp://www.statmod.org/workshops_archive_proceedings_2018.html\u003e\n\nUgba, E. R. (2021). serp: An R package for smoothing in ordinal\nregression *Journal of Open Source Software*, 6(66), 3705.\n\u003chttps://doi.org/10.21105/joss.03705\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejikeugba%2Fgofcat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fejikeugba%2Fgofcat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fejikeugba%2Fgofcat/lists"}