Learn R Programming

bigstep (version 0.7.1)

singleTests: Single tests

Description

Perform the likelihood ratio tests between two regression models: 1) with only the intercept, 2) with the intercept and every single variable from the matrix X.

Usage

singleTests(X, y, fitFun = fitLinear, maxp = 1e+06, verbose = TRUE)

Arguments

X
a numeric matrix or an object of class big.matrix (see 'Details'). The rows of X contain the samples, the columns of X contain the observed variables. If your have variables in rows, see 'Details'.
y
a numeric vector of responses. The length of y must equal the number of rows of X.
fitFun
a function which fits the regression model and calculate the logarithm of the likelihood function (loglike). You can use your own function or one of these: fitLinear, fitLogistic, fitPoisson.
maxp
a numeric. If X is big, it will be splitted into parts with maxp elements. It will not change results, but it is necessary if your computer does not have enough RAM. Set to a lower value if you still have problems.
verbose
a logical. Set FALSE if you do not want to see any information during the selection procedure.

Value

A numeric vector with p-values of the likelihood ratio test.

Examples

Run this code
set.seed(1)
n <- 100
M <- 10
X <- matrix(rnorm(M*n), ncol=M)
y <- X[, 2] - X[, 3] + X[, 6] - X[, 10] + rnorm(n)
singleTests(X, y)

Run the code above in your browser using DataLab