Thread: [R-gregmisc-users] SF.net SVN: r-gregmisc:[1329] trunk/gmodels
Brought to you by:
warnes
From: <wa...@us...> - 2009-05-09 04:00:24
|
Revision: 1329 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1329&view=rev Author: warnes Date: 2009-05-09 04:00:15 +0000 (Sat, 09 May 2009) Log Message: ----------- Update Greg's email address Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/man/ci.Rd trunk/gmodels/man/estimable.Rd trunk/gmodels/man/fast.prcomp.Rd trunk/gmodels/man/fit.contrast.Rd trunk/gmodels/man/glh.test.Rd trunk/gmodels/man/make.contrasts.Rd Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/DESCRIPTION 2009-05-09 04:00:15 UTC (rev 1329) @@ -3,16 +3,17 @@ Title: Various R programming tools for model fitting Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker, Thomas Lumley, and Randall C Johnson. - Contributions from Randall C. Johnson are Copyright (2005) - SAIC-Frederick, Inc. Funded by the Intramural Research Program, - of the NIH, National Cancer Institute, Center for Cancer Research - under NCI Contract NO1-CO-12400. -Maintainer: Gregory R. Warnes <wa...@bs...> +Maintainer: Gregory R. Warnes <gr...@ra...> Description: Various R programming tools for model fitting Depends: R (>= 1.9.0) -Suggests: gplots, Matrix, nlme, lme4, coda +Suggests: gplots, Matrix, nlme, lme4 Imports: MASS, gdata -License: GPL-2. +License: GPL-2. Contributions from Randall C. Johnson are + Copyright (2005) SAIC-Frederick, Inc. Funded by + the Intramural Research Program, of the NIH, National + Cancer Institute, Center for Cancer Research under NCI + Contract NO1-CO-12400. URL: http://cran.r-project.org/src/contrib/PACKAGES.html http://www.sf.net/projects/r-gregmisc Date: 2007-07-24 +Packaged: Fri Dec 7 17:22:36 2007; warnes Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/man/ci.Rd 2009-05-09 04:00:15 UTC (rev 1329) @@ -6,20 +6,21 @@ \alias{ci.binom} \alias{ci.lm} \alias{ci.lme} -\alias{ci.lmer} +\alias{ci.mer} \title{Compute Confidence Intervals} \description{ Compute and display confidence intervals for model estimates. Methods are provided for the mean of a numeric vector \code{ci.default}, the probability of a binomial vector - \code{ci.binom}, and for \code{lm}, \code{lme}, and \code{lmer} objects. } + \code{ci.binom}, and for \code{lm}, \code{lme}, and \code{mer} objects are + provided. } \synopsis{ ci(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{default}(x, confidence = 0.95, alpha = 1 - confidence, na.rm=FALSE)...) \method{ci}{binom}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lm}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lme}(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{lmer}(x, confidence = 0.95, alpha = 1 - confidence, - sim.lmer=TRUE, n.sim=1000, ...) + \method{ci}{mer}(x, confidence = 0.95, alpha = 1 - confidence, + sim.mer=TRUE, n.sim=1000, ...) } \arguments{ \item{x}{ object from which to compute confidence intervals. } @@ -28,8 +29,8 @@ \item{na.rm}{boolean indicating whether missing values should be removed. Defaults to \code{FALSE}.} \item{\dots}{Arguments for methods} - \item{sim.lmer}{Logical value. If TRUE confidence - intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. This option only takes effect for lmer + \item{sim.mer}{Logical value. If TRUE confidence + intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. This option only takes effect for mer objects.} \item{n.sim}{Number of samples to take in \code{\Link[Matrix]{mcmcsamp}}.} } @@ -41,7 +42,7 @@ \code{Estimate}, \code{CI lower}, \code{CI upper}, \code{Std. Error}, \code{DF} (for lme objects only), and \code{p-value}. } -\author{ Gregory R. Warnes \email{wa...@bs...} +\author{ Gregory R. Warnes \email{gr...@ra...} } \seealso{ \code{\link[stats]{confint}}, @@ -66,7 +67,7 @@ ci(reg) \dontrun{ -# lmer example +# mer example library(lme4) fm2 <- lmer(Reaction ~ Days + (1|Subject) + (0+Days|Subject), sleepstudy) ci(fm2) Modified: trunk/gmodels/man/estimable.Rd =================================================================== --- trunk/gmodels/man/estimable.Rd 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/man/estimable.Rd 2009-05-09 04:00:15 UTC (rev 1329) @@ -3,27 +3,27 @@ \name{estimable} \alias{estimable} \alias{estimable.default} -\alias{estimable.lmer} +\alias{estimable.mer} \alias{estimable.mlm} %\alias{.wald} %\alias{.to.est} \title{Contrasts and estimable linear functions of model coefficients} \description{ Compute and test contrasts and other estimable linear - functions of model coefficients for for lm, glm, lme, lmer, and geese + functions of model coefficients for for lm, glm, lme, mer, and geese objects } \usage{ estimable(obj, cm, beta0, conf.int=NULL, show.beta0, ...) \method{estimable}{default} (obj, cm, beta0, conf.int=NULL, show.beta0, joint.test=FALSE, ...) -\method{estimable}{lmer}(obj, cm, beta0, conf.int=NULL, - show.beta0, sim.lmer=TRUE, n.sim=1000, ...) +\method{estimable}{mer}(obj, cm, beta0, conf.int=NULL, + show.beta0, sim.mer=TRUE, n.sim=1000, ...) \method{estimable}{mlm}(obj, cm, beta0, conf.int=NULL, show.beta0, ...) %.wald(obj, cm,beta0=rep(0, ifelse(is.null(nrow(cm)), 1, nrow(cm)))) %.to.est(obj, params) } \arguments{ - \item{obj}{Regression (lm, glm, lme, lmer, mlm) object. } + \item{obj}{Regression (lm, glm, lme, mer, mlm) object. } \item{cm}{Vector, List, or Matrix specifying estimable linear functions or contrasts. See below for details.} \item{beta0}{Vector of null hypothesis values} @@ -37,7 +37,7 @@ \item{show.beta0}{Logical value. If TRUE a column for beta0 will be included in the output table. Defaults to TRUE when beta0 is specified, FALSE otherwise.} - \item{sim.lmer}{Logical value. If TRUE p-values and confidence + \item{sim.mer}{Logical value. If TRUE p-values and confidence intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. } \item{n.sim}{Number of MCMC samples to take in @@ -95,7 +95,7 @@ } \author{ BXC (Bendix Carstensen) \email{bxc\@novonordisk.com}, - Gregory R. Warnes \email{wa...@bs...}, + Gregory R. Warnes \email{gr...@ra...}, Soren Hojsgaard \email{so...@ag...}, and Randall C Johnson \email{rjo...@nc...} } Modified: trunk/gmodels/man/fast.prcomp.Rd =================================================================== --- trunk/gmodels/man/fast.prcomp.Rd 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/man/fast.prcomp.Rd 2009-05-09 04:00:15 UTC (rev 1329) @@ -69,7 +69,7 @@ \code{\link{svd}} . } \author{Modifications by Gregory R. Warnes - \email{wa...@bs...} } + \email{gr...@ra...} } \seealso{ \code{\link[stats]{prcomp}}, \code{\link{svd}}, \code{\link{La.svd}} Modified: trunk/gmodels/man/fit.contrast.Rd =================================================================== --- trunk/gmodels/man/fit.contrast.Rd 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/man/fit.contrast.Rd 2009-05-09 04:00:15 UTC (rev 1329) @@ -4,7 +4,7 @@ \alias{fit.contrast} \alias{fit.contrast.lm} \alias{fit.contrast.lme} -\alias{fit.contrast.lmer} +\alias{fit.contrast.mer} \title{Compute and test arbitrary contrasts for regression objects} \description{ Compute and test arbitrary contrasts for regression objects. @@ -15,8 +15,8 @@ conf.int=NULL, df=FALSE, ...) \method{fit.contrast}{lme}(model, varname, coeff, showall=FALSE, conf.int=NULL, df=FALSE, ...) -\method{fit.contrast}{lmer}(model, varname, coeff, showall=FALSE, - conf.int=NULL, sim.lmer = TRUE, n.sim = 1000, ...) +\method{fit.contrast}{mer}(model, varname, coeff, showall=FALSE, + conf.int=NULL, sim.mer = TRUE, n.sim = 1000, ...) } \arguments{ \item{model}{regression (lm,glm,aov,lme) object for which the @@ -34,8 +34,8 @@ \item{df}{boolean indicating whether to return a column containing the degrees of freedom.} \item{\dots}{optional arguments provided by methods.} - \item{sim.lmer}{Logical value. If TRUE p-values and confidence - intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. This option only takes effect for lmer + \item{sim.mer}{Logical value. If TRUE p-values and confidence + intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. This option only takes effect for mer objects.} \item{n.sim}{Number of samples to use in \code{\Link[Matrix]{mcmcsamp}}.} } @@ -52,7 +52,7 @@ specified lower and upper confidence limits are also returned.} \references{Venables & Ripley, Section 6.2} -\author{ Gregory R. Warnes \email{wa...@bs...}} +\author{ Gregory R. Warnes \email{gr...@ra...}} \seealso{ \code{\link{lm}}, \code{\link{contrasts}}, \code{\link{contr.treatment}}, \code{\link{contr.poly}}, Modified: trunk/gmodels/man/glh.test.Rd =================================================================== --- trunk/gmodels/man/glh.test.Rd 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/man/glh.test.Rd 2009-05-09 04:00:15 UTC (rev 1329) @@ -67,7 +67,7 @@ } \references{ R.H. Myers, Classical and Modern Regression with Applications, 2nd Ed, 1990, p. 105} -\author{Gregory R. Warnes \email{wa...@bs...} } +\author{Gregory R. Warnes \email{gr...@ra...} } \seealso{\code{\link{fit.contrast}}, \code{\link{estimable}}, \code{\link{contrasts}} } \examples{ Modified: trunk/gmodels/man/make.contrasts.Rd =================================================================== --- trunk/gmodels/man/make.contrasts.Rd 2009-05-09 03:35:14 UTC (rev 1328) +++ trunk/gmodels/man/make.contrasts.Rd 2009-05-09 04:00:15 UTC (rev 1329) @@ -31,7 +31,7 @@ \code{\link{contrasts}} or to the \code{contrasts} argument of model functions (eg, \code{\link{lm}}). } -\author{ Gregory R. Warnes \email{wa...@bs...}} +\author{ Gregory R. Warnes \email{gr...@ra...}} \seealso{ \code{\link{lm}}, \code{\link{contrasts}}, \code{\link{contr.treatment}}, \code{\link{contr.poly}}, Computation and testing of General Linear Hypothesis: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2009-05-09 04:36:16
|
Revision: 1330 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1330&view=rev Author: warnes Date: 2009-05-09 04:36:13 +0000 (Sat, 09 May 2009) Log Message: ----------- Move ChangeLog and NEWS files into inst directory Added Paths: ----------- trunk/gmodels/ChangeLog trunk/gmodels/inst/ trunk/gmodels/inst/NEWS Removed Paths: ------------- trunk/gmodels/NEWS Added: trunk/gmodels/ChangeLog =================================================================== --- trunk/gmodels/ChangeLog (rev 0) +++ trunk/gmodels/ChangeLog 2009-05-09 04:36:13 UTC (rev 1330) @@ -0,0 +1 @@ +link inst/ChangeLog \ No newline at end of file Property changes on: trunk/gmodels/ChangeLog ___________________________________________________________________ Added: svn:special + * Deleted: trunk/gmodels/NEWS =================================================================== --- trunk/gmodels/NEWS 2009-05-09 04:00:15 UTC (rev 1329) +++ trunk/gmodels/NEWS 2009-05-09 04:36:13 UTC (rev 1330) @@ -1,80 +0,0 @@ -Version 2.14.1 --------------- - -New features: - -- Add support for 'lme' objects to estimable(). - -Other: - -- Fix minor typos in manual page for estimable(). - -Version 2.14.0 --------------- - -New Features: - -- Add support for 'mlm' objects to estimable - - -Version 2.13.2 --------------- - -Bug Fixes: - -- Lower and upper end of confidence interval for lmer objects were - reversed in est.lmer(). - -- Correct Greg's email address in two help files. - - -Version 2.13.1 --------------- - -Bug Fixes: - -- Problem: R CMD check errors under development version of R 2.5.0 - Solution: - - Add additional packages to 'Suggests' list in DESCRIPTION - - Remove extra trailing comma in function calls - - fix various code/doc inconsistencies - -- Problem: estimable() was failing for lmer objects. - Solution: - - Create a generic estimable() - - Move old function to estimable.default() - - Add estimable.lmer() to the exported methods list in NAMESPACE - - -Version 2.13.0 --------------- - - -Version 2.12.0 --------------- - -- Updated Greg's email address. - -- Add support for lmer (lme version 4) objects to ci(), estimable(), - and fit.contrast() via code contributed by Randall C Johnson. - -- Add simplfied coefficient specification to estimable() based on a - function provided by Randall C Johnson. It is now possible to do - things like: - estimable(reg, c("xB"=1,"xD"=-1)) - instead of: - estimable(reg, c( 0, 1, 0, -1)) - which should make estimable() much easier to use for large models. - -Version 2.1.0 -------------- - -Version 2.0.8 -------------- - - - Added DESCRIPTION and removed DESCRIPTION.in - - - Updated CrossTable.R - - - Updated NAMESPACE file - Copied: trunk/gmodels/inst/NEWS (from rev 1232, trunk/gmodels/NEWS) =================================================================== --- trunk/gmodels/inst/NEWS (rev 0) +++ trunk/gmodels/inst/NEWS 2009-05-09 04:36:13 UTC (rev 1330) @@ -0,0 +1,80 @@ +Version 2.14.1 +-------------- + +New features: + +- Add support for 'lme' objects to estimable(). + +Other: + +- Fix minor typos in manual page for estimable(). + +Version 2.14.0 +-------------- + +New Features: + +- Add support for 'mlm' objects to estimable + + +Version 2.13.2 +-------------- + +Bug Fixes: + +- Lower and upper end of confidence interval for lmer objects were + reversed in est.lmer(). + +- Correct Greg's email address in two help files. + + +Version 2.13.1 +-------------- + +Bug Fixes: + +- Problem: R CMD check errors under development version of R 2.5.0 + Solution: + - Add additional packages to 'Suggests' list in DESCRIPTION + - Remove extra trailing comma in function calls + - fix various code/doc inconsistencies + +- Problem: estimable() was failing for lmer objects. + Solution: + - Create a generic estimable() + - Move old function to estimable.default() + - Add estimable.lmer() to the exported methods list in NAMESPACE + + +Version 2.13.0 +-------------- + + +Version 2.12.0 +-------------- + +- Updated Greg's email address. + +- Add support for lmer (lme version 4) objects to ci(), estimable(), + and fit.contrast() via code contributed by Randall C Johnson. + +- Add simplfied coefficient specification to estimable() based on a + function provided by Randall C Johnson. It is now possible to do + things like: + estimable(reg, c("xB"=1,"xD"=-1)) + instead of: + estimable(reg, c( 0, 1, 0, -1)) + which should make estimable() much easier to use for large models. + +Version 2.1.0 +------------- + +Version 2.0.8 +------------- + + - Added DESCRIPTION and removed DESCRIPTION.in + + - Updated CrossTable.R + + - Updated NAMESPACE file + Property changes on: trunk/gmodels/inst/NEWS ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2009-05-09 05:00:52
|
Revision: 1333 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1333&view=rev Author: warnes Date: 2009-05-09 05:00:47 +0000 (Sat, 09 May 2009) Log Message: ----------- Add support for lme4's 'mer' objects Modified Paths: -------------- trunk/gmodels/NAMESPACE trunk/gmodels/R/ci.R trunk/gmodels/R/est.lmer.R trunk/gmodels/R/estimable.R trunk/gmodels/R/fit.contrast.R trunk/gmodels/R/to.est.R Modified: trunk/gmodels/NAMESPACE =================================================================== --- trunk/gmodels/NAMESPACE 2009-05-09 04:53:47 UTC (rev 1332) +++ trunk/gmodels/NAMESPACE 2009-05-09 05:00:47 UTC (rev 1333) @@ -18,14 +18,14 @@ S3method(ci, binom) S3method(ci, lm) S3method(ci, lme) -S3method(ci, lmer) +S3method(ci, mer) S3method(fit.contrast, lm) S3method(fit.contrast, lme) -S3method(fit.contrast, lmer) +S3method(fit.contrast, mer) S3method(estimable, default) -S3method(estimable, lmer) +S3method(estimable, mer) S3method(estimable, mlm) S3method(print, glh.test) Modified: trunk/gmodels/R/ci.R =================================================================== --- trunk/gmodels/R/ci.R 2009-05-09 04:53:47 UTC (rev 1332) +++ trunk/gmodels/R/ci.R 2009-05-09 05:00:47 UTC (rev 1333) @@ -68,21 +68,21 @@ retval } -ci.lmer <- function(x, +ci.mer <- function(x, confidence=0.95, alpha=1-confidence, - sim.lmer=TRUE, + sim.mer=TRUE, n.sim=1000, ... ) { - if(!(require(coda, quietly=TRUE) & require(Matrix, quietly=TRUE))) - stop("coda and Matrix packages required for ci.lmer") +## if(!(require(coda, quietly=TRUE) & require(Matrix, quietly=TRUE))) +## stop("coda and Matrix packages required for ci.mer") x.effects <- fixef(x) n <- length(x.effects) - retval <- est.lmer(obj = x, cm = diag(n), beta0 = rep(0, n), + retval <- est.mer(obj = x, cm = diag(n), beta0 = rep(0, n), conf.int = confidence, show.beta0 = FALSE, n.sim = n.sim)[,c("Estimate", "Lower.CI", "Upper.CI", "Std. Error", "p value")] Modified: trunk/gmodels/R/est.lmer.R =================================================================== --- trunk/gmodels/R/est.lmer.R 2009-05-09 04:53:47 UTC (rev 1332) +++ trunk/gmodels/R/est.lmer.R 2009-05-09 05:00:47 UTC (rev 1333) @@ -7,8 +7,8 @@ est.lmer <- function(obj, cm, beta0, conf.int, show.beta0, n.sim) { - if(!require(coda, quietly=TRUE)) - stop("coda package required when sim.lmer == TRUE") +## if(!require(coda, quietly=TRUE)) +## stop("coda package required when sim.lmer == TRUE") samp <- mcmcsamp(obj, n.sim) samp.summ <- summary(samp) Modified: trunk/gmodels/R/estimable.R =================================================================== --- trunk/gmodels/R/estimable.R 2009-05-09 04:53:47 UTC (rev 1332) +++ trunk/gmodels/R/estimable.R 2009-05-09 05:00:47 UTC (rev 1333) @@ -1,4 +1,4 @@ -# $Id$ +## $Id$ estimable <- function (obj, cm, beta0, conf.int=NULL, show.beta0, ...) { UseMethod("estimable") @@ -163,53 +163,53 @@ if(!show.beta0) retval$beta0 <- NULL return(retval) } - } +} .wald <- function (obj, cm, beta0=rep(0, ifelse(is.null(nrow(cm)), 1, nrow(cm)))) { - if (!is.matrix(cm) && !is.data.frame(cm)) - cm <- matrix(cm, nrow=1) - df <- nrow(cm) - if ("geese" %in% class(obj)) - { - cf <- obj$beta - vcv <- obj$vbeta - } - else if ("gee" %in% class(obj)) - { - cf <- summary(obj)$coef - vcv <- obj$robust.variance - } - else if ("lm" %in% class(obj)) - { - cf <- summary.lm(obj)$coefficients[, 1] - if ("glm" %in% class(obj)) - vcv <- summary(obj)$cov.scaled - else - vcv <- summary.lm(obj)$cov.unscaled * summary.lm(obj)$sigma^2 - } - else if ("lme" %in% class(obj)) - { - s.o <- summary(obj) - cf <- s.o$tTable[,1] - se <- s.o$tTable[, 2] - rho <- s.o$cor - vcv <- rho * outer(se, se) - } - else - stop("obj must be of class 'lm', 'glm', 'aov', 'gee', 'geese', or 'lme'.") - u <- (cm %*% cf)-beta0 - vcv.u <- cm %*% vcv %*% t(cm) - W <- t(u) %*% solve(vcv.u) %*% u - prob <- 1 - pchisq(W, df=df) - retval <- as.data.frame(cbind(W, df, prob)) - names(retval) <- c("X2.stat", "DF", "Pr(>|X^2|)") - print(as.data.frame(retval)) + if (!is.matrix(cm) && !is.data.frame(cm)) + cm <- matrix(cm, nrow=1) + df <- nrow(cm) + if ("geese" %in% class(obj)) + { + cf <- obj$beta + vcv <- obj$vbeta + } + else if ("gee" %in% class(obj)) + { + cf <- summary(obj)$coef + vcv <- obj$robust.variance + } + else if ("lm" %in% class(obj)) + { + cf <- summary.lm(obj)$coefficients[, 1] + if ("glm" %in% class(obj)) + vcv <- summary(obj)$cov.scaled + else + vcv <- summary.lm(obj)$cov.unscaled * summary.lm(obj)$sigma^2 + } + else if ("lme" %in% class(obj)) + { + s.o <- summary(obj) + cf <- s.o$tTable[,1] + se <- s.o$tTable[, 2] + rho <- s.o$cor + vcv <- rho * outer(se, se) + } + else + stop("obj must be of class 'lm', 'glm', 'aov', 'gee', 'geese', or 'lme'.") + u <- (cm %*% cf)-beta0 + vcv.u <- cm %*% vcv %*% t(cm) + W <- t(u) %*% solve(vcv.u) %*% u + prob <- 1 - pchisq(W, df=df) + retval <- as.data.frame(cbind(W, df, prob)) + names(retval) <- c("X2.stat", "DF", "Pr(>|X^2|)") + print(as.data.frame(retval)) } -estimable.lmer <- function (obj, cm, beta0, conf.int=NULL, show.beta0, - sim.lmer=TRUE, n.sim=1000, ...) +estimable.mer <- function (obj, cm, beta0, conf.int=NULL, show.beta0, + sim.mer=TRUE, n.sim=1000, ...) { if (is.matrix(cm) || is.data.frame(cm)) { @@ -225,7 +225,7 @@ } else { - stop("`cm' argument must be of type vector, list, or matrix.") + stop("'cm' argument must be of type vector, list, or matrix.") } if(missing(show.beta0)) @@ -243,30 +243,36 @@ } - if ("lmer" %in% class(obj)) { - if(!require(Matrix, quietly=TRUE)) - stop("Matrix package required for lmer objects") - - if(sim.lmer) - return(est.lmer(obj=obj, cm=cm, beta0=beta0, conf.int=conf.int, - show.beta0=show.beta0, n.sim=n.sim)) - - stat.name <- "lmer" - cf <- as.matrix(fixef(obj)) - vcv <- as.matrix(vcov(obj)) - df <- NA - } - else { - stop("obj is not of class lmer") - } + if ("mer" %in% class(obj)) { + if(sim.mer) + return(est.mer(obj=obj, cm=cm, beta0=beta0, conf.int=conf.int, + show.beta0=show.beta0, n.sim=n.sim)) + + stat.name <- "mer" + cf <- as.matrix(fixef(obj)) + vcv <- as.matrix(vcov(obj)) + df <- NA + } + else { + stop("obj is not of class mer") + } - retval <- cbind(hyp=beta0, est=ct, stderr=vc, "t value"=ct.diff/vc) - dimnames(retval) <- list(rn, c("beta0", "Estimate", "Std. Error", - "t value")) + if (is.null(rownames(cm))) + rn <- paste("(", apply(cm, 1, paste, collapse=" "), + ")", sep="") + else rn <- rownames(cm) + + ct <- cm %*% cf[, 1] + ct.diff <- cm %*% cf[, 1] - beta0 + vc <- sqrt(diag(cm %*% vcv %*% t(cm))) + + retval <- cbind(hyp=beta0, est=ct, stderr=vc, "t value"=ct.diff/vc) + dimnames(retval) <- list(rn, c("beta0", "Estimate", "Std. Error", + "t value")) - rownames(retval) <- make.unique(rownames(retval)) - retval <- as.data.frame(retval) - if(!show.beta0) retval$beta0 <- NULL - return(retval) + rownames(retval) <- make.unique(rownames(retval)) + retval <- as.data.frame(retval) + if(!show.beta0) retval$beta0 <- NULL + return(retval) } Modified: trunk/gmodels/R/fit.contrast.R =================================================================== --- trunk/gmodels/R/fit.contrast.R 2009-05-09 04:53:47 UTC (rev 1332) +++ trunk/gmodels/R/fit.contrast.R 2009-05-09 05:00:47 UTC (rev 1333) @@ -4,9 +4,9 @@ conf.int=NULL, df=FALSE, ...) { # check class of model - if( !(any(class(model) %in% c("lm", "aov", "lme") ) )) ###### - stop("contrast.lm can only be applied to objects inheriting from 'lm'", ###### took lmer out of here - "and 'lme' (eg: lm,glm,aov,lme).") ###### + if( !(any(class(model) %in% c("lm", "aov", "lme") ) )) + stop("contrast.lm can only be applied to objects inheriting from 'lm'", + "and 'lme' (eg: lm,glm,aov,lme).") # make sure we have the NAME of the variable if(!is.character(varname)) @@ -34,7 +34,7 @@ colnames(cmat) <- cn # recall fitting method with the specified contrast - m <- model$call ###### deleted lmer specific/S4 portion + m <- model$call if(is.null(m$contrasts)) m$contrasts <- list() @@ -46,7 +46,7 @@ r <- eval(m) # now return the correct elements .... - if( 'lme' %in% class(model) ) ####### took out lmer section + if( 'lme' %in% class(model) ) { est <- r$coefficients$fixed se <- sqrt(diag(r$varFix)) @@ -81,7 +81,7 @@ } else { - rn <- paste(varname,rownames(coeff),sep="") ####### removed lmer portion + rn <- paste(varname,rownames(coeff),sep="") ind <- match(rn,rownames(retval)) retval <- retval[ind,,drop=FALSE] } @@ -104,8 +104,8 @@ return(retval) } -# fit.contrast.lme and fit.contrast.lmer are necessary because -# 'lme' and 'lmer' objects do not inherit from 'lm'. +# fit.contrast.lme and fit.contrast.mer are necessary because +# 'lme' and 'mer' objects do not inherit from 'lm'. # # **Make sure that the argument list *exactly* matches the one # for fit.contrast.lm() above.** @@ -117,10 +117,10 @@ fit.contrast.lm(model, varname, coeff, showall, conf.int, df) } -# I made rather dramatic changes here and do all calculations in fit.contrast.lmer rather than -# fit.contrast.lm because of the simulation extras ... added sim.lmer and n.sim to the parameter list -fit.contrast.lmer <- function(model, varname, coeff, showall=FALSE, - conf.int=NULL, sim.lmer=TRUE, n.sim=1000, ...) +# I made rather dramatic changes here and do all calculations in fit.contrast.mer rather than +# fit.contrast.lm because of the simulation extras ... added sim.mer and n.sim to the parameter list +fit.contrast.mer <- function(model, varname, coeff, showall=FALSE, + conf.int=NULL, sim.mer=TRUE, n.sim=1000, ...) { require(lme4) @@ -163,15 +163,15 @@ r.effects <- fixef(r) n <- length(r.effects) - if(sim.lmer) + if(sim.mer) { - retval <- est.lmer(obj = r, cm = diag(n), beta0 = rep(0, n), + retval <- est.mer(obj = r, cm = diag(n), beta0 = rep(0, n), conf.int = conf.int, show.beta0 = FALSE, n.sim=n.sim) rownames(retval) <- names(r.effects) }else{ if(!is.null(conf.int)) - warning("Confidence interval calculation for lmer objects requires simulation -- use sim.lmer = TRUE") + warning("Confidence interval calculation for mer objects requires simulation -- use sim.mer = TRUE") est <- fixef(r) se <- sqrt(diag(as.matrix(vcov(r)))) Modified: trunk/gmodels/R/to.est.R =================================================================== --- trunk/gmodels/R/to.est.R 2009-05-09 04:53:47 UTC (rev 1332) +++ trunk/gmodels/R/to.est.R 2009-05-09 05:00:47 UTC (rev 1333) @@ -5,7 +5,7 @@ .to.est <- function(obj, params) { - if('lme' %in% class(obj) | 'lmer' %in% class(obj)) + if('lme' %in% class(obj) | 'mer' %in% class(obj)) { eff.obj <- fixef(obj) } @@ -30,7 +30,7 @@ if(length(params)==length(est)) names(params) <- names(est) else - stop("`param' has no names and does not match number of coefficients of model. Unable to construct coefficient vector") + stop("'param' has no names and does not match number of coefficients of model. Unable to construct coefficient vector") else { matches <- names(params) %in% names(est) @@ -45,10 +45,10 @@ ) } - if(is.list(params)) ##################### - est[names(params)] <- unlist(params) ##################### changed - else ##################### - est[names(params)] <- params ##################### + if(is.list(params)) + est[names(params)] <- unlist(params) + else + est[names(params)] <- params } return(est) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2009-05-09 05:29:59
|
Revision: 1337 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1337&view=rev Author: warnes Date: 2009-05-09 05:29:53 +0000 (Sat, 09 May 2009) Log Message: ----------- Add tests for lme4 'mer' objects Added Paths: ----------- trunk/gmodels/test/ trunk/gmodels/test/lme-test.R Added: trunk/gmodels/test/lme-test.R =================================================================== --- trunk/gmodels/test/lme-test.R (rev 0) +++ trunk/gmodels/test/lme-test.R 2009-05-09 05:29:53 UTC (rev 1337) @@ -0,0 +1,23 @@ +library(gmodels) +library(lme4) + +sleepstudy$dayGroup <- cut(sleepstudy$Days, seq(-1,9,by=2), include=T) + +# ci example +fm2 <- lmer(Reaction ~ dayGroup + (1|Subject) + (0+Days|Subject), sleepstudy) +ci(fm2) + + +# estimable examples +estimable(fm2, c( 0, -1, 1, 0, 0 ) ) # list all terms +estimable(fm2, c("dayGroup(1,3]"=-1, "dayGroup(3,5]"=1)) # just the nonzero terms +estimable(fm2, c("dayGroup(1,3]"=-1, "dayGroup(3,5]"=1), n.sim=5000 ) # more simulations... + + +# fit.contrast example +fit.contrast( fm2, "dayGroup", + rbind("0-1 vs 3-4"=c(-1,0,1,0,0), + "3-4 vs 5-6"=c(0,0,-1,1,0) + ), + conf=0.95 ) + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2011-01-16 22:17:24
|
Revision: 1466 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1466&view=rev Author: warnes Date: 2011-01-16 22:17:17 +0000 (Sun, 16 Jan 2011) Log Message: ----------- Fix warnings reported by R CMD check. Update version number to 2.15.1. Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/inst/NEWS trunk/gmodels/man/ci.Rd trunk/gmodels/man/estimable.Rd trunk/gmodels/man/fast.prcomp.Rd trunk/gmodels/man/fit.contrast.Rd trunk/gmodels/man/glh.test.Rd trunk/gmodels/man/make.contrasts.Rd Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/DESCRIPTION 2011-01-16 22:17:17 UTC (rev 1466) @@ -1,5 +1,5 @@ Package: gmodels -Version: 2.15.0 +Version: 2.15.1 Title: Various R programming tools for model fitting Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker, Thomas Lumley, and Randall C @@ -7,10 +7,10 @@ (2005) SAIC-Frederick, Inc. Funded by the Intramural Research Program, of the NIH, National Cancer Institute, Center for Cancer Research under NCI Contract NO1-CO-12400. -Maintainer: Gregory R. Warnes <gr...@ra...> +Maintainer: Gregory R. Warnes <gr...@wa...> Description: Various R programming tools for model fitting Depends: R (>= 1.9.0) -Suggests: gplots, Matrix, nlme, lme4 +Suggests: gplots, gtools, Matrix, nlme, lme4 Imports: MASS, gdata License: GPL-2 URL: http://cran.r-project.org/src/contrib/PACKAGES.html Modified: trunk/gmodels/inst/NEWS =================================================================== --- trunk/gmodels/inst/NEWS 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/inst/NEWS 2011-01-16 22:17:17 UTC (rev 1466) @@ -1,3 +1,11 @@ +Version 2.15.1 +-------------- + +Bug fixes: + +- Fix warnings reported by new versions of R CMD check. + + Version 2.15.0 -------------- Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/man/ci.Rd 2011-01-16 22:17:17 UTC (rev 1466) @@ -30,9 +30,9 @@ removed. Defaults to \code{FALSE}.} \item{\dots}{Arguments for methods} \item{sim.mer}{Logical value. If TRUE confidence - intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. This option only takes effect for mer + intervals will be estimated using \code{mcmcsamp}. This option only takes effect for mer objects.} - \item{n.sim}{Number of samples to take in \code{\Link[Matrix]{mcmcsamp}}.} + \item{n.sim}{Number of samples to take in \code{mcmcsamp}.} } %\details{ % ~~ If necessary, more details than the __description__ above ~~ @@ -42,7 +42,7 @@ \code{Estimate}, \code{CI lower}, \code{CI upper}, \code{Std. Error}, \code{DF} (for lme objects only), and \code{p-value}. } -\author{ Gregory R. Warnes \email{gr...@ra...} +\author{ Gregory R. Warnes \email{gr...@wa...} } \seealso{ \code{\link[stats]{confint}}, Modified: trunk/gmodels/man/estimable.Rd =================================================================== --- trunk/gmodels/man/estimable.Rd 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/man/estimable.Rd 2011-01-16 22:17:17 UTC (rev 1466) @@ -38,10 +38,10 @@ included in the output table. Defaults to TRUE when beta0 is specified, FALSE otherwise.} \item{sim.mer}{Logical value. If TRUE p-values and confidence - intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. + intervals will be estimated using \code{mcmcsamp}. } \item{n.sim}{Number of MCMC samples to take in - \code{\Link[Matrix]{mcmcsamp}}. + \code{mcmcsamp}. } \item{...}{ignored} } @@ -71,7 +71,7 @@ linear functions are meaningful. For computing contrasts among levels of a single factor, - \code{\link{fit.contrast}} may be more convenient. For computing + \code{fit.contrast} may be more convenient. For computing contrasts between two specific combinations of model parameters, the \code{contrast} function in Frank Harrell's Design library may be more convenient. @@ -95,13 +95,14 @@ } \author{ BXC (Bendix Carstensen) \email{bxc\@novonordisk.com}, - Gregory R. Warnes \email{gr...@ra...}, + Gregory R. Warnes \email{gr...@wa...}, Soren Hojsgaard \email{so...@ag...}, and Randall C Johnson \email{rjo...@nc...} } \seealso{ \code{\link{fit.contrast}}, - \code{\link[stats]{lm}}, \code{\link[nlme]{lme}}, + \code{\link[stats]{lm}}, + \code{\link[nlme]{lme}}, \code{\link[stats]{contrasts}}, \code{\link[Design]{contrast}}, } Modified: trunk/gmodels/man/fast.prcomp.Rd =================================================================== --- trunk/gmodels/man/fast.prcomp.Rd 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/man/fast.prcomp.Rd 2011-01-16 22:17:17 UTC (rev 1466) @@ -69,7 +69,7 @@ \code{\link{svd}} . } \author{Modifications by Gregory R. Warnes - \email{gr...@ra...} } + \email{gr...@wa...} } \seealso{ \code{\link[stats]{prcomp}}, \code{\link{svd}}, \code{\link{La.svd}} Modified: trunk/gmodels/man/fit.contrast.Rd =================================================================== --- trunk/gmodels/man/fit.contrast.Rd 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/man/fit.contrast.Rd 2011-01-16 22:17:17 UTC (rev 1466) @@ -35,9 +35,9 @@ degrees of freedom.} \item{\dots}{optional arguments provided by methods.} \item{sim.mer}{Logical value. If TRUE p-values and confidence - intervals will be estimated using \code{\Link[Matrix]{mcmcsamp}}. This option only takes effect for mer + intervals will be estimated using \code{mcmcsamp}. This option only takes effect for mer objects.} - \item{n.sim}{Number of samples to use in \code{\Link[Matrix]{mcmcsamp}}.} + \item{n.sim}{Number of samples to use in \code{mcmcsamp}.} } \details{ @@ -52,7 +52,7 @@ specified lower and upper confidence limits are also returned.} \references{Venables & Ripley, Section 6.2} -\author{ Gregory R. Warnes \email{gr...@ra...}} +\author{ Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{lm}}, \code{\link{contrasts}}, \code{\link{contr.treatment}}, \code{\link{contr.poly}}, Modified: trunk/gmodels/man/glh.test.Rd =================================================================== --- trunk/gmodels/man/glh.test.Rd 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/man/glh.test.Rd 2011-01-16 22:17:17 UTC (rev 1466) @@ -65,7 +65,7 @@ } \references{ R.H. Myers, Classical and Modern Regression with Applications, 2nd Ed, 1990, p. 105} -\author{Gregory R. Warnes \email{gr...@ra...} } +\author{Gregory R. Warnes \email{gr...@wa...} } \seealso{\code{\link{fit.contrast}}, \code{\link{estimable}}, \code{\link{contrasts}} } \examples{ Modified: trunk/gmodels/man/make.contrasts.Rd =================================================================== --- trunk/gmodels/man/make.contrasts.Rd 2011-01-15 21:58:56 UTC (rev 1465) +++ trunk/gmodels/man/make.contrasts.Rd 2011-01-16 22:17:17 UTC (rev 1466) @@ -31,7 +31,7 @@ \code{\link{contrasts}} or to the \code{contrasts} argument of model functions (eg, \code{\link{lm}}). } -\author{ Gregory R. Warnes \email{gr...@ra...}} +\author{ Gregory R. Warnes \email{gr...@wa...}} \seealso{ \code{\link{lm}}, \code{\link{contrasts}}, \code{\link{contr.treatment}}, \code{\link{contr.poly}}, Computation and testing of General Linear Hypothesis: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2012-06-28 00:49:12
|
Revision: 1577 http://r-gregmisc.svn.sourceforge.net/r-gregmisc/?rev=1577&view=rev Author: warnes Date: 2012-06-28 00:49:06 +0000 (Thu, 28 Jun 2012) Log Message: ----------- Update for gmodels version 2.15.3. Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/inst/NEWS Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2012-06-28 00:47:23 UTC (rev 1576) +++ trunk/gmodels/DESCRIPTION 2012-06-28 00:49:06 UTC (rev 1577) @@ -1,6 +1,6 @@ Package: gmodels -Version: 2.15.2 -Date: 2012-04-19 +Version: 2.15.3 +Date: 2012-06-27 Title: Various R programming tools for model fitting Author: Gregory R. Warnes. Includes R source code and/or documentation contributed by Ben Bolker, Thomas Lumley, and Randall C @@ -11,7 +11,7 @@ Maintainer: Gregory R. Warnes <gr...@wa...> Description: Various R programming tools for model fitting Depends: R (>= 1.9.0) -Suggests: gplots, gtools, Matrix, nlme, lme4 +Suggests: gplots, gtools, Matrix, nlme, lme4 (>= 0.999999-0) Imports: MASS, gdata License: GPL-2 URL: http://cran.r-project.org/src/contrib/PACKAGES.html Modified: trunk/gmodels/inst/NEWS =================================================================== --- trunk/gmodels/inst/NEWS 2012-06-28 00:47:23 UTC (rev 1576) +++ trunk/gmodels/inst/NEWS 2012-06-28 00:49:06 UTC (rev 1577) @@ -1,3 +1,12 @@ +Version 2.15.3 - 2012-06-27 +--------------------------- + +Bug fixes: + +- Update est.mer() to work with "mer" object changes introduced in + lme4 version 0.999999-0. + + Version 2.15.2 - 2012-04-19 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-15 18:13:15
|
Revision: 1706 http://sourceforge.net/p/r-gregmisc/code/1706 Author: warnes Date: 2013-07-15 18:13:11 +0000 (Mon, 15 Jul 2013) Log Message: ----------- Remove unused argument to ci.mer Modified Paths: -------------- trunk/gmodels/R/ci.R trunk/gmodels/man/ci.Rd Modified: trunk/gmodels/R/ci.R =================================================================== --- trunk/gmodels/R/ci.R 2013-07-07 00:11:06 UTC (rev 1705) +++ trunk/gmodels/R/ci.R 2013-07-15 18:13:11 UTC (rev 1706) @@ -71,7 +71,6 @@ ci.mer <- function (x, confidence = 0.95, alpha = 1 - confidence, - sim.mer = TRUE, n.sim = 1e4, ...) { Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2013-07-07 00:11:06 UTC (rev 1705) +++ trunk/gmodels/man/ci.Rd 2013-07-15 18:13:11 UTC (rev 1706) @@ -19,8 +19,7 @@ \method{ci}{binom}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lm}(x, confidence = 0.95, alpha = 1 - confidence,...) \method{ci}{lme}(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{mer}(x, confidence = 0.95, alpha = 1 - confidence, - sim.mer=TRUE, n.sim=10000, ...) + \method{ci}{mer}(x, confidence = 0.95, alpha = 1 - confidence, n.sim=10000, ...) } \arguments{ \item{x}{ object from which to compute confidence intervals. } @@ -29,9 +28,6 @@ \item{na.rm}{boolean indicating whether missing values should be removed. Defaults to \code{FALSE}.} \item{\dots}{Arguments for methods} - \item{sim.mer}{Logical value. If TRUE confidence - intervals will be estimated using \code{mcmcsamp}. This option only takes effect for mer - objects.} \item{n.sim}{Number of samples to take in \code{mcmcsamp}.} } %\details{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-18 13:46:04
|
Revision: 1707 http://sourceforge.net/p/r-gregmisc/code/1707 Author: warnes Date: 2013-07-18 13:46:00 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Correct bug in estimable.mlm Modified Paths: -------------- trunk/gmodels/R/estimable.mlm.R Added Paths: ----------- trunk/gmodels/test/test_estimable_mlm.R Modified: trunk/gmodels/R/estimable.mlm.R =================================================================== --- trunk/gmodels/R/estimable.mlm.R 2013-07-15 18:13:11 UTC (rev 1706) +++ trunk/gmodels/R/estimable.mlm.R 2013-07-18 13:46:00 UTC (rev 1707) @@ -1,28 +1,28 @@ `estimable.mlm` <- function (obj, cm, beta0, conf.int=NULL, show.beta0, ...) { - coef <- coef(object) + coef <- coef(obj) ny <- ncol(coef) - effects <- object$effects - resid <- object$residuals - fitted <- object$fitted + effects <- obj$effects + resid <- obj$residuals + fitted <- obj$fitted ynames <- colnames(coef) if (is.null(ynames)) { - lhs <- object$terms[[2]] + lhs <- obj$terms[[2]] if (mode(lhs) == "call" && lhs[[1]] == "cbind") ynames <- as.character(lhs)[-1] else ynames <- paste("Y", seq(ny), sep = "") } value <- vector("list", ny) names(value) <- paste("Response", ynames) - cl <- oldClass(object) - class(object) <- cl[match("mlm", cl):length(cl)][-1] + cl <- oldClass(obj) + class(obj) <- cl[match("mlm", cl):length(cl)][-1] for (i in seq(ny)) { - object$coefficients <- coef[, i] - object$residuals <- resid[, i] - object$fitted.values <- fitted[, i] - object$effects <- effects[, i] - object$call$formula[[2]] <- object$terms[[2]] <- as.name(ynames[i]) + obj$coefficients <- coef[, i] + obj$residuals <- resid[, i] + obj$fitted.values <- fitted[, i] + obj$effects <- effects[, i] + obj$call$formula[[2]] <- obj$terms[[2]] <- as.name(ynames[i]) value[[i]] <- estimable(obj, cm, beta0, conf.int=NULL, show.beta0, ...) } class(value) <- "listof" Added: trunk/gmodels/test/test_estimable_mlm.R =================================================================== --- trunk/gmodels/test/test_estimable_mlm.R (rev 0) +++ trunk/gmodels/test/test_estimable_mlm.R 2013-07-18 13:46:00 UTC (rev 1707) @@ -0,0 +1,15 @@ +library(gmodels) + +y <- cbind(rnorm(100), rnorm(100)) + +x1 <- rnorm(100) +x2 <- rnorm(100) + +cm <- t(matrix(c(0, 1,-1))) +lm.1 <- lm(y ~ x1 + x2) + +estimable(lm.1, cm) + +## >> Error in coef(object) : object 'object' not found + +gmodels:::estimable.mlm(lm.1, cm) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-18 13:57:29
|
Revision: 1709 http://sourceforge.net/p/r-gregmisc/code/1709 Author: warnes Date: 2013-07-18 13:57:26 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Update for gmodels 2.15.4 Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/inst/NEWS Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2013-07-18 13:54:31 UTC (rev 1708) +++ trunk/gmodels/DESCRIPTION 2013-07-18 13:57:26 UTC (rev 1709) @@ -1,9 +1,8 @@ Package: gmodels -Version: 2.15.3 -Date: 2012-06-27 +Version: 2.15.4 +Date: 2013-07-18 Title: Various R programming tools for model fitting -Author: Gregory R. Warnes. Includes R source code and/or documentation - contributed by Ben Bolker, Thomas Lumley, and Randall C +Author: Gregory R. Warnes, Ben Bolker, Thomas Lumley, and Randall C Johnson. Contributions from Randall C. Johnson are Copyright (2005) SAIC-Frederick, Inc. Funded by the Intramural Research Program, of the NIH, National Cancer Institute, Center for Modified: trunk/gmodels/inst/NEWS =================================================================== --- trunk/gmodels/inst/NEWS 2013-07-18 13:54:31 UTC (rev 1708) +++ trunk/gmodels/inst/NEWS 2013-07-18 13:57:26 UTC (rev 1709) @@ -1,3 +1,16 @@ +Version 2.15.4 - 2013-07-18 +--------------------------- + +Bug fixes: + +- Correct error in estimable.mlm() that caused it to always fail. Added + test code to prevent future issues. + +Other Changes: + +- Update man page file for ci() to current Rd syntax. + + Version 2.15.3 - 2012-06-27 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2013-07-18 14:09:17
|
Revision: 1710 http://sourceforge.net/p/r-gregmisc/code/1710 Author: warnes Date: 2013-07-18 14:09:14 +0000 (Thu, 18 Jul 2013) Log Message: ----------- Looks like Brian Ripley repackaged for R 3.0.0 and bumped version number, so change it to 2.15.5 Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/inst/NEWS Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2013-07-18 13:57:26 UTC (rev 1709) +++ trunk/gmodels/DESCRIPTION 2013-07-18 14:09:14 UTC (rev 1710) @@ -1,5 +1,5 @@ Package: gmodels -Version: 2.15.4 +Version: 2.15.5 Date: 2013-07-18 Title: Various R programming tools for model fitting Author: Gregory R. Warnes, Ben Bolker, Thomas Lumley, and Randall C @@ -13,6 +13,5 @@ Suggests: gplots, gtools, Matrix, nlme, lme4 (>= 0.999999-0) Imports: MASS, gdata License: GPL-2 -URL: http://cran.r-project.org/src/contrib/PACKAGES.html - http://www.sf.net/projects/r-gregmisc - +URL: http://www.sf.net/projects/r-gregmisc +NeedsCompilation: no Modified: trunk/gmodels/inst/NEWS =================================================================== --- trunk/gmodels/inst/NEWS 2013-07-18 13:57:26 UTC (rev 1709) +++ trunk/gmodels/inst/NEWS 2013-07-18 14:09:14 UTC (rev 1710) @@ -1,4 +1,4 @@ -Version 2.15.4 - 2013-07-18 +Version 2.15.5 - 2013-07-18 --------------------------- Bug fixes: @@ -9,8 +9,8 @@ Other Changes: - Update man page file for ci() to current Rd syntax. +- Remove unused argument to ci.mer() - Version 2.15.3 - 2012-06-27 --------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <wa...@us...> - 2014-07-24 15:14:33
|
Revision: 1868 http://sourceforge.net/p/r-gregmisc/code/1868 Author: warnes Date: 2014-07-24 15:14:30 +0000 (Thu, 24 Jul 2014) Log Message: ----------- - Estimable now adds the class 'estimable' to returned objects. - New ci() method for estimable objects. - Minor improvemets to man page formatting. Modified Paths: -------------- trunk/gmodels/DESCRIPTION trunk/gmodels/NAMESPACE trunk/gmodels/R/ci.R trunk/gmodels/R/estimable.R trunk/gmodels/man/ci.Rd trunk/gmodels/man/estimable.Rd Modified: trunk/gmodels/DESCRIPTION =================================================================== --- trunk/gmodels/DESCRIPTION 2014-07-22 15:07:54 UTC (rev 1867) +++ trunk/gmodels/DESCRIPTION 2014-07-24 15:14:30 UTC (rev 1868) @@ -1,6 +1,6 @@ Package: gmodels -Version: 2.15.5 -Date: 2013-07-18 +Version: 2.16.0 +Date: 2014-07-24 Title: Various R programming tools for model fitting Author: Gregory R. Warnes, Ben Bolker, Thomas Lumley, and Randall C Johnson. Contributions from Randall C. Johnson are Copyright Modified: trunk/gmodels/NAMESPACE =================================================================== --- trunk/gmodels/NAMESPACE 2014-07-22 15:07:54 UTC (rev 1867) +++ trunk/gmodels/NAMESPACE 2014-07-24 15:14:30 UTC (rev 1868) @@ -19,6 +19,7 @@ S3method(ci, lm) S3method(ci, lme) S3method(ci, mer) +S3method(ci, estimable) S3method(fit.contrast, lm) S3method(fit.contrast, lme) Modified: trunk/gmodels/R/ci.R =================================================================== --- trunk/gmodels/R/ci.R 2014-07-22 15:07:54 UTC (rev 1867) +++ trunk/gmodels/R/ci.R 2014-07-24 15:14:30 UTC (rev 1868) @@ -93,3 +93,19 @@ retval } + + +ci.estimable <- function(x,confidence=0.95,alpha=1-confidence,...) + { + ci.low <- x$Estimate + qt(alpha/2, x$DF) * x$"Std. Error" + ci.high <- x$Estimate - qt(alpha/2, x$DF) * x$"Std. Error" + retval <- cbind(Estimate=x$Estimate, + "CI lower"=ci.low, + "CI upper"=ci.high, + "Std. Error"= x$"Std. Error", + "p-value" = x$"Pr(>|t|)" + ) + rownames(retval) <- rownames(x) + + retval + } Modified: trunk/gmodels/R/estimable.R =================================================================== --- trunk/gmodels/R/estimable.R 2014-07-22 15:07:54 UTC (rev 1867) +++ trunk/gmodels/R/estimable.R 2014-07-24 15:14:30 UTC (rev 1868) @@ -161,6 +161,9 @@ rownames(retval) <- make.unique(rownames(retval)) retval <- as.data.frame(retval) if(!show.beta0) retval$beta0 <- NULL + + class(retval) <- c("estimable", class(retval)) + return(retval) } } @@ -273,6 +276,9 @@ rownames(retval) <- make.unique(rownames(retval)) retval <- as.data.frame(retval) if(!show.beta0) retval$beta0 <- NULL + + class(retval) <- c("estimable", class(retval)) + return(retval) } Modified: trunk/gmodels/man/ci.Rd =================================================================== --- trunk/gmodels/man/ci.Rd 2014-07-22 15:07:54 UTC (rev 1867) +++ trunk/gmodels/man/ci.Rd 2014-07-24 15:14:30 UTC (rev 1868) @@ -7,6 +7,7 @@ \alias{ci.lm} \alias{ci.lme} \alias{ci.mer} +\alias{ci.estimable} \title{Compute Confidence Intervals} \description{ Compute and display confidence intervals for model estimates. Methods are provided for the mean of a numeric vector @@ -14,12 +15,13 @@ \code{ci.binom}, and for \code{lm}, \code{lme}, and \code{mer} objects are provided. } \usage{ - ci(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{default}(x, confidence = 0.95, alpha = 1 - confidence, na.rm=FALSE, ...) - \method{ci}{binom}(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{lm}(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{lme}(x, confidence = 0.95, alpha = 1 - confidence,...) - \method{ci}{mer}(x, confidence = 0.95, alpha = 1 - confidence, n.sim=10000, ...) + ci(x, confidence=0.95, alpha=1 - confidence, ...) + \method{ci}{default}(x, confidence=0.95, alpha=1-confidence, na.rm=FALSE, ...) + \method{ci}{binom}(x, confidence=0.95, alpha=1-confidence, ...) + \method{ci}{lm}(x, confidence=0.95, alpha=1-confidence, ...) + \method{ci}{lme}(x, confidence=0.95, alpha=1-confidence, ...) + \method{ci}{mer}(x, confidence=0.95, alpha=1-confidence, n.sim=10000, ...) + \method{ci}{estimable}(x, confidence=0.95, alpha=1-confidence, ...) } \arguments{ \item{x}{ object from which to compute confidence intervals. } Modified: trunk/gmodels/man/estimable.Rd =================================================================== --- trunk/gmodels/man/estimable.Rd 2014-07-22 15:07:54 UTC (rev 1867) +++ trunk/gmodels/man/estimable.Rd 2014-07-24 15:14:30 UTC (rev 1868) @@ -104,7 +104,7 @@ \code{\link[stats]{lm}}, \code{\link[nlme]{lme}}, \code{\link[stats]{contrasts}}, - \code{\link[rms]{contrast.rms}}, + \code{\link[rms]{contrast}} } \examples{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |