Package: Countr 3.5.8

Georgi N. Boshnakov

Countr: Flexible Univariate Count Models Based on Renewal Processes

Flexible univariate count models based on renewal processes. The models may include covariates and can be specified with familiar formula syntax as in glm() and package 'flexsurv'. The methodology is described by Kharrat et all (2019) <doi:10.18637/jss.v090.i13> (included as vignette 'Countr_guide' in the package). If the suggested package 'pscl' is not available from CRAN, it can be installed with 'remotes::install_github("cran/pscl")'. It is no longer used by the functions in this package but is needed for some of the extended examples.

Authors:Tarak Kharrat [aut], Georgi N. Boshnakov [aut, cre]

Countr_3.5.8.tar.gz
Countr_3.5.8.tar.gz(r-4.5-noble)Countr_3.5.8.tar.gz(r-4.4-noble)
Countr_3.5.8.tgz(r-4.4-emscripten)Countr_3.5.8.tgz(r-4.3-emscripten)
Countr.pdf |Countr.html
Countr/json (API)
NEWS

# Install 'Countr' in R:
install.packages('Countr', repos = 'https://cloud.r-project.org')

Bug tracker:https://github.com/geobosh/countr/issues2 issues

Pkgdown site:https://geobosh.github.io

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

Conda:

openblascpp

3.48 score 1 stars 967 downloads 34 exports 85 dependencies

Last updated 1 years agofrom:d0e937534e. Checks:3 OK. Indexed: no.

TargetResultLatest binary
Doc / VignettesOKMar 10 2025
R-4.5-linux-x86_64OKMar 10 2025
R-4.4-linux-x86_64OKMar 10 2025

Exports:addBootSampleObjectchiSq_gofchiSq_pearsoncompareToGLMcount_tableCountrFormuladCount_conv_bidCount_conv_loglik_bidCount_conv_loglik_userdCount_conv_userdmodifiedCount_bidWeibullCountdWeibullCount_loglikdWeibullgammaCountdWeibullgammaCount_loglikevCount_conv_bievCount_conv_userevWeibullCountevWeibullgammaCountfrequency_plotgetParNamesprob_predictrenewalrenewal.controlrenewal.convParsrenewal.seriesParsrenewal.weiMethodrenewalCoefrenewalCoefListrenewalCountrenewalNamesresiduals_plotse.coefsurv

Dependencies:abindassertthatbackportsbbmlebdsmatrixBHbootbroomcarcarDataclicolorspacecowplotcpp11data.tableDerivdeSolvedoBydplyrfansifarverfastGHQuadflexsurvFormulagenericsggplot2gluegtableisobandlabelinglatticelifecyclelme4lmtestmagrittrMASSMatrixMatrixModelsmgcvmicrobenchmarkminqamodelrmstatemuhazmunsellmvtnormnlmenloptrnnetnumDerivoptimxpbkrtestpillarpkgconfigpracmapurrrquadprogquantregR6rbibutilsRColorBrewerRcppRcppArmadilloRcppEigenRdpackreformulasrlangrstpm2scalesSparseMstandardizestatmodstringistringrsurvivaltibbletidyrtidyselectutf8vctrsVGAMviridisLitewithrxtablezoo

Comparing performance of computational methods

Rendered fromComputationalPerformance.Rnwusingutils::Sweaveon Mar 10 2025.

Last update: 2017-11-20
Started: 2017-11-20

Computation of variance-covariance matrix

Rendered fromVarianceCovariance.Rnwusingutils::Sweaveon Mar 10 2025.

Last update: 2017-11-20
Started: 2017-11-20

Example with fertility data

Rendered fromexampleFertility.Rnwusingutils::Sweaveon Mar 10 2025.

Last update: 2017-11-20
Started: 2017-11-20

Example with football data

Rendered fromexampleFootball.Rnwusingutils::Sweaveon Mar 10 2025.

Last update: 2017-11-20
Started: 2017-11-20

Example with quine data

Rendered fromModelSelectionAndComparison.Rnwusingutils::Sweaveon Mar 10 2025.

Last update: 2017-11-20
Started: 2017-11-20

Guide for package Countr

Rendered fromCountr_guide.Rnwusingutils::Sweaveon Mar 10 2025.

Last update: 2017-11-20
Started: 2017-11-20

Citation

To cite Countr in publications use:

Kharrat T, Boshnakov GN, McHale I, Baker R (2019). “Flexible Regression Models for Count Data Based on Renewal Processes: The Countr Package.” Journal of Statistical Software, 90(13), 1–35. doi:10.18637/jss.v090.i13.

Corresponding BibTeX entry:

  @Article{,
    title = {Flexible Regression Models for Count Data Based on Renewal
      Processes: The {Countr} Package},
    author = {Tarak Kharrat and Georgi N. Boshnakov and Ian McHale and
      Rose Baker},
    journal = {Journal of Statistical Software},
    year = {2019},
    volume = {90},
    number = {13},
    pages = {1--35},
    doi = {10.18637/jss.v090.i13},
  }

Readme and manuals

Installing Countr

The latest stable version is on CRAN.

install.packages("Countr")

You can install the development version of Countr from Github:

library(devtools)
install_github("GeoBosh/Countr")

Overview

Flexible univariate count models based on renewal processes. The models may include covariates and can be specified with familiar formula syntax as in glm() and package 'flexsurv'. The methodology is described in a forthcoming paper in the Journal of Statistical Software. The paper is included as vignette vignette("Countr_guide") along wth several additional vignettes containing worked examples and additional details, see Countr CRAN page.

The package is developed by Tarak Kharrat and Georgi N.Boshnakov.

Help Manual

Help pageTopics
Flexible Univariate Count Models Based on Renewal ProcessesCountr-package Countr
Create a bootsrap sample for coefficient estimatesaddBootSampleObject
Formal Chi-square goodness-of-fit testchiSq_gof chiSq_gof.glm chiSq_gof.negbin chiSq_gof.renewal
Pearson Chi-Square testchiSq_pearson chiSq_pearson.glm chiSq_pearson.renewal
Compare renewals fit to glm models fitcompareToGLM
Summary of a count variablecount_table
Create a formula for renewalCountCountrFormula
Compute count probabilities using convolutiondCount_conv_bi dCount_conv_user
Log-likelihood of a count probability computed by convolution (bi)dCount_conv_loglik_bi dCount_conv_loglik_user
Compute count probabilities based on modified renewal process (bi)dmodifiedCount_bi dmodifiedCount_user
Probability calculations for Weibull count modelsdWeibullCount dWeibullCount_loglik evWeibullCount
Univariate Weibull Count Probability with gamma and covariate heterogeneitydWeibullgammaCount_mat_Covariates
Expected value and variance of renewal count processevCount_conv_bi evCount_conv_user
Fertility datafertility
Football datafootball
Plot a frequency chartfrequency_plot
Return the names of distribution parametersgetParNames
Predict method for renewal objectspredict.renewal
Methods for renewal objectsaddBootSampleObject.renewal coef.renewal confint.renewal df.residual.renewal extractAIC.renewal fitted.renewal logLik.renewal model.matrix.renewal nobs.renewal print.renewal print.summary.renewal renewal_methods residuals.renewal residuals_plot.renewal summary.renewal vcov.renewal
Get named vector of coefficients for renewal objectsrenewalCoef
Split a vector using the prefixes of the names for groupingrenewalCoefList
Fit renewal count processes regression modelsrenewalCount
Get names of parameters of renewal regression modelsrenewalNames
Method to visualise the residualsresiduals_plot
Extract Standard Errors of Model Coefficientsse.coef se.coef.renewal
Wrapper to built-in survival functionssurv