varcov                 package:bqtl                 R Documentation

_C_r_e_a_t_e _m_o_m_e_n_t _m_a_t_r_i_c_e_s

_D_e_s_c_r_i_p_t_i_o_n:

     Create a moment matrix of the marker variables and of the
     regressors by the phenotype variable.  For use in regression
     modelling on the markers.

_U_s_a_g_e:

     varcov(x, ana.obj, partial=NULL, scope=<<see below>>)

_A_r_g_u_m_e_n_t_s:

       x: A formula to specify the dependent and independent variables
          to be used in subsequent calculations e.g 'trait ~ locus(.) '

 ana.obj: An 'analysis.object', see'make.analysis.obj'  

 partial: A formula whose right hand side specifies variables to be
          treated as covariates. 

   scope: Usually not explicitly used. Optional vector of variable
          names. 

_D_e_t_a_i_l_s:

     This is just a wrapper for 'make.varcov'.

_V_a_l_u_e:

     A list with components 

  var.x : Moment matrix of the marker regressor variables

 cov.xy : Moment matrix of the marker regressor variables versus the
          phenotype variable

   var.y: The Second central moment of the phenotype variable

      df: The degrees of freedom, when no variables are specified in
          'partial' it is ' sum(subset==TRUE) - 1' 

_N_o_t_e:

     It is generally NOT a good idea to do regressions on
     ill-conditioned designs using the moment matrices.  The excuse for
     doing so here is twofold.  First, calculations using this method
     are used to perform importance sampling, so minor numerical
     inaccuracies in computing the probabilites used in sampling get
     straightened out by the importance weights.  Second, it will
     typically be the case that a prior is set on the regression
     coefficients and this results in a positive constant (aka a
     'ridge' parameter) being added to diagonal of 'varcov()$var.x' and
     this reduces the ill-conditioning.  Of course the rational for
     using the method is to speed the sampling, and it is very
     effective at doing so.

_A_u_t_h_o_r(_s):

     Charles C. Berry cberry@ucsd.edu

_S_e_e _A_l_s_o:

     The examples in 'swap' and 'twohk'.

