gofreg

Bootstrap-based Goodness-of-Fit Tests for Parametric Regression

https://github.com/gkremling/gofreg

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.8%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

Bootstrap-based Goodness-of-Fit Tests for Parametric Regression

Basic Info
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 2 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---




[![R-CMD-check](https://github.com/gkremling/gofreg/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/gkremling/gofreg/actions/workflows/R-CMD-check.yaml)


```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# gofreg

This R package provides classes and methods to fit parametric regression models
to given data and to perform bootstrap-based goodness-of-fit tests using
different test statistics.

The data can either consist of $(X,Y)$ pairs of covariates and response 
variables or in case of random censorship it consists of tuples $(X, Z, \delta)$ 
denoting covariates, censored survival times and censoring indicators. The 
package includes different parametric regression models (mostly generalized 
linear models) and test statistics (based on different papers). It can easily be 
extended by other user-defined models and test statistics. 

## Installation

You can install it from CRAN

```{r, eval = FALSE}
install.packages("gofreg")
```

or github

``` {r, eval = FALSE}
devtools::install_github("gkremling/gofreg")
```

## Example

This is a basic example which shows how to fit a parametric regression model to 
a given dataset and afterwards perform a goodness-of-fit test. In this example, 
we use the dataset `datasets::cars`, a generalized linear model with normal 
distribution and the conditional Kolmogorov test statistic of the marginal 
distribution of $Y$ defined in Kremling & Dikta (2024) [arXiv:2409.20262](https://arxiv.org/abs/2409.20262).

```{r example}
library(gofreg)

set.seed(123)

data <- dplyr::tibble(x = datasets::cars$speed, y = datasets::cars$dist)
model <- GLM.new(distr = "normal", linkinv = identity)
model$fit(data, params_init = list(beta = 3, sd = 2), inplace = TRUE)
print(model$get_params())
gt <- GOFTest$new(data = data, model_fitted = model, test_stat = CondKolmY$new(), nboot = 100)
print(gt$get_pvalue())
gt$plot_procs()
```

Owner

  • Login: gkremling
  • Kind: user

GitHub Events

Total
  • Push event: 2
Last Year
  • Push event: 2

Packages

  • Total packages: 1
  • Total downloads:
    • cran 101 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: gofreg

Bootstrap-Based Goodness-of-Fit Tests for Parametric Regression

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 101 Last month
Rankings
Dependent packages count: 28.1%
Dependent repos count: 34.6%
Average: 49.8%
Downloads: 86.6%
Maintainers (1)
Last synced: 9 months ago

Dependencies

DESCRIPTION cran
  • R6 * imports
  • testthat >= 3.0.0 suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite