Title: | Discrete Response Regression for High-Dimensional Data |
---|---|
Description: | Provides a function for fitting Poisson and negative binomial regression models when the number of parameters exceeds the sample size, using the the generalized monotone incremental forward stagewise method. |
Authors: | Kellie Archer [aut, cre] |
Maintainer: | Kellie Archer <[email protected]> |
License: | GPL (>=2) |
Version: | 0.0.2 |
Built: | 2024-11-23 02:46:11 UTC |
Source: | https://github.com/kelliejarcher/countgmifs |
This package provides a function that fits a Poisson or negative binomial model when the number of parameters exceeds the sample size, using the the generalized monotone incremental forward stagewise method.
The DESCRIPTION file:
Package: | countgmifs |
Title: | Discrete Response Regression for High-Dimensional Data |
Version: | 0.0.2 |
Authors@R: | person("Kellie", "Archer", email = "[email protected]", role = c("aut", "cre")) |
Description: | Provides a function for fitting Poisson and negative binomial regression models when the number of parameters exceeds the sample size, using the the generalized monotone incremental forward stagewise method. |
Depends: | R (>= 3.5.0), MASS |
License: | GPL (>=2) |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 6.0.1.9000 |
Repository: | https://kelliejarcher.r-universe.dev |
RemoteUrl: | https://github.com/kelliejarcher/countgmifs |
RemoteRef: | HEAD |
RemoteSha: | b94d7caea39893f615005d861f0be7d9b66aa900 |
Author: | Kellie Archer [aut, cre] |
Maintainer: | Kellie Archer <[email protected]> |
Index of help topics:
coef.countgmifs Extract Model Coefficients. countgmifs Discrete Response Generalized Monotone Incremental Forward Stagewise Regression. countgmifs-package Discrete Response Regression for High-Dimensional Data: Discrete Response Generalized Monotone Incremental Forward Stagewise Regression plot.countgmifs Plot Solution Path for a Count GMIFS Fitted Model. predict.countgmifs Predict Outcome for Count GMIFS Fitted Model. print.countgmifs Print the Contents of a Count GMIFS Fitted Object. summary.countgmifs Summarize a Count GMIFS Object.
This package contains functions for fitting a penalized discrete response model (either negative binomial or Poisson) and extracting estimated coefficients, predictions, and plots. The model and methods can be used when the response to be predicted is discrete, and is particularly relevant when there are more covariates than observations.
Kellie Archer [aut, cre] Kellie J. Archer <[email protected]>
Maintainer: Kellie Archer <[email protected]> Kellie J. Archer <[email protected]>
Makowski M., Archer K.J. (2015) Generalized monotone incremental forward stagewise method for modeling count data: application predicting micronuclei frequency. Cancer Informatics, 14(Suppl 2), 97–105.
A generic function which extracts the model coefficients from a fitted model object fit using countgmifs
## S3 method for class 'countgmifs' coef(object, model.select = "BIC", ...)
## S3 method for class 'countgmifs' coef(object, model.select = "BIC", ...)
object |
an |
model.select |
when |
... |
other arguments. |
See Also countgmifs
, predict.countgmifs
, summary.countgmifs
, plot.countgmifs
This function can fit a Poisson or negative binomial model when the number of parameters exceeds the sample size, using the the generalized monotone incremental forward stagewise method.
countgmifs(formula, data, x = NULL, offset, subset, epsilon = 0.001, tol = 1e-05, scale = TRUE, verbose = FALSE, family = "nb", ...)
countgmifs(formula, data, x = NULL, offset, subset, epsilon = 0.001, tol = 1e-05, scale = TRUE, verbose = FALSE, family = "nb", ...)
formula |
an object of class " |
data |
an optional data frame, list or environment (or object coercible by |
x |
an optional matrix of predictors that are to be penalized in the model fitting process. |
offset |
this can be used to specify an a priori known component to be included during fitting (e.g., denominator term). This should be NULL or a numeric vector of length equal to the number of cases. |
subset |
an optional vector specifying a subset of observations to be used in the fitting process. |
epsilon |
small incremental amount used to update a coefficient at a given step. |
tol |
the iterative process stops when the difference between successive log-likelihoods is less than this specified level of tolerance. |
scale |
logical, if TRUE (default) the penalized predictors are centered and scaled. |
verbose |
logical, if TRUE the step number is printed to the console (default is FALSE). |
family |
the type of count response model to be fit. Default is 'nb' for negative binomial; user can also specify 'poisson'. |
... |
other arguments. |
See Also coef.countgmifs
, summary.countgmifs
, predict.countgmifs
, plot.countgmifs
set.seed(26) n <- 50 # Sample size p <- 500 # Number of covariates intercept<- .5 #True parameter values for the 500 covariates beta<- c(log(1.5), log(1.5), -log(1.5), -log(1.5), -log(1.5), rep(0,495)) alpha<- 0.5 # Intercept x<- matrix(rnorm(n*p,0,1), nrow=n, ncol=p, byrow=TRUE) #Covariate values colnames(x)<- paste("Var",1:p, sep="") mu<- exp(intercept + crossprod(t(x),beta)) y<- rnbinom(n=n, size=1/alpha ,mu=mu) # Discrete response data<- data.frame(y,x) nb<-countgmifs(y ~ 1 , data=data, offset=NULL, x=x, epsilon=0.01, tol=0.001, scale=TRUE, verbose=FALSE) coef.AIC<-coef(nb, model.select="AIC") coef.AIC[coef.AIC!=0] predict(nb, model.select="AIC") plot(predict(nb, model.select="AIC"), y) plot(nb)
set.seed(26) n <- 50 # Sample size p <- 500 # Number of covariates intercept<- .5 #True parameter values for the 500 covariates beta<- c(log(1.5), log(1.5), -log(1.5), -log(1.5), -log(1.5), rep(0,495)) alpha<- 0.5 # Intercept x<- matrix(rnorm(n*p,0,1), nrow=n, ncol=p, byrow=TRUE) #Covariate values colnames(x)<- paste("Var",1:p, sep="") mu<- exp(intercept + crossprod(t(x),beta)) y<- rnbinom(n=n, size=1/alpha ,mu=mu) # Discrete response data<- data.frame(y,x) nb<-countgmifs(y ~ 1 , data=data, offset=NULL, x=x, epsilon=0.01, tol=0.001, scale=TRUE, verbose=FALSE) coef.AIC<-coef(nb, model.select="AIC") coef.AIC[coef.AIC!=0] predict(nb, model.select="AIC") plot(predict(nb, model.select="AIC"), y) plot(nb)
This function plots either the coefficient path, the AIC, or the log-likelihood for a fitted countgmifs
object.
## S3 method for class 'countgmifs' plot(x, type = "trace", xlab = NULL, ylab = NULL, main = NULL, ...)
## S3 method for class 'countgmifs' plot(x, type = "trace", xlab = NULL, ylab = NULL, main = NULL, ...)
x |
a |
type |
default is |
xlab |
a default x-axis label will be used which can be changed by specifying a user-defined x-axis label. |
ylab |
a default y-axis label will be used which can be changed by specifying a user-defined y-axis label. |
main |
a default main title will be used which can be changed by specifying a user-defined main title. |
... |
other arguments. |
See Also countgmifs
, coef.countgmifs
, summary.countgmifs
, predict.countgmifs
This function returns a numeric vector that is the predicted response from the countgmifs
fitted object.
## S3 method for class 'countgmifs' predict(object, neww = NULL, newdata, newx = NULL, model.select = "BIC", newoffset=NULL, ...)
## S3 method for class 'countgmifs' predict(object, neww = NULL, newdata, newx = NULL, model.select = "BIC", newoffset=NULL, ...)
object |
an |
neww |
an optional formula that includes the unpenalized variables to use for predicting the response. If omitted, the training data are used. |
newdata |
an optional data.frame that minimally includes the unpenalized variables to use for predicting the response. If omitted, the training data are used. |
newx |
an optional matrix of penalized variables to use for predicting the response. If omitted, the training data are used. |
model.select |
when |
newoffset |
If an offset is used in the fit, then one must be supplied for making predictions. |
... |
other arguments. |
See Also countgmifs
, coef.countgmifs
, summary.countgmifs
, plot.countgmifs
This function prints the names of the list objects from an countgmifs
fitted model
## S3 method for class 'countgmifs' print(x, ...)
## S3 method for class 'countgmifs' print(x, ...)
x |
an |
... |
other arguments. |
See Also countgmifs
, coef.countgmifs
, summary.countgmifs
, plot.countgmifs
Prints the following items extracted from the fitted countgmifs
object: the family used and model parameter estimates. For models that include x
, the parameter estimates, AIC, BIC, and log-likelihood are printed for indicated model.select
step or if model.select
is not supplied the step at which the minimum BIC was observed.
## S3 method for class 'countgmifs' summary(object, model.select = "BIC", ...)
## S3 method for class 'countgmifs' summary(object, model.select = "BIC", ...)
object |
an |
model.select |
when |
... |
other arguments. |
See Also countgmifs
, coef.countgmifs
, predict.countgmifs
, plot.countgmifs