snp.rhs.tests154           package:GGBase           R Documentation

_S_c_o_r_e _t_e_s_t_s _w_i_t_h _S_N_P _g_e_n_o_t_y_p_e_s _a_s _i_n_d_e_p_e_n_d_e_n_t _v_a_r_i_a_b_l_e -
_t_a_k_e_n _f_r_o_m _s_n_p_M_a_t_r_i_x _1._5._4 _w_h_i_l_e _1._5._5 _v_e_r_s_i_o_n _o_f _t_h_i_s
_f_u_n_c_t_i_o_n _i_s _d_i_m_i_n_i_s_h_e_d _i_n _s_p_e_e_d

_D_e_s_c_r_i_p_t_i_o_n:

     This function fits a generalized linear model with phenotype as
     dependent variable and, optionally, one or more potential
     confounders of a phenotype-genotype association as independent
     variable. A series of SNPs (or small groups of SNPs) are then
     tested for additional association with phenotype. In order to
     protect against misspecification of the variance function, 
     "robust" tests may be selected.

_U_s_a_g_e:

     snp.rhs.tests154(formula, family = "binomial", link, weights, subset, data = parent.frame(),
        snp.data, tests=NULL, robust = FALSE,
        control=glm.test.control(maxit=20, epsilon=1.e-4, R2Max=0.98), allow.missing=0.01)

_A_r_g_u_m_e_n_t_s:

 formula: The base model formula, with phenotype as dependent variable

  family: A string defining the generalized linear model family. This
          currently should (partially)  match one of '"binomial"',
          '"Poisson"', '"Gaussian"' or '"gamma"' (case-insensitive)

    link: A string defining the link function for the GLM. This
          currently should (partially) match one of '"logit"', '"log"',
          '"identity"' or '"inverse"'. The default action is to use the
          "canonical" link for the family selected

    data: The dataframe in which the base model is to be fitted

snp.data: An object of class '"snp.matrix"' or '"X.snp.matrix"'
          containing the SNP data

   tests: Either a vector of column names or  numbers for the SNPs to
          be tested, or a list of short vectors defining groups of SNPs
          to be tested (again by name or number). The default action is
          to carry out _all_ single SNP tests, but 'single.snp.tests'
          will often achieve the same result much faster

 weights: "Prior" weights in the generalized linear model

  subset: Array defining the subset of rows of  'data' to use

  robust: If 'TRUE', robust tests will be carried out

 control: An object giving parameters for the IRLS algorithm fitting of
          the base model and for the acceptable aliasing amongst new
          terms to be tested. See code{glm.test.control}

allow.missing: The maximum proportion of SNP genotype that can be
          missing before it becomes necessary to refit the base model

_D_e_t_a_i_l_s:

     The tests used are asymptotic chi-squared tests based on the
     vector of first and second derivatives of the log-likelihood with
     respect to the parameters of the additional model. The "robust"
     form is a generalized score test in the sense discussed by
     Boos(1992). The "base" model is first fitted, and a score test is
     performed for addition of one or more SNP genotypes to the model.
     Homozygous SNP genotypes are coded 0 or 2 and heterozygous
     genotypes are coded 1. For SNPs on the X chromosome, males are
     coded as homozygous females. For X SNPs, it will often be
     appropriate to include sex of subject in the base model (this is
     not done automatically).

     If a 'data' argument is supplied, the 'snp.data' and 'data'
     objects are aligned by rowname. Otherwise all variables in the
     model formulae are assumed to be stored in the same order as the
     columns of the 'snp.data' object.

_V_a_l_u_e:

     A data frame containing, for each SNP, 

Chi.squared: The value of the  chi-squared test statistic

      Df: The corresponding degrees of freedom

Df.residual: The residual degrees of freedom for the base model; _i.e._
          the number of observations minus the number of parameters
          fitted

     For the binomial family model, the base model can, in some
     circumstances, lead to perfect prediction of some observations
     (_i.e._ fitted probabilities of 0 or 1). These observations are
     ignored in subsequent calculations; in particular they are not
     counted in the residual degrees of freedom. Similarly for Poisson
     means fitted exactly to zero.

_N_o_t_e:

     A factor (or several factors) may be included as arguments to the
     function 'strata(...)' in the 'formula'. This fits all
     interactions of the factors so included, but leads to faster
     computation  than fitting these in the normal way. Additionally, a
     'cluster(...)' call may be included in the base model formula.
     This identifies clusters of potentially correlated observations
     (e.g. for members of the same family); in this case, an
     appropriate robust estimate of the variance of the score test is
     used.

_A_u_t_h_o_r(_s):

     David Clayton david.clayton@cimr.cam.ac.uk

_R_e_f_e_r_e_n_c_e_s:

     Boos, Dennis D. (1992) On generalized score tests. _The American
     Statistician_, *46*:327-333.

_S_e_e _A_l_s_o:

     'single.snp.tests', 'snp.lhs.tests', 'snp.matrix-class',
     'X.snp.matrix-class'

_E_x_a_m_p_l_e_s:

     library(snpMatrix)
     data(testdata)
     slt3 <- snp.rhs.tests154(cc~strata(region), family="binomial",
        data=subject.data, snp.data= Autosomes, tests=1:10)
     print(slt3)

