From noreply at r-forge.r-project.org Tue Jul 14 11:52:01 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 14 Jul 2015 11:52:01 +0200 (CEST) Subject: [Dplr-commits] r997 - in pkg/dplR: R man Message-ID: <20150714095201.C9B4C1876D6@r-forge.r-project.org> Author: zang Date: 2015-07-14 11:52:01 +0200 (Tue, 14 Jul 2015) New Revision: 997 Modified: pkg/dplR/R/sea.R pkg/dplR/man/sea.Rd Log: updated sea() to return bootstrapped CIs Modified: pkg/dplR/R/sea.R =================================================================== --- pkg/dplR/R/sea.R 2015-06-04 21:46:43 UTC (rev 996) +++ pkg/dplR/R/sea.R 2015-07-14 09:52:01 UTC (rev 997) @@ -36,13 +36,18 @@ rand.key <- sample(rnames, n, replace = TRUE) for (i in seq.n) { re.subtable[i, ] <- - x.scaled[as.character(rand.key[i] + yrs.base), ] + x.scaled[as.character(rand.key[i] + yrs.base), ] } re.table[k, ] <- colMeans(re.subtable, na.rm = TRUE) } ## calculate significance for each (lagged) year + ## compute confidence bands, too p <- rep(NA_real_, m) w <- resample + ci_pos <- floor(resample * c(0.025, 0.975, 0.005, 0.995)) + ci <- apply(apply(re.table, 2, sort), 2, function(x) { + x[ci_pos] + }) for (i in seq_len(m)) { if (is.na(se[i])) { warning(gettextf("NA result at position %d. ", i), @@ -70,5 +75,12 @@ } } } - data.frame(lag = c(-lag:lag), se, se.unscaled, p) + data.frame(lag = c(-lag:lag), + se.unscaled, + p, + se.scaled = se, + ci.95.lower = ci[1,], + ci.95.upper = ci[2,], + ci.99.lower = ci[3,], + ci.99.upper = ci[4,]) } Modified: pkg/dplR/man/sea.Rd =================================================================== --- pkg/dplR/man/sea.Rd 2015-06-04 21:46:43 UTC (rev 996) +++ pkg/dplR/man/sea.Rd 2015-07-14 09:52:01 UTC (rev 997) @@ -40,12 +40,16 @@ \value{ A \code{data.frame} with \item{lag}{the lagged years,} - \item{se}{the superposed epoch, i.e. the scaled mean \acronym{RWI} for - the event years,} \item{se.unscaled}{the unscaled superposed epoch, i.e. the mean \acronym{RWI} for the event years,} \item{p}{significance of the departure from the chrono\enc{?}{'}s mean - \acronym{RWI}.} + \acronym{RWI},} + \item{se.scaled}{the superposed epoch, i.e. the scaled mean \acronym{RWI} for + the event years,} + \item{ci.95.lower}{lower 95\% confidence band,} + \item{ci.95.upper}{upper 95\% confidence band,} + \item{ci.99.lower}{lower 99\% confidence band,} + \item{ci.99.upper}{upper 99\% confidence band.} } \author{ Christian Zang. Patched and improved by Mikko Korpela. } From noreply at r-forge.r-project.org Mon Jul 20 12:05:56 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 20 Jul 2015 12:05:56 +0200 (CEST) Subject: [Dplr-commits] r998 - pkg/dplR Message-ID: <20150720100556.7BF971874AD@r-forge.r-project.org> Author: mvkorpel Date: 2015-07-20 12:05:56 +0200 (Mon, 20 Jul 2015) New Revision: 998 Modified: pkg/dplR/ChangeLog pkg/dplR/DESCRIPTION Log: Added sea() updates to ChangeLog, adjusted package date in DESCRIPTION. Modified: pkg/dplR/ChangeLog =================================================================== --- pkg/dplR/ChangeLog 2015-07-14 09:52:01 UTC (rev 997) +++ pkg/dplR/ChangeLog 2015-07-20 10:05:56 UTC (rev 998) @@ -1,5 +1,9 @@ * CHANGES IN dplR VERSION 1.6.4 +File: sea.R +----------- +- Updated sea() to return bootstrapped CIs. + File: treeMean.R ------------- - Made a new function to calculate the mean value of each tree when there are @@ -46,7 +50,7 @@ - Removed one of the URLs in the URL field. BDR sent and email saying that having two URLs was breaking R and that we should put a comma in betwixt them. But the comma is problematic as it is a valid part of some URLs. - We deicded the better part of valor was to keep only one URL and not fight + We decided the better part of valor was to keep only one URL and not fight this particular battle. File: NAMESPACE Modified: pkg/dplR/DESCRIPTION =================================================================== --- pkg/dplR/DESCRIPTION 2015-07-14 09:52:01 UTC (rev 997) +++ pkg/dplR/DESCRIPTION 2015-07-20 10:05:56 UTC (rev 998) @@ -3,7 +3,7 @@ Type: Package Title: Dendrochronology Program Library in R Version: 1.6.4 -Date: 2015-06-03 +Date: 2015-07-20 Authors at R: c(person("Andy", "Bunn", role = c("aut", "cph", "cre", "trl"), email = "andy.bunn at wwu.edu"), person("Mikko", "Korpela", role = c("aut", "trl")), person("Franco", "Biondi", From noreply at r-forge.r-project.org Tue Jul 21 12:16:47 2015 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 21 Jul 2015 12:16:47 +0200 (CEST) Subject: [Dplr-commits] r999 - in pkg/dplR: R man Message-ID: <20150721101647.60739185327@r-forge.r-project.org> Author: zang Date: 2015-07-21 12:16:46 +0200 (Tue, 21 Jul 2015) New Revision: 999 Modified: pkg/dplR/R/sea.R pkg/dplR/man/sea.Rd Log: fixed ordering of elements in return value of sea(); updated docs Modified: pkg/dplR/R/sea.R =================================================================== --- pkg/dplR/R/sea.R 2015-07-20 10:05:56 UTC (rev 998) +++ pkg/dplR/R/sea.R 2015-07-21 10:16:46 UTC (rev 999) @@ -76,9 +76,9 @@ } } data.frame(lag = c(-lag:lag), + se, se.unscaled, p, - se.scaled = se, ci.95.lower = ci[1,], ci.95.upper = ci[2,], ci.99.lower = ci[3,], Modified: pkg/dplR/man/sea.Rd =================================================================== --- pkg/dplR/man/sea.Rd 2015-07-20 10:05:56 UTC (rev 998) +++ pkg/dplR/man/sea.Rd 2015-07-21 10:16:46 UTC (rev 999) @@ -25,7 +25,7 @@ } \details{ - Superposed epoch analysis is used to test the significance of a mean + Superposed epoch analysis (SEA) is used to test the significance of a mean tree growth response to certain events (such as droughts). Departures from the mean \acronym{RWI} values for the specified years prior to each event year, the event year, and the specified years immediately @@ -35,17 +35,21 @@ resampling is used to randomly select sets of \code{\var{lag}+1} years from the data set and to estimate significances for the departures from the mean \acronym{RWI}. + + SEA computation is based on scaled \acronym{RWI} values, and + 95\%-confidence intervals are computed for the scaled values for each + year in the superposed epoch. } \value{ A \code{data.frame} with \item{lag}{the lagged years,} + \item{se}{the superposed epoch, i.e. the scaled mean \acronym{RWI} for + the event years,} \item{se.unscaled}{the unscaled superposed epoch, i.e. the mean \acronym{RWI} for the event years,} \item{p}{significance of the departure from the chrono\enc{?}{'}s mean \acronym{RWI},} - \item{se.scaled}{the superposed epoch, i.e. the scaled mean \acronym{RWI} for - the event years,} \item{ci.95.lower}{lower 95\% confidence band,} \item{ci.95.upper}{upper 95\% confidence band,} \item{ci.99.lower}{lower 99\% confidence band,}