linreg | R Documentation |
This function is used by cit.cp to compute F test given a continuous outcome and full vs reduced sets of covariates
linreg( nms.full, nms.redu=NULL, nm.y, mydat )
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. |
An F test is conducted using the glm function by comparing the full and reduced models. This function is called by cit.cp.
A single p-value is returned.
Joshua Millstein
Millstein J, Zhang B, Zhu J, Schadt EE. 2009. Disentangling molecular relationships with a causal inference test. BMC Genetics, 10:23.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.