Learn R Programming

cit (version 2.3.2)

linreg: F Test for Linear Model

Description

This function is used by cit.cp to compute F test given a continuous outcome and full vs reduced sets of covariates

Usage

linreg( nms.full, nms.redu=NULL, nm.y, mydat )

Value

A single p-value is returned.

Arguments

nms.full

vector of variable names for all covariates included in the full model.

nms.redu

vector of variable names for all covariates included in the reduced model. If nms.redu is NULL then the reduced model is fitted with the intercept only.

nm.y

character string, which is the name of the outcome variable.

mydat

the dataframe that includes all variables with each variable in a column.

Author

Joshua Millstein

Details

An F test is conducted using the glm function by comparing the full and reduced models. This function is called by cit.cp.

References

Millstein J, Zhang B, Zhu J, Schadt EE. 2009. Disentangling molecular relationships with a causal inference test. BMC Genetics, 10:23.

Examples

Run this code
ss = 500
cols = 6
nm.y = "y"
nms.full = paste( "x", 1:(cols-1), sep="" )
nms.redu = paste( "x", 1:2, sep="" )

mydat = as.data.frame( matrix( rnorm( ss*cols ), ncol=cols ) )
names( mydat ) = c( nm.y, nms.full )

linreg(nms.full, nms.redu, nm.y, mydat)

Run the code above in your browser using DataLab