diff --git a/paper/.~lock.weGotThePowerDraftPaper.html# b/paper/.~lock.weGotThePowerDraftPaper.html# new file mode 100644 index 0000000000000000000000000000000000000000..045d4752318981bcc5e642447272d0850a8de33e --- /dev/null +++ b/paper/.~lock.weGotThePowerDraftPaper.html# @@ -0,0 +1 @@ +Ben Anderson,ben,ou029107.otago.ac.nz,15.11.2018 14:52,file:///Users/ben/Library/Application%20Support/LibreOffice/4; \ No newline at end of file diff --git a/paper/figs/statPowerEsts80means_All.png b/paper/figs/statPowerEsts80means_All.png index c0ac3a35645a1e788dd417c13d47f691c32e9339..4b491349d9bdb5abf42708bc04d7ad35704404fa 100644 Binary files a/paper/figs/statPowerEsts80means_All.png and b/paper/figs/statPowerEsts80means_All.png differ diff --git a/paper/figs/statPowerEsts80means_p0.01.png b/paper/figs/statPowerEsts80means_p0.01.png index 64bf64b4592b697c415c5dd2f24ca978619789e5..bb346f2ecf4ce7e104be980bcadf3f5d50b0ac49 100644 Binary files a/paper/figs/statPowerEsts80means_p0.01.png and b/paper/figs/statPowerEsts80means_p0.01.png differ diff --git a/paper/weGotThePowerDraftPaper.Rmd b/paper/weGotThePowerDraftPaper.Rmd index ccc7293e3672afbddda2c44478f38c05ab7b3944..52fd26341d00b217c6e0063b323e607628c10f82 100644 --- a/paper/weGotThePowerDraftPaper.Rmd +++ b/paper/weGotThePowerDraftPaper.Rmd @@ -51,6 +51,7 @@ rmdLibs <- c("data.table", # data munching "dkUtils", # utilities from devtools::install_github("dataknut/dkUtils") "forcats", # category manipulation "pwr", # power stuff + "GREENGridData", # GREEN grid data loading etc from devtools::install_github("cfsOtago/GREENGridData") "knitr" # for kable ) # load them @@ -73,11 +74,13 @@ labelProfilePlot <- function(plot){ myParams <- list() myParams$repoLoc <- dkUtils::findParentDirectory("weGotThePower") -myParams$dPath <- "~/Dropbox/Work/Otago_CfS_Ben/data/nzGREENGrid/dataExtracts/" +myParams$dPath <- "~/Dropbox/Work/Otago_CfS_Ben/data/nzGREENGrid/" #myParams$dPath <- "~/Data/NZ_GREENGrid/safe/gridSpy/1min/dataExtracts/" # created from https://dx.doi.org/10.5255/UKDA-SN-853334 # using https://github.com/CfSOtago/GREENGridData/blob/master/examples/code/extractCleanGridSpy1minCircuit.R -heatPumpData <- paste0(myParams$dPath, "Heat Pump_2015-04-01_2016-03-31_observations.csv.gz") +heatPumpData <- paste0(myParams$dPath, "dataExtracts/Heat Pump_2015-04-01_2016-03-31_observations.csv.gz") +ggHHData <- paste0(myParams$dPath, "ggHouseholdAttributesSafe.csv") + myParams$GGDataDOI <- "https://dx.doi.org/10.5255/UKDA-SN-853334" plotCaption <- paste0("Source: ", myParams$GGDataDOI) @@ -142,41 +145,93 @@ This report contains the analysis for a paper of the same name. The text is stor # Load GREEN Grid Heat Pump data if(file.exists(heatPumpData)){ message("Loading: ", heatPumpData ) - dt <- data.table::as.data.table(readr::read_csv(heatPumpData, progress = TRUE)) + gsDT <- GREENGridData::getCleanGridSpyFile(heatPumpData) # load Grid Spy data cleanly, throws a warning about missing fields/columns + # dt <- data.table::as.data.table(readr::read_csv(heatPumpData, + # progress = FALSE, + # col_types = list(col_character(), # hhid + # col_character(), # linkID + # col_datetime(format = ""), # dateTime + # col_character(), # circuit + # col_double()) # power + # ) + # ) } else { message("No such file: ", heatPumpData ) stop() } -dt <- dt[, month := lubridate::month(r_dateTime)] -dt <- dt[, year := lubridate::year(r_dateTime)] +gst <- summary(gsDT) + +gsDT <- gsDT[, month := lubridate::month(r_dateTime)] +gsDT <- gsDT[, year := lubridate::year(r_dateTime)] # add southern hemisphere season -dt <- dt[, tmpM := lubridate::month(r_dateTime)] # sets 1 (Jan) - 12 (Dec). May already exist but we can't rely on it -dt <- dt[, season := "Summer"] # easiest to set the default to be the one that bridges years -dt <- dt[tmpM >= 3 & tmpM <= 5, season := "Autumn"] -dt <- dt[tmpM >= 6 & tmpM <= 8 , season := "Winter"] -dt <- dt[tmpM >= 9 & tmpM <= 11, season := "Spring"] +gsDT <- gsDT[, tmpM := lubridate::month(r_dateTime)] # sets 1 (Jan) - 12 (Dec). May already exist but we can't rely on it +gsDT <- gsDT[, season := "Summer"] # easiest to set the default to be the one that bridges years +gsDT <- gsDT[tmpM >= 3 & tmpM <= 5, season := "Autumn"] +gsDT <- gsDT[tmpM >= 6 & tmpM <= 8 , season := "Winter"] +gsDT <- gsDT[tmpM >= 9 & tmpM <= 11, season := "Spring"] # re-order to make sense -dt <- dt[, season := factor(season, levels = c("Spring", "Summer", "Autumn", "Winter"))] +gsDT <- gsDT[, season := factor(season, levels = c("Spring", "Summer", "Autumn", "Winter"))] + +# Load GREEN Grid household data +if(file.exists(ggHHData)){ + message("Loading: ", ggHHData ) + hhDT <- data.table::as.data.table(readr::read_csv(ggHHData)) +} else { + message("No such file: ", ggHHData ) + stop() +} + +knitr::kable(caption = "Summary of grid spy data", gst) + +# there are negawatts! +gsDT <- gsDT[, negW := "PosW"] +gsDT <- gsDT[ powerW < 0, negW := "NegaW"] + +t <- table(gsDT$linkID,gsDT$negW) +t +prop.table(t) + ``` ```{r dataPrep} -testDT <- dt[lubridate::hour(r_dateTime) > 15 & # 16:00 -> + +hhDT <- hhDT[Q57 == 1, nPeople := "1"] +hhDT <- hhDT[Q57 == 2, nPeople := "2"] +hhDT <- hhDT[Q57 == 3, nPeople := "3"] +hhDT <- hhDT[Q57 > 3, nPeople := "4+"] + + +setkey(hhDT, linkID) + +testDT <- gsDT[lubridate::hour(r_dateTime) > 15 & # 16:00 -> lubridate::hour(r_dateTime) < 20 & # <- 20:00 lubridate::wday(r_dateTime) != 6 & # not Saturday lubridate::wday(r_dateTime) != 7 & # not Sunday - year == 2015, + year == 2015 & negW == "PosW", # remove the negawatts (see https://github.com/CfSOtago/GREENGridData/issues/6) .(meanW = mean(powerW, na.rm = TRUE), sdW = sd(powerW, na.rm = TRUE)), keyby = .(season, linkID)] +setkey(testDT, linkID) +linkedTestDT <- hhDT[testDT] + -testTable <- testDT[, .(meanMeanW = mean(meanW), - sdMeanW = sd(meanW)), keyby = .(season)] +testTable <- linkedTestDT[, .(meanMeanW = mean(meanW), + sdMeanW = sd(meanW), + nHouseholds = .N), keyby = .(season, nPeople)] knitr::kable(caption = "Summary of mean consumption per household by season", testTable) -ggplot2::ggplot(testDT, aes(y = meanW, x = fct_reorder(linkID, meanW, .desc = TRUE), colour = season)) + - geom_point() +testTable <- linkedTestDT[season == "Winter", .(meanMeanW = mean(meanW), + sdMeanW = sd(meanW), + nHouseholds = .N)] + +knitr::kable(caption = "Summary of mean consumption per household in winter", testTable) + +# plot distn +ggplot2::ggplot(linkedTestDT, aes(y = meanW, x = fct_reorder(linkID, meanW, .desc = TRUE), colour = nPeople)) + + geom_point() + + facet_wrap(. ~ season) ``` Observations are summarised to mean W per household during 16:00 - 20:00 on weekdays for year = 2015. @@ -186,8 +241,9 @@ Observations are summarised to mean W per household during 16:00 - 20:00 on week testSamples <- seq(50,3000,50) testPower <- 0.8 -testMean <- mean(testDT[season == "Winter"]$meanW) -testSD <- sd(testDT[season == "Winter"]$meanW) +# overall mean +testMean <- mean(linkedTestDT[season == "Winter"]$meanW) +testSD <- sd(linkedTestDT[season == "Winter"]$meanW) # use package function meansPowerDT <- weGotThePower::estimateMeanEffectSizes(testMean,testSD,testSamples,testPower) # auto-produces range of p values @@ -260,7 +316,7 @@ p <- p + labs(caption = myCaption) + p <- p + geom_hline(yintercept = y001, colour = "red") + geom_segment(x = x001, y = y001, xend = x001, yend = 0, alpha = vLineAlpha, - colour = cbPalette[2]) + colour = cbPalette[1]) p <- p + annotate(geom = "text", @@ -269,13 +325,6 @@ p <- p + label = paste0("Effect size = ", round(y001, 2) ,"% with \n p = 0.01, power = 0.8 and n = 1000"), hjust = 0) # https://stackoverflow.com/questions/26684023/how-to-left-align-text-in-annotate-from-ggplot2 -# add vline at 0.01 effect size for p = 0.01, n = 1000 -p001Ref <- meansPowerDT[pValue == "p = 0.01" & - effectSize < ceiling(p001Ref$effectSize) & - effectSize > floor(p001Ref$effectSize)] # for reference line -x001 <- mean(p001Ref$sampleN) -p <- p + geom_segment(x = x001, y = y001, xend = x001, yend = 0, alpha = vLineAlpha, - colour = cbPalette[1]) # add vline at 0.05 effect size for p = 0.01, n = 1000 p005Ref <- meansPowerDT[pValue == "p = 0.05" & @@ -295,8 +344,8 @@ p <- p + geom_segment(x = x01, y = y001, xend = x01, yend = 0, alpha = vLineAlp # add vline at 0.2 effect size for p = 0.01, n = 1000 p02Ref <- meansPowerDT[pValue == "p = 0.2" & - effectSize < ceiling(p001Ref$effectSize+2) & - effectSize > floor(p001Ref$effectSize-2)] # for reference line + effectSize < ceiling(p001Ref$effectSize) & + effectSize > floor(p001Ref$effectSize)] # for reference line x02 <- mean(p02Ref$sampleN) p <- p + geom_segment(x = x02, y = y001, xend = x02, yend = 0, alpha = vLineAlpha, colour = cbPalette[4]) @@ -305,6 +354,13 @@ p ggplot2::ggsave("figs/statPowerEsts80means_All.png", p) ``` +At same effect size (`r y001`%, n = 1000, p = 0.01): + + * p = 0.05, n = `r x005` + * p = 0.1, n = `r x01` + * p = 0.2, n = `r x02` + + Full table of results: ```{r meansPowerTable} @@ -390,44 +446,50 @@ This may be far too wide an error margin for our purposes so we may instead have ## Getting it 'wrong' +Use base GREENGrid and number of people but re-sample slightly. - +> NB: we create a small sample roughly 2 * the size of the GREEN Grid data. Due to small numbers and the random re-sampling with replacement process, there will be random fluctuations in the results with each run. As a result the results in this section will probably not match the results in the paper... ```{r smallNTable} -# mimic an intervention using seasons -testDT <- testDT[season == "Winter", group := "Control"] -testDT <- testDT[season == "Spring", group := "Intervention 1"] -testDT <- testDT[season == "Summer", group := "Intervention 2"] -testDT <- testDT[season == "Autumn", group := "Intervention 3"] -t <- testDT[, .("mean W" = mean(meanW), +# group will be NA where we have no survey data +# select just wnter +linkedTestDT <- linkedTestDT[season == "Winter" & !is.na(nPeople)] + +# create small sample - be warned, this is a random process so you will get different results each time you run it + +smallTestDT <- sample_frac(linkedTestDT, 2, replace = TRUE) + +t <- smallTestDT[, .("mean W" = mean(meanW), "sd W" = sd(meanW), "n households" = .N), - keyby = .(group)] + keyby = .(nPeople)] -knitr::kable(t, caption = "Number of households and summary statistics per group") +knitr::kable(t, caption = "Number of households and summary statistics per group (winter heat pump use)") ``` +So a sample of `r nrow(smallTestDT)`. + ```{r ggMeanDiffs, fig.caption = "Mean W demand per group (Error bars = 95% confidence intervals for the sample mean)"} -plotDT <- testDT[, .(meanW = mean(meanW), +plotDT <- smallTestDT[, .(meanW = mean(meanW), sdW = sd(meanW), nObs = .N), - keyby = .(group) + keyby = .(nPeople) ] -myCaption <- paste0("Hypothetical small n sample", +myCaption <- paste0("Hypothetical (very) small n sample", "\nStatistic: mean W, weekdays 16:00 - 20:00") makeMeanCIPlot <- function(dt){ # makes the plot, assumes meanW & sdW - not flexible but it does the job dt <- dt[, ci_upper := meanW + (qnorm(0.975) * sdW/sqrt(nObs))] dt <- dt[, ci_lower := meanW - (qnorm(0.975) * sdW/sqrt(nObs))] - p <- ggplot2::ggplot(dt, aes(x = group, y = meanW, fill = group)) + + p <- ggplot2::ggplot(dt, aes(x = nPeople, y = meanW, fill = nPeople)) + geom_col() + geom_errorbar(aes(ymin = ci_lower, ymax = ci_upper), width = 0.25) + guides(fill = guide_legend(title = "Group")) + labs(y = "Mean W", - x = "Trial group", + x = "N people in household", caption = myCaption) return(p) } @@ -436,21 +498,21 @@ makeMeanCIPlot(plotDT) ``` -T test group 1 +T test 1 <-> 3 ```{r tTestTabG1} # fix # we are going to compare winter with summer to get a large effect. This is not what we would really do as it is a repeat measures dataset but this is irrelevant for our current purposes. -tTest <- t.test(testDT[group == "Intervention 1"]$meanW, testDT[group == "Control"]$meanW) +tTest <- t.test(smallTestDT[nPeople == "1"]$meanW, smallTestDT[nPeople == "3"]$meanW) tTestTidy <- broom::tidy(tTest) -tTestTidy$`Control mean` <- tTestTidy$estimate2 -tTestTidy$`Intervention 1 mean` <- tTestTidy$estimate1 +tTestTidy$`1 person mean` <- tTestTidy$estimate1 +tTestTidy$`3 persons mean` <- tTestTidy$estimate2 tTestTidy$`Mean difference` <- tTestTidy$estimate -knitr::kable(tTestTidy[c("Control mean", "Intervention 1 mean", "Mean difference", - "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (Group 1 vs Control)") +knitr::kable(tTestTidy[c("1 person mean", "3 persons mean", "Mean difference", + "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (1 vs 3)") controlW <- tTest$estimate[[2]] intW <- tTest$estimate[[1]] @@ -465,24 +527,25 @@ The results show that the mean power demand for the control group was `r round(c * 95% confidence interval for the test = `r round(cil,2)` to `r round(ciu,2)` representing _considerable_ uncertainty/variation; * p value of `r round(tTest$p.value,3)` representing a _relatively low_ risk of a false positive result but which (just) fails the conventional p < 0.05 threshold. -T test Group 2 +T test 1 <-> 4+ ```{r tTestTabG2} # fix # now compare winter & spring for a smaller effect -tTest <- t.test(testDT[group == "Intervention 2"]$meanW, testDT[group == "Control"]$meanW) +tTest <- t.test(smallTestDT[nPeople == "1"]$meanW, smallTestDT[nPeople == "4+"]$meanW) tTestTidy <- broom::tidy(tTest) -tTestTidy$`Control mean` <- tTestTidy$estimate2 -tTestTidy$`Intervention 2 mean` <- tTestTidy$estimate1 +tTestTidy$`1 person mean` <- tTestTidy$estimate1 +tTestTidy$`4+ persons mean` <- tTestTidy$estimate2 tTestTidy$`Mean difference` <- tTestTidy$estimate -knitr::kable(tTestTidy[c("Control mean", "Intervention 2 mean", "Mean difference", - "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (Group 2 vs Control)") +knitr::kable(tTestTidy[c("1 person mean", "4+ persons mean", "Mean difference", + "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (1 vs 4+)") controlW <- tTest$estimate[[2]] intW <- tTest$estimate[[1]] + cil <- tTest$conf.int[[1]] ciu <- tTest$conf.int[[2]] ``` @@ -494,43 +557,30 @@ Now: * p value of `r round(tTest$p.value,3)` representing a _higher_ risk of a false positive result which fails the conventional p < 0.05 threshold and also the less conservative p < 0.1. -```{r getN} -# get sample size required for Int Group 2 -sd <- testDT[, sd(meanW)] -result <- power.t.test( - n = NULL, - delta = controlW - intW, - sd = sd, - sig.level = 0.05, - power = 0.8, - alternative = c("one.sided") - ) -``` - -To detect Intervention Group 2's effect size of `r round(100 * (1-(intW/controlW)),2)`% would have required control and trial group sizes of `r round(result$n)` respectively. - - ## Getting it 'right' +> NB: we create a larger sample roughly 40 * the size of the GREEN Grid data. Due to the random re-sampling with replacement process, there will be random fluctuations in the results with each run. As a result the results in this section will probably not exactly match the results in the paper but as the sample is large they should be quite close... ```{r creatLargeN} # fix. # we just randomly re-sample the GREEN Grid data -largeTestDT <- sample_frac(testDT, 40, replace = TRUE) +largeTestDT <- sample_frac(linkedTestDT, 40, replace = TRUE) t <- largeTestDT[, .("mean W" = mean(meanW), "sd W" = sd(meanW), "n households" = .N), - keyby = .(group)] + keyby = .(nPeople)] knitr::kable(t, caption = "Number of households and summary statistics per group") ``` +So n = `r nrow(largeTestDT)` + ```{r largeNmeanDiffs, fig.cap="Mean W demand per group for large sample (Error bars = 95% confidence intervals for the sample mean)"} plotDT <- largeTestDT[, .(meanW = mean(meanW), sdW = sd(meanW), nObs = .N), - keyby = .(group) + keyby = .(nPeople) ] myCaption <- paste0("Hypothetical large n sample", @@ -538,23 +588,24 @@ myCaption <- paste0("Hypothetical large n sample", makeMeanCIPlot(plotDT) ``` -re-run T tests Control vs Group 1 +re-run T tests 1 vs 3 ```{r largeNtTestControl-1} -# now compare winter & spring for a smaller effect -tTest <- t.test(largeTestDT[group == "Control"]$meanW, largeTestDT[group == "Intervention 1"]$meanW) + +tTest <- t.test(largeTestDT[nPeople == "1"]$meanW, largeTestDT[nPeople == "3"]$meanW) tTestTidy <- broom::tidy(tTest) -tTestTidy$`Control mean` <- tTestTidy$estimate1 -tTestTidy$`Intervention 1 mean` <- tTestTidy$estimate2 +tTestTidy$`1 person mean` <- tTestTidy$estimate1 +tTestTidy$`3 persons mean` <- tTestTidy$estimate2 tTestTidy$`Mean difference` <- tTestTidy$estimate -knitr::kable(tTestTidy[c("Control mean", "Intervention 1 mean", "Mean difference", - "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (Intervention 2 vs Control)") +knitr::kable(tTestTidy[c("1 person mean", "3 persons mean", "Mean difference", + "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (1 vs 3)") + +controlW <- tTest$estimate[[2]] +intW <- tTest$estimate[[1]] -controlW <- tTest$estimate[[1]] -intW <- tTest$estimate[[2]] cil <- tTest$conf.int[[1]] ciu <- tTest$conf.int[[2]] ``` @@ -565,23 +616,22 @@ In this case: * 95% confidence interval for the test = `r round(cil,2)` to `r round(ciu,2)` representing _much less_ uncertainty/variation; * p value of `r round(tTest$p.value,4)` representing a _very low_ risk of a false positive result as it passes all conventional thresholds. -re-run T tests Control vs Group 2 +re-run T tests 1 person vs 4+ ```{r largeNtTestControl-2} -# now compare winter & spring for a smaller effect - -tTest <- t.test(largeTestDT[group == "Control"]$meanW, largeTestDT[group == "Intervention 2"]$meanW) +tTest <- t.test(largeTestDT[nPeople == "1"]$meanW, largeTestDT[nPeople == "4+"]$meanW) tTestTidy <- broom::tidy(tTest) -tTestTidy$`Control mean` <- tTestTidy$estimate1 -tTestTidy$`Intervention 2 mean` <- tTestTidy$estimate2 +tTestTidy$`1 person mean` <- tTestTidy$estimate1 +tTestTidy$`4+ persons mean` <- tTestTidy$estimate2 tTestTidy$`Mean difference` <- tTestTidy$estimate -knitr::kable(tTestTidy[c("Control mean", "Intervention 2 mean", "Mean difference", - "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (Intervention 2 vs Control)") +knitr::kable(tTestTidy[c("1 person mean", "4+ persons mean", "Mean difference", + "statistic", "p.value", "conf.low", "conf.high")], caption = "T test results (1 vs 4+)") + +controlW <- tTest$estimate[[2]] +intW <- tTest$estimate[[1]] -controlW <- tTest$estimate[[1]] -intW <- tTest$estimate[[2]] cil <- tTest$conf.int[[1]] ciu <- tTest$conf.int[[2]] ``` diff --git a/paper/weGotThePowerDraftPaper.html b/paper/weGotThePowerDraftPaper.html index 48f310fdd0aeb0b1bc35722d3faa4f42dc1dcfb9..bccb2d44b4febd7e763b3c2963e6c734d4932a5d 100644 --- a/paper/weGotThePowerDraftPaper.html +++ b/paper/weGotThePowerDraftPaper.html @@ -239,7 +239,7 @@ div.tocify { <h1 class="title toc-ignore">Statistical Power, Statistical Significance, Study Design and Decision Making: A Worked Example</h1> <h3 class="subtitle"><em>Sizing Demand Response Trials in New Zealand</em></h3> <h4 class="author"><em>Ben Anderson and Tom Rushby (Contact: <a href="mailto:b.anderson@soton.ac.uk">b.anderson@soton.ac.uk</a>, <code>@dataknut</code>)</em></h4> -<h4 class="date"><em>Last run at: 2018-11-13 13:49:39</em></h4> +<h4 class="date"><em>Last run at: 2018-11-15 14:49:28</em></h4> </div> @@ -301,30 +301,162 @@ div.tocify { <thead> <tr class="header"> <th align="left">season</th> +<th align="left">nPeople</th> <th align="right">meanMeanW</th> <th align="right">sdMeanW</th> +<th align="right">nHouseholds</th> </tr> </thead> <tbody> <tr class="odd"> <td align="left">Spring</td> -<td align="right">58.80597</td> -<td align="right">113.53102</td> +<td align="left">NA</td> +<td align="right">595.994212</td> +<td align="right">443.635765</td> +<td align="right">2</td> +</tr> +<tr class="even"> +<td align="left">Spring</td> +<td align="left">1</td> +<td align="right">92.230234</td> +<td align="right">103.648048</td> +<td align="right">2</td> +</tr> +<tr class="odd"> +<td align="left">Spring</td> +<td align="left">2</td> +<td align="right">89.339624</td> +<td align="right">44.338145</td> +<td align="right">4</td> +</tr> +<tr class="even"> +<td align="left">Spring</td> +<td align="left">3</td> +<td align="right">207.619377</td> +<td align="right">171.401166</td> +<td align="right">7</td> +</tr> +<tr class="odd"> +<td align="left">Spring</td> +<td align="left">4+</td> +<td align="right">175.856103</td> +<td align="right">148.738840</td> +<td align="right">11</td> </tr> <tr class="even"> <td align="left">Summer</td> -<td align="right">35.13947</td> -<td align="right">83.90258</td> +<td align="left">1</td> +<td align="right">4.019881</td> +<td align="right">3.746534</td> +<td align="right">2</td> +</tr> +<tr class="odd"> +<td align="left">Summer</td> +<td align="left">2</td> +<td align="right">35.275766</td> +<td align="right">61.099420</td> +<td align="right">3</td> +</tr> +<tr class="even"> +<td align="left">Summer</td> +<td align="left">3</td> +<td align="right">87.760306</td> +<td align="right">133.023910</td> +<td align="right">7</td> +</tr> +<tr class="odd"> +<td align="left">Summer</td> +<td align="left">4+</td> +<td align="right">33.637416</td> +<td align="right">74.408925</td> +<td align="right">10</td> +</tr> +<tr class="even"> +<td align="left">Autumn</td> +<td align="left">NA</td> +<td align="right">387.203399</td> +<td align="right">316.302379</td> +<td align="right">2</td> </tr> <tr class="odd"> <td align="left">Autumn</td> -<td align="right">68.37439</td> -<td align="right">147.37279</td> +<td align="left">1</td> +<td align="right">70.587984</td> +<td align="right">79.862519</td> +<td align="right">2</td> </tr> <tr class="even"> +<td align="left">Autumn</td> +<td align="left">2</td> +<td align="right">73.233719</td> +<td align="right">56.284769</td> +<td align="right">4</td> +</tr> +<tr class="odd"> +<td align="left">Autumn</td> +<td align="left">3</td> +<td align="right">245.971947</td> +<td align="right">194.352385</td> +<td align="right">8</td> +</tr> +<tr class="even"> +<td align="left">Autumn</td> +<td align="left">4+</td> +<td align="right">199.479290</td> +<td align="right">165.371666</td> +<td align="right">13</td> +</tr> +<tr class="odd"> +<td align="left">Winter</td> +<td align="left">NA</td> +<td align="right">661.964787</td> +<td align="right">275.647550</td> +<td align="right">2</td> +</tr> +<tr class="even"> +<td align="left">Winter</td> +<td align="left">1</td> +<td align="right">169.532436</td> +<td align="right">213.880258</td> +<td align="right">2</td> +</tr> +<tr class="odd"> <td align="left">Winter</td> -<td align="right">162.66915</td> -<td align="right">325.51171</td> +<td align="left">2</td> +<td align="right">282.138922</td> +<td align="right">71.265180</td> +<td align="right">4</td> +</tr> +<tr class="even"> +<td align="left">Winter</td> +<td align="left">3</td> +<td align="right">475.616350</td> +<td align="right">280.427370</td> +<td align="right">8</td> +</tr> +<tr class="odd"> +<td align="left">Winter</td> +<td align="left">4+</td> +<td align="right">413.121623</td> +<td align="right">279.067726</td> +<td align="right">12</td> +</tr> +</tbody> +</table> +<table> +<caption><span id="tab:dataPrep">Table 4.1: </span>Summary of mean consumption per household in winter</caption> +<thead> +<tr class="header"> +<th align="right">meanMeanW</th> +<th align="right">sdMeanW</th> +<th align="right">nHouseholds</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="right">412.6407</td> +<td align="right">264.3291</td> +<td align="right">28</td> </tr> </tbody> </table> @@ -344,7 +476,7 @@ Figure 4.1: Power analysis results (p = 0.01, power = 0.8) </p> </div> <pre><code>## Saving 7 x 5 in image</code></pre> -<p>Effect size at n = 1000: 28.37.</p> +<p>Effect size at n = 1000: 9.08.</p> <p>Figure <a href="#fig:ggHPSampleSizeFig80all">4.2</a> shows the plot for all results.</p> <pre><code>## Scale for 'y' is already present. Adding another scale for 'y', which ## will replace the existing scale.</code></pre> @@ -355,6 +487,12 @@ Figure 4.2: Power analysis results (power = 0.8) </p> </div> <pre><code>## Saving 7 x 5 in image</code></pre> +<p>At same effect size (9.0816159%, n = 1000, p = 0.01):</p> +<ul> +<li>p = 0.05, n = 575</li> +<li>p = 0.1, n = 425</li> +<li>p = 0.2, n = 250</li> +</ul> <p>Full table of results:</p> <pre><code>## Using 'effectSize' as value column. Use 'value.var' to override</code></pre> <table> @@ -371,143 +509,143 @@ Figure 4.2: Power analysis results (power = 0.8) <tbody> <tr class="odd"> <td align="right">50</td> -<td align="right">128.57</td> -<td align="right">100.21</td> -<td align="right">85.33</td> -<td align="right">67.49</td> +<td align="right">41.16</td> +<td align="right">32.08</td> +<td align="right">27.32</td> +<td align="right">21.60</td> </tr> <tr class="even"> <td align="right">100</td> -<td align="right">90.27</td> -<td align="right">70.61</td> -<td align="right">60.21</td> -<td align="right">47.68</td> +<td align="right">28.90</td> +<td align="right">22.60</td> +<td align="right">19.27</td> +<td align="right">15.26</td> </tr> <tr class="odd"> <td align="right">150</td> -<td align="right">73.53</td> -<td align="right">57.58</td> -<td align="right">49.13</td> -<td align="right">38.92</td> +<td align="right">23.54</td> +<td align="right">18.43</td> +<td align="right">15.73</td> +<td align="right">12.46</td> </tr> <tr class="even"> <td align="right">200</td> -<td align="right">63.61</td> -<td align="right">49.84</td> -<td align="right">42.53</td> -<td align="right">33.70</td> +<td align="right">20.36</td> +<td align="right">15.95</td> +<td align="right">13.61</td> +<td align="right">10.79</td> </tr> <tr class="odd"> <td align="right">250</td> -<td align="right">56.86</td> -<td align="right">44.56</td> -<td align="right">38.03</td> -<td align="right">30.14</td> +<td align="right">18.20</td> +<td align="right">14.27</td> +<td align="right">12.17</td> +<td align="right">9.65</td> </tr> <tr class="even"> <td align="right">300</td> -<td align="right">51.88</td> -<td align="right">40.67</td> -<td align="right">34.71</td> -<td align="right">27.51</td> +<td align="right">16.61</td> +<td align="right">13.02</td> +<td align="right">11.11</td> +<td align="right">8.81</td> </tr> <tr class="odd"> <td align="right">350</td> -<td align="right">48.01</td> -<td align="right">37.65</td> -<td align="right">32.14</td> -<td align="right">25.47</td> +<td align="right">15.37</td> +<td align="right">12.05</td> +<td align="right">10.29</td> +<td align="right">8.15</td> </tr> <tr class="even"> <td align="right">400</td> -<td align="right">44.90</td> -<td align="right">35.21</td> -<td align="right">30.06</td> -<td align="right">23.82</td> +<td align="right">14.37</td> +<td align="right">11.27</td> +<td align="right">9.62</td> +<td align="right">7.63</td> </tr> <tr class="odd"> <td align="right">450</td> -<td align="right">42.33</td> -<td align="right">33.20</td> -<td align="right">28.34</td> -<td align="right">22.46</td> +<td align="right">13.55</td> +<td align="right">10.63</td> +<td align="right">9.07</td> +<td align="right">7.19</td> </tr> <tr class="even"> <td align="right">500</td> -<td align="right">40.15</td> -<td align="right">31.49</td> -<td align="right">26.88</td> -<td align="right">21.31</td> +<td align="right">12.85</td> +<td align="right">10.08</td> +<td align="right">8.61</td> +<td align="right">6.82</td> </tr> <tr class="odd"> <td align="right">550</td> -<td align="right">38.27</td> -<td align="right">30.02</td> -<td align="right">25.63</td> -<td align="right">20.31</td> +<td align="right">12.25</td> +<td align="right">9.61</td> +<td align="right">8.20</td> +<td align="right">6.50</td> </tr> <tr class="even"> <td align="right">600</td> -<td align="right">36.64</td> -<td align="right">28.74</td> -<td align="right">24.54</td> -<td align="right">19.45</td> +<td align="right">11.73</td> +<td align="right">9.20</td> +<td align="right">7.86</td> +<td align="right">6.23</td> </tr> <tr class="odd"> <td align="right">650</td> -<td align="right">35.20</td> -<td align="right">27.61</td> -<td align="right">23.57</td> -<td align="right">18.69</td> +<td align="right">11.27</td> +<td align="right">8.84</td> +<td align="right">7.55</td> +<td align="right">5.98</td> </tr> <tr class="even"> <td align="right">700</td> -<td align="right">33.92</td> -<td align="right">26.61</td> -<td align="right">22.72</td> -<td align="right">18.01</td> +<td align="right">10.86</td> +<td align="right">8.52</td> +<td align="right">7.27</td> +<td align="right">5.76</td> </tr> <tr class="odd"> <td align="right">750</td> -<td align="right">32.77</td> -<td align="right">25.71</td> -<td align="right">21.95</td> -<td align="right">17.40</td> +<td align="right">10.49</td> +<td align="right">8.23</td> +<td align="right">7.03</td> +<td align="right">5.57</td> </tr> <tr class="even"> <td align="right">800</td> -<td align="right">31.72</td> -<td align="right">24.89</td> -<td align="right">21.25</td> -<td align="right">16.84</td> +<td align="right">10.16</td> +<td align="right">7.97</td> +<td align="right">6.80</td> +<td align="right">5.39</td> </tr> <tr class="odd"> <td align="right">850</td> -<td align="right">30.77</td> -<td align="right">24.14</td> -<td align="right">20.61</td> -<td align="right">16.34</td> +<td align="right">9.85</td> +<td align="right">7.73</td> +<td align="right">6.60</td> +<td align="right">5.23</td> </tr> <tr class="even"> <td align="right">900</td> -<td align="right">29.91</td> -<td align="right">23.46</td> -<td align="right">20.03</td> -<td align="right">15.88</td> +<td align="right">9.57</td> +<td align="right">7.51</td> +<td align="right">6.41</td> +<td align="right">5.08</td> </tr> <tr class="odd"> <td align="right">950</td> -<td align="right">29.11</td> -<td align="right">22.84</td> -<td align="right">19.50</td> -<td align="right">15.46</td> +<td align="right">9.32</td> +<td align="right">7.31</td> +<td align="right">6.24</td> +<td align="right">4.95</td> </tr> <tr class="even"> <td align="right">1000</td> -<td align="right">28.37</td> -<td align="right">22.26</td> -<td align="right">19.00</td> -<td align="right">15.06</td> +<td align="right">9.08</td> +<td align="right">7.13</td> +<td align="right">6.08</td> +<td align="right">4.82</td> </tr> </tbody> </table> @@ -607,11 +745,15 @@ Figure 4.2: Power analysis results (power = 0.8) <h1><span class="header-section-number">5</span> Testing for differences: effect sizes, confidence intervals and p values</h1> <div id="getting-it-wrong" class="section level2"> <h2><span class="header-section-number">5.1</span> Getting it ‘wrong’</h2> +<p>Use base GREENGrid and number of people but re-sample slightly.</p> +<blockquote> +<p>NB: we create a small sample roughly 2 * the size of the GREEN Grid data. Due to small numbers and the random re-sampling with replacement process, there will be random fluctuations in the results with each run. As a result the results in this section will probably not match the results in the paper…</p> +</blockquote> <table> -<caption><span id="tab:smallNTable">Table 5.1: </span>Number of households and summary statistics per group</caption> +<caption><span id="tab:smallNTable">Table 5.1: </span>Number of households and summary statistics per group (winter heat pump use)</caption> <thead> <tr class="header"> -<th align="left">group</th> +<th align="left">nPeople</th> <th align="right">mean W</th> <th align="right">sd W</th> <th align="right">n households</th> @@ -619,39 +761,40 @@ Figure 4.2: Power analysis results (power = 0.8) </thead> <tbody> <tr class="odd"> -<td align="left">Control</td> -<td align="right">162.66915</td> -<td align="right">325.51171</td> -<td align="right">28</td> +<td align="left">1</td> +<td align="right">147.9273</td> +<td align="right">161.6783</td> +<td align="right">7</td> </tr> <tr class="even"> -<td align="left">Intervention 1</td> -<td align="right">58.80597</td> -<td align="right">113.53102</td> -<td align="right">26</td> +<td align="left">2</td> +<td align="right">301.9291</td> +<td align="right">76.8570</td> +<td align="right">7</td> </tr> <tr class="odd"> -<td align="left">Intervention 2</td> -<td align="right">35.13947</td> -<td align="right">83.90258</td> -<td align="right">22</td> +<td align="left">3</td> +<td align="right">429.2748</td> +<td align="right">248.5965</td> +<td align="right">14</td> </tr> <tr class="even"> -<td align="left">Intervention 3</td> -<td align="right">68.37439</td> -<td align="right">147.37279</td> -<td align="right">29</td> +<td align="left">4+</td> +<td align="right">470.3224</td> +<td align="right">297.9899</td> +<td align="right">24</td> </tr> </tbody> </table> +<p>So a sample of 52.</p> <p><img src="weGotThePowerDraftPaper_files/figure-html/ggMeanDiffs-1.png" width="672" /></p> -<p>T test group 1</p> +<p>T test 1 <-> 3</p> <table> -<caption><span id="tab:tTestTabG1">Table 5.2: </span>T test results (Group 1 vs Control)</caption> +<caption><span id="tab:tTestTabG1">Table 5.2: </span>T test results (1 vs 3)</caption> <thead> <tr class="header"> -<th align="right">Control mean</th> -<th align="right">Intervention 1 mean</th> +<th align="right">1 person mean</th> +<th align="right">3 persons mean</th> <th align="right">Mean difference</th> <th align="right">statistic</th> <th align="right">p.value</th> @@ -661,29 +804,29 @@ Figure 4.2: Power analysis results (power = 0.8) </thead> <tbody> <tr class="odd"> -<td align="right">162.6691</td> -<td align="right">58.80597</td> -<td align="right">-103.8632</td> -<td align="right">-1.587604</td> -<td align="right">0.1216582</td> -<td align="right">-236.8285</td> -<td align="right">29.10212</td> +<td align="right">147.9273</td> +<td align="right">429.2748</td> +<td align="right">-281.3475</td> +<td align="right">-3.116754</td> +<td align="right">0.0061527</td> +<td align="right">-471.4924</td> +<td align="right">-91.20272</td> </tr> </tbody> </table> -<p>The results show that the mean power demand for the control group was 162.67W and for Intervention 1 was 58.81W. This is a (very) large difference in the mean of 103.86. The results of the t test are:</p> +<p>The results show that the mean power demand for the control group was 429.27W and for Intervention 1 was 147.93W. This is a (very) large difference in the mean of 281.35. The results of the t test are:</p> <ul> -<li>effect size = 104W or 64% representing a <em>substantial bang for buck</em> for whatever caused the difference;</li> -<li>95% confidence interval for the test = -236.83 to 29.1 representing <em>considerable</em> uncertainty/variation;</li> -<li>p value of 0.122 representing a <em>relatively low</em> risk of a false positive result but which (just) fails the conventional p < 0.05 threshold.</li> +<li>effect size = 281W or 66% representing a <em>substantial bang for buck</em> for whatever caused the difference;</li> +<li>95% confidence interval for the test = -471.49 to -91.2 representing <em>considerable</em> uncertainty/variation;</li> +<li>p value of 0.006 representing a <em>relatively low</em> risk of a false positive result but which (just) fails the conventional p < 0.05 threshold.</li> </ul> -<p>T test Group 2</p> +<p>T test 1 <-> 4+</p> <table> -<caption><span id="tab:tTestTabG2">Table 5.3: </span>T test results (Group 2 vs Control)</caption> +<caption><span id="tab:tTestTabG2">Table 5.3: </span>T test results (1 vs 4+)</caption> <thead> <tr class="header"> -<th align="right">Control mean</th> -<th align="right">Intervention 2 mean</th> +<th align="right">1 person mean</th> +<th align="right">4+ persons mean</th> <th align="right">Mean difference</th> <th align="right">statistic</th> <th align="right">p.value</th> @@ -693,31 +836,33 @@ Figure 4.2: Power analysis results (power = 0.8) </thead> <tbody> <tr class="odd"> -<td align="right">162.6691</td> -<td align="right">35.13947</td> -<td align="right">-127.5297</td> -<td align="right">-1.990661</td> -<td align="right">0.0552626</td> -<td align="right">-258.11</td> -<td align="right">3.050644</td> +<td align="right">147.9273</td> +<td align="right">470.3224</td> +<td align="right">-322.3952</td> +<td align="right">-3.739141</td> +<td align="right">0.0013971</td> +<td align="right">-502.9035</td> +<td align="right">-141.8869</td> </tr> </tbody> </table> <p>Now:</p> <ul> -<li>effect size = 128W or 78.4% representing a still <em>reasonable bang for buck</em> for whatever caused the difference;</li> -<li>95% confidence interval for the test = -258.11 to 3.05 representing <em>even greater</em> uncertainty/variation;</li> -<li>p value of 0.055 representing a <em>higher</em> risk of a false positive result which fails the conventional p < 0.05 threshold and also the less conservative p < 0.1.</li> +<li>effect size = 322W or 68.55% representing a still <em>reasonable bang for buck</em> for whatever caused the difference;</li> +<li>95% confidence interval for the test = -502.9 to -141.89 representing <em>even greater</em> uncertainty/variation;</li> +<li>p value of 0.001 representing a <em>higher</em> risk of a false positive result which fails the conventional p < 0.05 threshold and also the less conservative p < 0.1.</li> </ul> -<p>To detect Intervention Group 2’s effect size of 78.4% would have required control and trial group sizes of 31 respectively.</p> </div> <div id="getting-it-right" class="section level2"> <h2><span class="header-section-number">5.2</span> Getting it ‘right’</h2> +<blockquote> +<p>NB: we create a larger sample roughly 40 * the size of the GREEN Grid data. Due to the random re-sampling with replacement process, there will be random fluctuations in the results with each run. As a result the results in this section will probably not exactly match the results in the paper but as the sample is large they should be quite close…</p> +</blockquote> <table> <caption><span id="tab:creatLargeN">Table 5.4: </span>Number of households and summary statistics per group</caption> <thead> <tr class="header"> -<th align="left">group</th> +<th align="left">nPeople</th> <th align="right">mean W</th> <th align="right">sd W</th> <th align="right">n households</th> @@ -725,44 +870,45 @@ Figure 4.2: Power analysis results (power = 0.8) </thead> <tbody> <tr class="odd"> -<td align="left">Control</td> -<td align="right">160.44582</td> -<td align="right">317.03541</td> -<td align="right">1128</td> +<td align="left">1</td> +<td align="right">159.2209</td> +<td align="right">151.7489</td> +<td align="right">88</td> </tr> <tr class="even"> -<td align="left">Intervention 1</td> -<td align="right">58.51839</td> -<td align="right">109.58111</td> -<td align="right">984</td> +<td align="left">2</td> +<td align="right">285.1232</td> +<td align="right">63.8895</td> +<td align="right">149</td> </tr> <tr class="odd"> -<td align="left">Intervention 2</td> -<td align="right">36.35177</td> -<td align="right">83.36952</td> -<td align="right">903</td> +<td align="left">3</td> +<td align="right">511.0046</td> +<td align="right">279.3558</td> +<td align="right">308</td> </tr> <tr class="even"> -<td align="left">Intervention 3</td> -<td align="right">70.69426</td> -<td align="right">147.43129</td> -<td align="right">1185</td> +<td align="left">4+</td> +<td align="right">417.3538</td> +<td align="right">267.6910</td> +<td align="right">495</td> </tr> </tbody> </table> +<p>So n = 1040</p> <div class="figure"><span id="fig:largeNmeanDiffs"></span> <img src="weGotThePowerDraftPaper_files/figure-html/largeNmeanDiffs-1.png" alt="Mean W demand per group for large sample (Error bars = 95% confidence intervals for the sample mean)" width="672" /> <p class="caption"> Figure 5.1: Mean W demand per group for large sample (Error bars = 95% confidence intervals for the sample mean) </p> </div> -<p>re-run T tests Control vs Group 1</p> +<p>re-run T tests 1 vs 3</p> <table> -<caption><span id="tab:largeNtTestControl-1">Table 5.5: </span>T test results (Intervention 2 vs Control)</caption> +<caption><span id="tab:largeNtTestControl-1">Table 5.5: </span>T test results (1 vs 3)</caption> <thead> <tr class="header"> -<th align="right">Control mean</th> -<th align="right">Intervention 1 mean</th> +<th align="right">1 person mean</th> +<th align="right">3 persons mean</th> <th align="right">Mean difference</th> <th align="right">statistic</th> <th align="right">p.value</th> @@ -772,29 +918,29 @@ Figure 5.1: Mean W demand per group for large sample (Error bars = 95% confidenc </thead> <tbody> <tr class="odd"> -<td align="right">160.4458</td> -<td align="right">58.51839</td> -<td align="right">101.9274</td> -<td align="right">10.12667</td> +<td align="right">159.2209</td> +<td align="right">511.0046</td> +<td align="right">-351.7837</td> +<td align="right">-15.50063</td> <td align="right">0</td> -<td align="right">82.18316</td> -<td align="right">121.6717</td> +<td align="right">-396.4678</td> +<td align="right">-307.0996</td> </tr> </tbody> </table> <p>In this case:</p> <ul> -<li>effect size = 101.9274343W or 63.53% representing a still <em>reasonable bang for buck</em> for whatever caused the difference;</li> -<li>95% confidence interval for the test = 82.18 to 121.67 representing <em>much less</em> uncertainty/variation;</li> +<li>effect size = 351.7837236W or 68.84% representing a still <em>reasonable bang for buck</em> for whatever caused the difference;</li> +<li>95% confidence interval for the test = -396.47 to -307.1 representing <em>much less</em> uncertainty/variation;</li> <li>p value of 0 representing a <em>very low</em> risk of a false positive result as it passes all conventional thresholds.</li> </ul> -<p>re-run T tests Control vs Group 2</p> +<p>re-run T tests 1 person vs 4+</p> <table> -<caption><span id="tab:largeNtTestControl-2">Table 5.6: </span>T test results (Intervention 2 vs Control)</caption> +<caption><span id="tab:largeNtTestControl-2">Table 5.6: </span>T test results (1 vs 4+)</caption> <thead> <tr class="header"> -<th align="right">Control mean</th> -<th align="right">Intervention 2 mean</th> +<th align="right">1 person mean</th> +<th align="right">4+ persons mean</th> <th align="right">Mean difference</th> <th align="right">statistic</th> <th align="right">p.value</th> @@ -804,20 +950,20 @@ Figure 5.1: Mean W demand per group for large sample (Error bars = 95% confidenc </thead> <tbody> <tr class="odd"> -<td align="right">160.4458</td> -<td align="right">36.35177</td> -<td align="right">124.0941</td> -<td align="right">12.61266</td> +<td align="right">159.2209</td> +<td align="right">417.3538</td> +<td align="right">-258.1329</td> +<td align="right">-12.80393</td> <td align="right">0</td> -<td align="right">104.7925</td> -<td align="right">143.3956</td> +<td align="right">-297.8882</td> +<td align="right">-218.3776</td> </tr> </tbody> </table> <p>In this case:</p> <ul> -<li>effect size = 124.0940533W or 77.34% representing a still <em>reasonable bang for buck</em> for whatever caused the difference;</li> -<li>95% confidence interval for the test = 104.79 to 143.4 representing <em>much less</em> uncertainty/variation;</li> +<li>effect size = 258.1328841W or 61.85% representing a still <em>reasonable bang for buck</em> for whatever caused the difference;</li> +<li>95% confidence interval for the test = -297.89 to -218.38 representing <em>much less</em> uncertainty/variation;</li> <li>p value of 0 representing a <em>very low</em> risk of a false positive result as it passes all conventional thresholds.</li> </ul> </div> @@ -839,7 +985,7 @@ Figure 5.1: Mean W demand per group for large sample (Error bars = 95% confidenc </div> <div id="runtime" class="section level1"> <h1><span class="header-section-number">8</span> Runtime</h1> -<p>Analysis completed in 46.02 seconds ( 0.77 minutes) using <a href="https://cran.r-project.org/package=knitr">knitr</a> in <a href="http://www.rstudio.com">RStudio</a> with R version 3.5.1 (2018-07-02) running on x86_64-apple-darwin15.6.0.</p> +<p>Analysis completed in 42.5 seconds ( 0.71 minutes) using <a href="https://cran.r-project.org/package=knitr">knitr</a> in <a href="http://www.rstudio.com">RStudio</a> with R version 3.5.1 (2018-07-02) running on x86_64-apple-darwin15.6.0.</p> </div> <div id="r-environment" class="section level1"> <h1><span class="header-section-number">9</span> R environment</h1> @@ -872,28 +1018,28 @@ Figure 5.1: Mean W demand per group for large sample (Error bars = 95% confidenc ## [1] stats graphics grDevices utils datasets methods base ## ## other attached packages: -## [1] knitr_1.20 pwr_1.2-2 forcats_0.3.0 -## [4] broom_0.5.0 lubridate_1.7.4 readr_1.1.1 -## [7] ggplot2_3.1.0 dplyr_0.7.7 data.table_1.11.8 -## [10] dkUtils_0.0.0.9000 +## [1] knitr_1.20 GREENGridData_1.0 pwr_1.2-2 +## [4] forcats_0.3.0 broom_0.5.0 lubridate_1.7.4 +## [7] readr_1.1.1 ggplot2_3.1.0 dplyr_0.7.7 +## [10] data.table_1.11.8 dkUtils_0.0.0.9000 ## ## loaded via a namespace (and not attached): -## [1] Rcpp_0.12.19 highr_0.7 pillar_1.3.0 -## [4] compiler_3.5.1 plyr_1.8.4 bindr_0.1.1 -## [7] tools_3.5.1 digest_0.6.18 lattice_0.20-35 -## [10] nlme_3.1-137 evaluate_0.12 tibble_1.4.2 -## [13] gtable_0.2.0 pkgconfig_2.0.2 rlang_0.3.0.1 -## [16] cli_1.0.1 yaml_2.2.0 xfun_0.4 -## [19] bindrcpp_0.2.2 withr_2.1.2 stringr_1.3.1 -## [22] hms_0.4.2 rprojroot_1.3-2 grid_3.5.1 -## [25] tidyselect_0.2.5 glue_1.3.0 R6_2.3.0 -## [28] fansi_0.4.0 rmarkdown_1.10 bookdown_0.7 -## [31] reshape2_1.4.3 weGotThePower_0.1 tidyr_0.8.1 -## [34] purrr_0.2.5 magrittr_1.5 backports_1.1.2 -## [37] scales_1.0.0 htmltools_0.3.6 assertthat_0.2.0 -## [40] colorspace_1.3-2 labeling_0.3 utf8_1.1.4 -## [43] stringi_1.2.4 lazyeval_0.2.1 munsell_0.5.0 -## [46] crayon_1.3.4</code></pre> +## [1] Rcpp_0.12.19 highr_0.7 cellranger_1.1.0 +## [4] pillar_1.3.0 compiler_3.5.1 plyr_1.8.4 +## [7] bindr_0.1.1 prettyunits_1.0.2 progress_1.2.0 +## [10] tools_3.5.1 digest_0.6.18 lattice_0.20-35 +## [13] nlme_3.1-137 evaluate_0.12 tibble_1.4.2 +## [16] gtable_0.2.0 pkgconfig_2.0.2 rlang_0.3.0.1 +## [19] yaml_2.2.0 xfun_0.4 bindrcpp_0.2.2 +## [22] withr_2.1.2 stringr_1.3.1 hms_0.4.2 +## [25] rprojroot_1.3-2 grid_3.5.1 tidyselect_0.2.5 +## [28] glue_1.3.0 R6_2.3.0 readxl_1.1.0 +## [31] rmarkdown_1.10 bookdown_0.7 weGotThePower_0.1 +## [34] reshape2_1.4.3 tidyr_0.8.1 purrr_0.2.5 +## [37] magrittr_1.5 backports_1.1.2 scales_1.0.0 +## [40] htmltools_0.3.6 assertthat_0.2.0 colorspace_1.3-2 +## [43] labeling_0.3 stringi_1.2.4 lazyeval_0.2.1 +## [46] munsell_0.5.0 crayon_1.3.4</code></pre> </div> <div id="references" class="section level1 unnumbered"> <h1>References</h1> diff --git a/paper/weGotThePowerDraftPaper_files/figure-html/dataPrep-1.png b/paper/weGotThePowerDraftPaper_files/figure-html/dataPrep-1.png index b0d6d3e152fca15f3b7f1c29ce2cda16e5e9c61f..0aeed83f3f2512546f805c810da19bfd23752340 100644 Binary files a/paper/weGotThePowerDraftPaper_files/figure-html/dataPrep-1.png and b/paper/weGotThePowerDraftPaper_files/figure-html/dataPrep-1.png differ diff --git a/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80-1.png b/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80-1.png index bd87bea6739feb47e358b029ee35a4669e2a6a25..d4f85eb2f6077eca9766756abec3ec5fcdc3c12f 100644 Binary files a/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80-1.png and b/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80-1.png differ diff --git a/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80all-1.png b/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80all-1.png index f41618943cec935a62befab0178039d17fc683c9..0c02cbe950264a0c2dce50277a16a902c556995c 100644 Binary files a/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80all-1.png and b/paper/weGotThePowerDraftPaper_files/figure-html/ggHPSampleSizeFig80all-1.png differ diff --git a/paper/weGotThePowerDraftPaper_files/figure-html/ggMeanDiffs-1.png b/paper/weGotThePowerDraftPaper_files/figure-html/ggMeanDiffs-1.png index 51f5b02d61629bae51f7d69580ad3403bc45bef3..baaa760553654a5118ef3c590d7cbe6d543e7e4e 100644 Binary files a/paper/weGotThePowerDraftPaper_files/figure-html/ggMeanDiffs-1.png and b/paper/weGotThePowerDraftPaper_files/figure-html/ggMeanDiffs-1.png differ diff --git a/paper/weGotThePowerDraftPaper_files/figure-html/largeNmeanDiffs-1.png b/paper/weGotThePowerDraftPaper_files/figure-html/largeNmeanDiffs-1.png index b4dad8d75ef36acf15cd9ea0a98e4723f862bba7..de648b4c4665c27aeccb2891d9bcf6bc7c38a87c 100644 Binary files a/paper/weGotThePowerDraftPaper_files/figure-html/largeNmeanDiffs-1.png and b/paper/weGotThePowerDraftPaper_files/figure-html/largeNmeanDiffs-1.png differ