countgmifs: Discrete Response Generalized Monotone Incremental Forward...

Description Usage Arguments See Also Examples

Description

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.

Usage

1
2
countgmifs(formula, data, x = NULL, offset, subset, epsilon = 0.001,
  tol = 1e-05, scale = TRUE, verbose = FALSE, family = "nb", ...)

Arguments

formula

an object of class "formula" (or one that can be coerced to that class): a symbolic description of the model to be fitted. The left side of the formula is the ordinal outcome while the variables on the right side of the formula are the covariates that are not included in the penalization process. Note that if all variables in the model are to be penalized, an intercept only model formula should be specified.

data

an optional data frame, list or environment (or object coercible by as.data.frame to a data frame) containing the variables in the model.

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

See Also coef.countgmifs, summary.countgmifs, predict.countgmifs, plot.countgmifs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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)

countgmifs documentation built on Jan. 8, 2020, 5:07 p.m.