Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

forward

Forward Selection of Covariates for Multiple Regression


Description

Fit a multi-group negative-binomial model to SAGE data, with Pearson estimation of the common overdispersion parameter.

Usage

forward(y, x, xkept=NULL, intercept=TRUE, nvar=ncol(x))

Arguments

y

numeric response vector.

x

numeric matrix of covariates, candidates to be added to the regression.

xkept

numeric matrix of covariates to be included in the starting regression.

intercept

logical, should an intercept be added to xkept?

nvar

integer, number of covariates from x to add to the regression.

Details

This function has the advantage that x can have many more columns than the length of y.

Value

Integer vector of length nvar, giving the order in which columns of x are added to the regression.

Author(s)

Gordon Smyth

See Also

Examples

y <- rnorm(10)
x <- matrix(rnorm(10*5),10,5)
forward(y,x)

statmod

Statistical Modeling

v1.4.36
GPL-2 | GPL-3
Authors
Gordon Smyth [cre, aut], Yifang Hu [ctb], Peter Dunn [ctb], Belinda Phipson [ctb], Yunshun Chen [ctb]
Initial release
2021-05-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.