The next two charts show demand levels in January 2006 & 2016 as mean MW per hour. Figure \ref(fig:compareTotal) shows mean MW across weekdays compared with each weekend day. Fig 1 in paper.
```{r compareTotal, fig.cap="NG demand totals over time", fig.height=6}
rawPlot <- ggplot(halfHourlyNgPlotDT, aes(x = r_hmsTime, y = meanGW, colour = as.factor(r_year), group = r_year)) + # need to fix the fractional years on the legend
geom_line() +
facet_grid(r_month ~ wDay) +
#ylim(0,NA) +
labs(caption = paste0("Hourly mean MW (weekdays)\n", dataNote),
rawPlot + scale_colour_grey(start = 0.8, end = 0.2)
rawPlot
myPlot <- addPeakPeriod(rawPlot) + scale_colour_grey(start = 0.8, end = 0.2)
myPlot +
labs(caption = paste0(dataNote, "\nPeak demand period shown shaded")) +
theme(legend.position = "bottom")
# normalise by the mean for each year
mean2006 <- mean(tempDT[r_year == 2006]$meanMW)
mean2011 <- mean(tempDT[r_year == 2011]$meanMW)
mean2016 <- mean(tempDT[r_year == 2016]$meanMW)
ggsave("ngMeanGW.png")
```
Figure \ref(fig:compareNormalised) shows the same data but normalised to the overall mean. This shows the relative distribution of demand rather than absolute and illustrates the increased 'peakiness'. Fig 2 in paper.
normPlot <- ggplot(tempDT, aes(x = r_hour, y = normMean, colour = as.factor(r_year), group = r_year)) + # need to fix the fractional years on the legend
normPlot <- ggplot(halfHourlyNgPlotDT,
aes(x = truncHH, y = normMean,
colour = as.factor(r_year),
group = r_year)) + # need to fix the fractional years on the legend
geom_line() +
facet_grid(r_month ~ wDay) +
#ylim(0,NA) +
labs(caption = paste0("Normalised hourly mean MW (weekdays)\n", dataNote),
@@ -565,8 +646,7 @@ synthW6aEpsDT <- dt # this will definitely now only have episodes that are from
dt <- NULL # remove to save memory
```
# DEMAND Acts
# Code DEMAND Acts
We use this data to code the main and secondary activities into a non-arbitrary but highly aggregated set of 10 DEMAND 'Acts'. This enables us to more easily depict change over time at a coarse level. The aggregated codes are as follows:
...
...
@@ -670,13 +750,8 @@ Note that this scheme is entirely open for revision. Feedback welcome.
synthW6aEpsDT <- ba_DEMANDcodeActs(synthW6aEpsDT)
# construct a fake half hour in r time ----
# this fixes the problem of no episode start times where the episodes are imputed into half hour 'slots' as the episode spans more than 1 half hour
# this will have date set to 'today' - i.e. the date on which it is run
aggHhDemandActsDT <- merge(aggHhDemandActsDT, aggAllHHDT) # <- this requires half hours to be char or integers not hms which is why we keep them as char until plotting
@@ -906,73 +995,28 @@ Again, these results show minor variations with the maximum difference being +/-
All subsequent analysis uses weighted data unless specifically stated (e.g. for testing purposes)
### DEMAND: All age groups combined
#### Whole day
## DEMAND: All age groups combined
The following charts use the 'any in a half hour' data to show the percentage of half hours reported as a given act at a given time of day.
The percentage charts are useful for assessing the changing composition of in-home vs out-of-home activities but can over-emphasise the apparent prevalence of certain acts when it is less common to be out of the home - such as out of home sleep during 01:00 - 05:00.
As there is the potential for more than one activity to be reported in a given half hour the activities may sum to greater than 100% and this is especially visible for diaries with smaller duration slots and more additional variables which lead to more frequent episode boundaries (e.g. 2000 & 2014/15).
First we present results just for 2014 to give a snapshot of the most recent data.
```{r 2014 as line chart}
# re-use aggHhDemandActsWtDT
aggHhDemandActsWtDT <- ba_DEMANDreLabelSvyAggActs(aggHhDemandActsWtDT) # as.data.table creates char from svy results
dt <- aggHhDemandActsWtDT[ba_survey=="2014"]
# requires a dt of just the single actLabel you want to plot
myCaption <- "Synthetic MTUS 2014, UK sample (%, weighted)"
Compare 1974 & 2014 but without looking at day of the week & in-home only (paper v2.0, Fig 2, revised). Adjust height of chart to fit single A4 page?
Fig \ref(fig:allYearsStackedByWeekday) shows all DEMAND activities stacked by day of the week uses line chart to show all acts in vs out of home. Fig 3 in paper.
```{r repeat all acts but split by at home vs not at home, fig.height=10, fig.width=8}
As the above representation is difficult to interpret, we next present a derived graph which shows the change in % of halfhours in which these activities were recorded from 1974 to 2014. This chart therefore shows aboslute change of percentage points and highlights those relatively frequent activities which have changed a lot.
Fig 3
> NB: ignores hours < 06:00 to avoid noisy data
```{r all - plot pc change 1974_2014, fig.height=10, fig.width=8}
Weighted table of respondents by age (repeats table above?)
Next we use the 1974 - 2014 changes to present the changes in the peak demand period for weekdays vs Saturdays and Sundays. The first version keeps the at own home/out of home panels as the vertical columns, the second switches them to highlight change. Need to be consistent inthe paper...
kable(caption="MTUS 1974-2015 Survey data: age of respondents (weighted, row %)",
round(100*prop.table(t,1),2)
)
```
### DEMAND: Working age group (16-64) vs retired (65+)
The following table shows the % of respondents aged 16+ in different work status over the period. The decline in the % of those in full time work is partly due to increased numbers of people in the older (retired) age cohorts.
This is corrected by the following table which shows the work status of all aged 16-64 in each survey for men and for women. As we can see there has been a general reduction in the % of male respondents in full time work over the period alongside an increase in the % in part time work. In contrast the opposite trends are seen for women with a steady increase in the % in full time work and a similar (but less steep) upward trend in the % in part-time work. Given the ongoing gendered nature of energy-using domestic acitivties (refs) these trends provide an important context to the patterns of time-use we discuss below.
```{r 16-64 - plot day of week change for 1974 - 2014 out of home, fig.height=10, fig.width=8}
myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (Weighted, Not at own home)"
ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome != "At own home"], dateBreaks = "2 hours", yLabel = "% point change 1974 - 2014") # plot as normal ggplot (easier for paper writing)
```
Essentially repeat the above analysis but for evening peak.
Out of home evening peak:
```{r 16-64 - plot day of week change for 1974 - 2014 out of home evening peak}
"Work (out of home)", actLabelChar)] # <- to distinguish from at home work
myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (Weighted, Not at own home)"
ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome != "At own home" &
as.POSIXlt(r_startHalfHour)$hour >= 16 &
as.POSIXlt(r_startHalfHour)$hour <= 21], dateBreaks = "2 hours", yLabel = "% point change 1974 - 2014") # plot as normal ggplot (easier for paper writing)
```{r 16-64 - plot day of week change for 1974 - 2014 at own home, fig.height=10, fig.width=8}
myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (Weighted, At own home)"
16-64 - All activities at home except Travel or where labelled (Figure \ref(fig:deltaPlotDow16_64) - Fig 5 in paper).
myPlot <- ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome == "At own home"], dateBreaks = "2 hours", yLabel = "% point change 1974 - 2014") # plot as normal ggplot (easier for paper writing)
```{r 16-64 - plot day of week change for 1974 - 2014 at own home evening peak}
myCaption <- "Synthetic MTUS 1974 - 2014, UK sample (Weighted, At own home)"
myPlot <- ba_plotChange16_64(dtChange1974_2014_workingAgeWtDT[inHome == "At own home" &
as.POSIXlt(r_startHalfHour)$hour >= 16 &
as.POSIXlt(r_startHalfHour)$hour <= 21], dateBreaks = "2 hours", yLabel = "% point change 1974 - 2014") # plot as normal ggplot (easier for paper writing)
65+ - All activities at home except Travel or where labelled (Figure \ref(fig:deltaPlotDow64m) - Fig 6 in paper).
However, such descriptive analysis does not enable robust statistical claims regarding change during the evening peak period. To provide such evidence we developed two Poisson models - one for the early evening period from 16:00 to 18:00 on weekdays () and one for 18:00 – 21:00 () on weekdays, reflecting the descriptive analysis/charts above. For each model we first assess the statistical effect of survey year (sub-model one) and then year plus age group (sub-model two) on the number of half hours that the given activity was reported in those periods.
...
...
@@ -1424,20 +1484,43 @@ Test this using two poisson models - one for 'early' eating and one for 'late' e
Also use two logit to test p(any reported) - this tests predictors of reporting any activity in the time period and may be easier to interpret.
NB: we use interaction terms for survey year & working age to understand how older people's reported activities have changed over time.
Before we start regression analysis, construct line charts showing % reporting this activity per half hour for each survey year - to give a better sense of the trajectory of change than the 1974 -> 2014 total diff.
Before we start regression analysis, construct line charts showing % reporting this activity per half hour for each survey year - to give a better sense of the trajectory of change than the 1974 -> 2014 total diff. (not used in final version of paper)
Change of purpose of models - to estimate statistical effects of being in empstat on p(late food) etc. This uses respondents aged 16-64 only as we are interested in the effects of changing work patterns (primarily)
This section analyses the patterns of car trips that end at home on the assumption that this might predict the timing of 'charging load' in the context of a direct substitution from petrol/diesel vehicles to EVs. Of course it is likely that car-use practices will evolve to reflect the new affordances of EVs but we do not attempt to model such change here.
y = "% half-hours where car trip just ended @ home"
)
```
The above unweighted chart appears to show virtually no car trips ending at home outside weekdays in 1974. However the following table shows that such acts are extremely rare so the result is correct. We note also the unspecified transport rates higher in 1974 suggesting that at least some car use may not be classified as such.
```{r check weekend travel 1974}
t <- with(synthW6aEpsDT[r_wday != "Monday-Friday"],
table(mtrav, ba_survey)
)
kable(caption = "Proportion of weekend half hours reporting car travel (unweighted)",
round(prop.table(t,2)*100,2)
)
```
Now the weighted version. First we show the overall results for the whole population and we exclude 1974 for the purposes of clarity.
```{r car trips ending at home - data set up - weighted}
y = "% half-hours where car trip just ended @ home"
)
Late media:
```{r check lateMedia}
summary(mediaPeakDT)
# times
print("From:")
hms::as.hms(min(mediaPeakDT$minTime))
print("To:")
hms::as.hms(max(mediaPeakDT$maxTime))
```
Now repeat but show different patterns for different seasons, excluding 1974 & 1985 for clarity (as some months not defined or have so few cases they skew the charts).
```{r car trips ending at home - by season weighted}