x, y: Column numbers in suffStat that should be tested for conditional independence given the variables in S.
S: vector of integers defining the conditioning set, where the integers refer to column numbers in suffStat. May be numeric(), i.e. the empty set.
suffStat: A data.frame, of which the first column is the factor G(genotype), and subsequent columns contain the traits, and optionally some QTLs. The name of the first column should be G. It should not contain covariates.
QTLs: Column numbers in suffStat that correspond to QTLs. These may be partly in S and x and y, but x and y cannot be both QTLs.
covariates: A data.frame containing covariates. It should be either NULL (default) or a data.frame with the same number of rows as suffStat. An intercept is already included for each trait in suffStat; covariates should not contain a column of ones.
alpha: The significance level used in the test. The test itself of course does not depend on this, but it is used in the EM-algorithm to speed up calculations. When stop.if.significant = TRUE, the EM-algorithm is stopped once the p-value is below the significance level. Default is 0.01.
max.iter: Maximum number of iterations in the EM-algorithm, used to fit the bivariate mixed model (when use.res = FALSE).
stop.if.significant: If TRUE, the EM-algorithm used in some of the conditional independence tests (when use.res = FALSE) will be stopped whenever the p-value becomes significant, i.e. below alpha. This will speed up calculations, and can be done because (1) the PC algorithm only needs an accept/reject decision (2) In EM the likelihood is nondecreasing. It should be put to FALSE if the precise p-value is of interest.
use.res: If TRUE, the test for conditional independence of 2 traits given a set of other traits and G is based on residuals from GBLUP. If FALSE (the default), it is based on bivariate mixed models.
res.cor: If use.res = TRUE, res.cor should be the correlation matrix of the residuals from the GBLUP. These can be obtained with the getResiduals function. See the example below.
Returns
A p-value
Details
pcgenTest tests for conditional independence between x and y given S. It distinguishes 2 situations: (i) if one of x and y (say x) is the factor G, pcgenTest will test if the genetic variance in y is zero, given the traits in S. (ii) if x and y are both traits, pcgenTest tests if the residual covariance between them is zero, given the traits in S and the factor G. The factor G is automatically included in the conditioning set S (S does not need to contain the integer 1). This test is either based on a bivariate mixed model (when use.res=FALSE), or on residuals from GBLUP (use.res=T), obtained with the getResiduals function. In the latter case, res.cor must be provided.
References
Kruijer, W., Behrouzi, P., Rodriguez-Alvarez, M. X., Wit, E. C., Mahmoudi, S. M., Yandell, B., Van Eeuwijk, F., (2018, in preparation), Reconstruction of networks with direct and indirect genetic effects.