From 2239c9ee3676cf595da618936a33ae073f0e398d Mon Sep 17 00:00:00 2001 From: vector-news <86996646+vector-news@users.noreply.github.com> Date: Sat, 4 Jun 2022 13:27:47 -0600 Subject: [PATCH 1/6] Update impact_inference.R --- R/impact_inference.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/impact_inference.R b/R/impact_inference.R index 301b907..bd21657 100644 --- a/R/impact_inference.R +++ b/R/impact_inference.R @@ -226,7 +226,7 @@ CompileSummaryTable <- function(y.post, y.samples.post, # Compile summary statistics summary <- data.frame( Actual = c(mean(y.post), sum(y.post)), - Pred = c(mean(point.pred.mean.post), sum(point.pred.mean.post)), + Pred = c(abs(mean(point.pred.mean.post)), abs(sum(point.pred.mean.post))), Pred.lower = c(quantile(rowMeans(y.samples.post), prob.lower), quantile(rowSums(y.samples.post), prob.lower)), Pred.upper = c(quantile(rowMeans(y.samples.post), prob.upper), From dde9f3b34c9ee2809f61c4ae263965bee63af782 Mon Sep 17 00:00:00 2001 From: vector-news <86996646+vector-news@users.noreply.github.com> Date: Sun, 5 Jun 2022 11:01:09 -0600 Subject: [PATCH 2/6] Update impact_inference.R --- R/impact_inference.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/impact_inference.R b/R/impact_inference.R index bd21657..913e503 100644 --- a/R/impact_inference.R +++ b/R/impact_inference.R @@ -226,7 +226,7 @@ CompileSummaryTable <- function(y.post, y.samples.post, # Compile summary statistics summary <- data.frame( Actual = c(mean(y.post), sum(y.post)), - Pred = c(abs(mean(point.pred.mean.post)), abs(sum(point.pred.mean.post))), + Pred = c(mean(point.pred.mean.post), abs(sum(point.pred.mean.post))), Pred.lower = c(quantile(rowMeans(y.samples.post), prob.lower), quantile(rowSums(y.samples.post), prob.lower)), Pred.upper = c(quantile(rowMeans(y.samples.post), prob.upper), From 9850411a7e334ced928f9a77174fa1efcd324d05 Mon Sep 17 00:00:00 2001 From: vector-news <86996646+vector-news@users.noreply.github.com> Date: Mon, 6 Jun 2022 05:52:43 -0600 Subject: [PATCH 3/6] Update impact_inference.R --- R/impact_inference.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/impact_inference.R b/R/impact_inference.R index 913e503..301b907 100644 --- a/R/impact_inference.R +++ b/R/impact_inference.R @@ -226,7 +226,7 @@ CompileSummaryTable <- function(y.post, y.samples.post, # Compile summary statistics summary <- data.frame( Actual = c(mean(y.post), sum(y.post)), - Pred = c(mean(point.pred.mean.post), abs(sum(point.pred.mean.post))), + Pred = c(mean(point.pred.mean.post), sum(point.pred.mean.post)), Pred.lower = c(quantile(rowMeans(y.samples.post), prob.lower), quantile(rowSums(y.samples.post), prob.lower)), Pred.upper = c(quantile(rowMeans(y.samples.post), prob.upper), From a1794c4c336eb6aa6395dff159d13e4939715dfd Mon Sep 17 00:00:00 2001 From: vector-news <86996646+vector-news@users.noreply.github.com> Date: Mon, 6 Jun 2022 07:20:52 -0600 Subject: [PATCH 4/6] Update impact_inference.R --- R/impact_inference.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/impact_inference.R b/R/impact_inference.R index 301b907..4a38abc 100644 --- a/R/impact_inference.R +++ b/R/impact_inference.R @@ -226,7 +226,7 @@ CompileSummaryTable <- function(y.post, y.samples.post, # Compile summary statistics summary <- data.frame( Actual = c(mean(y.post), sum(y.post)), - Pred = c(mean(point.pred.mean.post), sum(point.pred.mean.post)), + Pred = c(mean(abs(point.pred.mean.post)), sum(abs(point.pred.mean.post))), Pred.lower = c(quantile(rowMeans(y.samples.post), prob.lower), quantile(rowSums(y.samples.post), prob.lower)), Pred.upper = c(quantile(rowMeans(y.samples.post), prob.upper), From 05f85b5bf21606e6db5488d14249543924e4f2ad Mon Sep 17 00:00:00 2001 From: vector-news <86996646+vector-news@users.noreply.github.com> Date: Mon, 6 Jun 2022 07:25:41 -0600 Subject: [PATCH 5/6] Update impact_inference.R --- R/impact_inference.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/impact_inference.R b/R/impact_inference.R index 4a38abc..d4ec353 100644 --- a/R/impact_inference.R +++ b/R/impact_inference.R @@ -226,7 +226,7 @@ CompileSummaryTable <- function(y.post, y.samples.post, # Compile summary statistics summary <- data.frame( Actual = c(mean(y.post), sum(y.post)), - Pred = c(mean(abs(point.pred.mean.post)), sum(abs(point.pred.mean.post))), + Pred = c(mean(point.pred.mean.post), sum(abs(point.pred.mean.post))), Pred.lower = c(quantile(rowMeans(y.samples.post), prob.lower), quantile(rowSums(y.samples.post), prob.lower)), Pred.upper = c(quantile(rowMeans(y.samples.post), prob.upper), From 65e346769ce51f4018da422a66f3e9294dac7027 Mon Sep 17 00:00:00 2001 From: vector-news <86996646+vector-news@users.noreply.github.com> Date: Mon, 6 Jun 2022 07:28:52 -0600 Subject: [PATCH 6/6] Update impact_inference.R --- R/impact_inference.R | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/R/impact_inference.R b/R/impact_inference.R index d4ec353..4d4ffbb 100644 --- a/R/impact_inference.R +++ b/R/impact_inference.R @@ -226,7 +226,7 @@ CompileSummaryTable <- function(y.post, y.samples.post, # Compile summary statistics summary <- data.frame( Actual = c(mean(y.post), sum(y.post)), - Pred = c(mean(point.pred.mean.post), sum(abs(point.pred.mean.post))), + Pred = c(mean(point.pred.mean.post), sum(point.pred.mean.post)), Pred.lower = c(quantile(rowMeans(y.samples.post), prob.lower), quantile(rowSums(y.samples.post), prob.lower)), Pred.upper = c(quantile(rowMeans(y.samples.post), prob.upper), @@ -246,10 +246,10 @@ CompileSummaryTable <- function(y.post, y.samples.post, AbsEffect.sd = c(sd(rowMeans(y.repmat.post - y.samples.post)), sd(rowSums(y.repmat.post - y.samples.post)))) summary <- dplyr::mutate(summary, - RelEffect = AbsEffect / Pred, - RelEffect.lower = AbsEffect.lower / Pred, - RelEffect.upper = AbsEffect.upper / Pred, - RelEffect.sd = AbsEffect.sd / Pred) + RelEffect = AbsEffect / abs(Pred), + RelEffect.lower = AbsEffect.lower / abs(Pred), + RelEffect.upper = AbsEffect.upper / abs(Pred), + RelEffect.sd = AbsEffect.sd / abs(Pred)) rownames(summary) <- c("Average", "Cumulative") # Add interval coverage, defined by alpha