[Genabel-commits] r688 - pkg/GenABEL/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 8 00:26:01 CET 2011


Author: yurii
Date: 2011-03-08 00:26:01 +0100 (Tue, 08 Mar 2011)
New Revision: 688

Modified:
   pkg/GenABEL/R/GenABEL-package.R
   pkg/GenABEL/R/polygenic.R
   pkg/GenABEL/R/polygenic_hglm.R
Log:
update on polygenic_hglm parameters + documentation cross-linking

Modified: pkg/GenABEL/R/GenABEL-package.R
===================================================================
--- pkg/GenABEL/R/GenABEL-package.R	2011-03-07 23:24:59 UTC (rev 687)
+++ pkg/GenABEL/R/GenABEL-package.R	2011-03-07 23:26:01 UTC (rev 688)
@@ -104,6 +104,7 @@
 #' \code{\link{ibs}} (computations of IBS / genomic IBD),
 #' \code{\link{egscore}} (stratification adjustment following Price et al.),
 #' \code{\link{polygenic}} (heritability analysis),
+#' \code{\link{polygenic_hglm}} (another function for heritability analysis),
 #' \code{\link{mmscore}} (score test of Chen and Abecasis),
 #' \code{\link{grammar}} (grammar test of Aulchenko et al.).
 #' 

Modified: pkg/GenABEL/R/polygenic.R
===================================================================
--- pkg/GenABEL/R/polygenic.R	2011-03-07 23:24:59 UTC (rev 687)
+++ pkg/GenABEL/R/polygenic.R	2011-03-07 23:26:01 UTC (rev 688)
@@ -129,7 +129,12 @@
 #' If a trait (no covarites) is used, make sure that order of IDs in 
 #' kinship.matrix is exactly the same as in the outcome
 #' 
+#' Please note that there is alternative to 'polygenic', 
+#' \code{\link{polygenic_hglm}}, which is faster than 
+#' 'polygenic'.
+#' 
 #' @seealso 
+#' \code{\link{polygenic_hglm}},
 #' \code{\link{mmscore}},
 #' \code{\link{grammar}}
 #' 

Modified: pkg/GenABEL/R/polygenic_hglm.R
===================================================================
--- pkg/GenABEL/R/polygenic_hglm.R	2011-03-07 23:24:59 UTC (rev 687)
+++ pkg/GenABEL/R/polygenic_hglm.R	2011-03-07 23:26:01 UTC (rev 688)
@@ -2,6 +2,8 @@
 #' 
 #' Estimation of polygenic model using hierarchical
 #' GLM (hglm package)
+#' Tell when REML is used, what otherwise; 
+#' what it is doing, how to do tests, add more examples, references, etc.
 #' 
 #' @param formula Formula describing fixed effects to be used in analysis, e.g. 
 #' y ~ a + b means that outcome (y) depends on two covariates, a and b. 
@@ -14,6 +16,8 @@
 #' @param family a description of the error distribution and link function to be 
 #' used in the mean part of the model (see \code{\link{family}} for details of 
 #' family functions)
+#' @param conv 'conv' parameter of 'hglm' (stricter then default)
+#' @param maxit 'maxit' parameter of 'hglm' (stricter then default)
 #' @param ... other parameters passed to 'hglm' call
 #' 
 #' @author Xia Shen, Yurii Aulchenko
@@ -22,9 +26,9 @@
 #' need to put reference here
 #' 
 #' @seealso 
+#' \code{\link{polygenic}},
 #' \code{\link{mmscore}},
 #' \code{\link{grammar}}
-#' \code{\link{polygenic}}
 #' 
 #' @examples 
 #' data(ge03d2ex.clean)
@@ -46,7 +50,7 @@
 #' 
 #' @keywords htest
 #' 
-"polygenic_hglm" <- function(formula,kinship.matrix,data,family=gaussian(), ... )
+"polygenic_hglm" <- function(formula,kinship.matrix,data,family=gaussian(), conv=1e-8, maxit=100, ... )
 {
 	if (!require(hglm))
 		stop("this function requires 'hglm' package to be installed")
@@ -71,7 +75,9 @@
 	relmat <- relmat*2.0
 	s <- svd(relmat)
 	L <- s$u %*% diag(sqrt(s$d))
-	res_hglm <- hglm(y = y, X = desmat, Z = L, family = family, ... )
+	cnv <- 1e-6
+	mxit <- 40
+	res_hglm <- hglm(y = y, X = desmat, Z = L, family = family, conv = conv, maxit = maxit, ... )
 	#sum_res_hglm <- summary(res_hglm)
 	
 	out <- list()



More information about the Genabel-commits mailing list