-
Notifications
You must be signed in to change notification settings - Fork 0
/
2023_01.qmd
455 lines (332 loc) · 19.4 KB
/
2023_01.qmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
---
title: "January 2023"
author:
- name: "Tomasz Woźniak"
affiliations:
- University of Melbourne
orcid: 0000-0003-2212-2378
execute:
freeze: auto
---
```{r interest data}
#| echo: false
#| message: false
#| warning: false
# download daily interest rates
icr_dwnld = readrba::read_rba(series_id = "FIRMMCRTD") # Cash Rate Target
icr_tmp = xts::xts(icr_dwnld$value, icr_dwnld$date)
dates_tmp = xts::xts(as.Date(icr_dwnld$date), icr_dwnld$date)
by1m_dwnld = readrba::read_rba(series_id = "FIRMMBAB30D")
by1m_tmp = xts::xts(by1m_dwnld$value, by1m_dwnld$date)
by3m_dwnld = readrba::read_rba(series_id = "FIRMMBAB90D")
by3m_tmp = xts::xts(by3m_dwnld$value, by3m_dwnld$date)
by6m_dwnld = readrba::read_rba(series_id = "FIRMMBAB180D")
by6m_tmp = xts::xts(by6m_dwnld$value, by6m_dwnld$date)
by2y_dwnld = readrba::read_rba(series_id = "FCMYGBAG2D")
by2y_tmp = xts::xts(by2y_dwnld$value, by2y_dwnld$date)
by3y_dwnld = readrba::read_rba(series_id = "FCMYGBAG3D")
by3y_tmp = xts::xts(by3y_dwnld$value, by3y_dwnld$date)
by5y_dwnld = readrba::read_rba(series_id = "FCMYGBAG5D")
by5y_tmp = xts::xts(by5y_dwnld$value, by5y_dwnld$date)
by10y_dwnld = readrba::read_rba(series_id = "FCMYGBAG10D")
by10y_tmp = xts::xts(by10y_dwnld$value, by10y_dwnld$date)
long_ou_tmp = na.omit(merge(by2y_tmp, by3y_tmp, by5y_tmp, by10y_tmp))
long_be = long_ou_tmp["/2013-05-16"]
long_af = long_ou_tmp["2022-01-01/"]
long_in_tmp = readxl::read_xls(path = "f02d.xls", skip = 10)
long_in = xts::xts(long_in_tmp[,2:5], as.Date(long_in_tmp$`Series ID`))
long_in = long_in["2013-05-17/2021-12-31"]
colnames(long_in) <- colnames(long_af)
short = na.omit(merge(icr_tmp, by1m_tmp, by3m_tmp, by6m_tmp))
long = rbind(long_be, long_in, long_af)
# daily systems
forecast_day = "/2023-01"
variables_all = na.omit(merge(short, long))
colnames(variables_all) = c("cash rate", "1m", "3m", "6m", "2y", "3y", "5y", "10y")
variables_all = variables_all[forecast_day]
variables_long = na.omit(merge(icr_tmp, long))
colnames(variables_long) = c("cash rate", "2y", "3y", "5y", "10y")
variables_long = variables_long[forecast_day]
variables_short = short
colnames(variables_short) = c("cash rate", "1m", "3m", "6m")
variables_short = variables_short[forecast_day]
# weekly and monthly systems
vwa = xts::to.weekly(variables_all, OHLC = FALSE)
vwl = xts::to.weekly(variables_long, OHLC = FALSE)
vws = xts::to.weekly(variables_short, OHLC = FALSE)
vma = xts::to.monthly(variables_all, OHLC = FALSE)
vml = xts::to.monthly(variables_long, OHLC = FALSE)
vms = xts::to.monthly(variables_short, OHLC = FALSE)
# create a dummy for the interest raise regime
T = nrow(vma)
dm = xts::xts(as.matrix(rep(0, T)), zoo::index(vma))
dm[(T - 8):T] = 1
colnames(dm) = "dum"
dmf = as.matrix(rep(1,12))
colnames(dmf) = "dum"
Tw = nrow(vwa)
dw = xts::xts(as.matrix(rep(0, Tw)), zoo::index(vwa))
dw[(Tw - 38):Tw] = 1
colnames(dw) = "dum"
dwf = as.matrix(rep(1,55))
colnames(dwf) = "dum"
```
```{r cointegrating rank}
#| echo: false
#| message: false
#| warning: false
#| results: hide
library(vars)
# Johansen's cointegrating rank test
vecm_vma = ca.jo(vma, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vma) # r = 5, N = 8
vecm_vms = ca.jo(vms, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vms) # r = 3, N = 4
vecm_vml = ca.jo(vml, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vml) # r = 4, N = 5
vecm_vwa = ca.jo(vwa, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vwa) # r = 7, N = 8
vecm_vws = ca.jo(vws, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vws) # r = 3, N = 4
vecm_vwl = ca.jo(vwl, type = "trace", ecdet = "const", K = 5, spec = "transitory")
summary(vecm_vwl) # r = 4, N = 5
```
```{r forecasting}
#| echo: false
# forecast with monthly data
f = 1
forecasts = array(NA, c(12, 3, 18))
vm = list(vma, vms, vml)
rr = c(5, 3, 4)
for (v in 1:3) {
for (p in c(3, 5, 7)) {
vecm = ca.jo(vm[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory", dumvar = dm)
var_cr = vec2var(vecm, r = rr[v])
var_pr = predict(var_cr, n.ahead = 12, ci = .68, dumvar = dmf)
forecasts[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
vecm = ca.jo(vm[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory")
var_cr = vec2var(vecm, r = rr[v])
var_pr = predict(var_cr, n.ahead = 12, ci = .68)
forecasts[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
}
}
ym1 = zoo::as.yearmon("2023-02") # the first forecasted period
ym2 = zoo::as.yearmon("2024-01") # the last forecasted period
s = seq(ym1, ym2, 1/12) # create yearmon sequence
pooled_forecasts_m = apply(forecasts, 1:2, mean)
colnames(pooled_forecasts_m) = c("forecast", "lower", "upper")
pooled_forecasts_m = xts::xts(pooled_forecasts_m, s)
ym13 = zoo::as.yearmon("2023-01") # forecast origin
s3 = seq(ym13, ym2, 1/12) # create yearmon sequence
ym12 = zoo::as.yearmon("2010-1")
s2 = seq(ym12, ym2, 1/12) # create yearmon sequence
datainforecast = as.vector(vm[[1]][(dim(vm[[1]])[1] - (length(s2) - 12 - 1)):dim(vm[[1]])[1], 1])
last_point = datainforecast[length(datainforecast)]
cols = c("darkorchid4","mediumorchid1","mediumorchid2","mediumorchid3","hotpink1","hotpink2","hotpink3","hotpink4")
# forecast with weekly data
f = 1
forecastsw = array(NA, c(55, 3, 18))
vw = list(vwa, vws, vwl)
rrw = c(7, 3, 4)
for (v in 1:3) {
for (p in c(3, 5, 7)) {
vecm = ca.jo(vw[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory", dumvar = dw)
var_cr = vec2var(vecm, r = rrw[v])
var_pr = predict(var_cr, n.ahead = 55, ci = .68, dumvar = dwf)
forecastsw[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
vecm = ca.jo(vw[[v]], type = "trace", ecdet = "const", K = p, spec = "transitory")
var_cr = vec2var(vecm, r = rrw[v])
var_pr = predict(var_cr, n.ahead = 55, ci = .68)
forecastsw[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
}
}
sw = as.Date(rep(NA, 55))
sw[1] = as.Date("2023-02-01")
for (i in 2:55) {
sw[i] = sw[i - 1] + 7
}
pooled_forecasts_w = apply(forecastsw, 1:2, mean)
colnames(pooled_forecasts_w) = c("forecast", "lower", "upper")
pooled_forecasts_w = xts::xts(pooled_forecasts_w, sw)
pooled_forecasts_wm = xts::to.monthly(pooled_forecasts_w, OHLC = FALSE)
# pool forecasts
pooled_forecasts = 0.5 * (pooled_forecasts_m + pooled_forecasts_wm)
zoo::write.zoo(pooled_forecasts, sep = ",", file = "forecasts/2023-01.csv")
```
```{r rates data}
#| echo: false
#| message: false
#| warning: false
# download the rates
icr_dwnld = readrba::read_rba(series_id = "FIRMMCRTD") # Cash Rate Target
icr_tmp = xts::xts(icr_dwnld$value, icr_dwnld$date)
dates_tmp = xts::xts(as.Date(icr_dwnld$date), icr_dwnld$date)
icr = xts::to.quarterly(icr_tmp, OHLC = FALSE)
icr = icr[-nrow(icr),]
by10y_dwnld = readrba::read_rba(series_id = "FCMYGBAG10D") # 10-year bonds
by10y_tmp = xts::xts(by10y_dwnld$value, by10y_dwnld$date)
long_be = by10y_tmp["/2013-05-16"]
long_af = by10y_tmp["2022-01-01/"]
long_in = long_in[,4]
colnames(long_in) = colnames(long_af) = colnames(long_be) = "by10y"
long = rbind(long_be, long_in, long_af)
by10y = xts::to.quarterly(long, OHLC = FALSE)
by10y = by10y[-nrow(by10y),]
# "GMAREXPY" # Survey measure of market economists' inflation expectations; Median inflation for 1 year ahead; Year-ended
piexpe1y_dwnld = readrba::read_rba(series_id = "GMAREXPY")
piexpe1y_tmp = xts::xts(piexpe1y_dwnld$value, piexpe1y_dwnld$date, tclass = 'yearqtr')
piexpe1y = xts::to.quarterly(piexpe1y_tmp, OHLC = FALSE)
# "GUNIEXPY" # Survey measure of union officials' inflation expectations; Median inflation for 1 year ahead; Year-ended
piexpu1y_dwnld = readrba::read_rba(series_id = "GUNIEXPY")
piexpu1y_tmp = xts::xts(piexpu1y_dwnld$value, piexpu1y_dwnld$date, tclass = 'yearqtr')
piexpu1y = xts::to.quarterly(piexpu1y_tmp, OHLC = FALSE)
# "GCPIAGSAQP" # Consumer price index; All groups; Quarterly change (in per cent)
picpi_dwnld = readrba::read_rba(series_id = "GCPIAGSAQP")
picpi_tmp = 4 * xts::xts(picpi_dwnld$value, picpi_dwnld$date, tclass = 'yearqtr')
picpi = xts::to.quarterly(picpi_tmp, OHLC = FALSE)
# "GLFSURSA" # Unemployed persons as percentage of labour force
ur_dwnld = readrba::read_rba(series_id = "GLFSURSA")
ur_tmp = xts::xts(ur_dwnld$value, ur_dwnld$date, tclass = 'yearqtr')
ur = xts::to.quarterly(ur_tmp, OHLC = FALSE)
# "GLFSEPTPOP" # Employed persons as percentage of working age civilian population
er_dwnld = readrba::read_rba(series_id = "GLFSEPTPOP")
er_tmp = xts::xts(er_dwnld$value, er_dwnld$date, tclass = 'yearqtr')
er = xts::to.quarterly(er_tmp, OHLC = FALSE)
with_exp = na.omit(merge(icr, by10y, piexpe1y, piexpu1y, picpi, ur, er))
colnames(with_exp) = c("cash rate", "10yb", "Epi_eco", "Epi_uni", "pi", "ur", "er")
with_exp = with_exp["2002-01/2022-12"]
no_exp = na.omit(merge(icr, by10y, picpi, ur, er))
colnames(no_exp) = c("cash rate", "10yb", "pi", "ur", "er")
no_exp = no_exp["/2022-12"]
```
```{r forecasting quarterly}
#| echo: false
#| message: false
#| warning: false
#| results: hide
# Johansen's test
library(vars)
vecm_we = ca.jo(with_exp, type = "trace", ecdet = "none", K = 3, spec = "transitory")
summary(vecm_we) # r = 2, N = 7
vecm_noe = ca.jo(no_exp, type = "trace", ecdet = "none", K = 3, spec = "transitory")
summary(vecm_noe) # r = 2, N = 5
# forecast with quarterly data
f = 1
forecasts = array(NA, c(4, 3, 2))
vmq = list(with_exp, no_exp)
for (v in 1:2) {
vecm = ca.jo(vmq[[v]], type = "trace", ecdet = "none", K = 3, spec = "transitory")
var_cr = vec2var(vecm, r = 2)
var_pr = predict(var_cr, n.ahead = 4, ci = .68)
forecasts[,,f] = var_pr$fcst$cash.rate[,1:3]
f = f + 1
}
ym1q = zoo::as.yearqtr("2023-01") # the first forecasted period
ym2q = zoo::as.yearqtr("2023-04") # the last forecasted period
sq = seq(ym1, ym2, 1/4) # create yearqtr sequence
pooled_forecasts_q = apply(forecasts, 1:2, mean)
colnames(pooled_forecasts_q) = c("forecast", "lower", "upper")
pooled_forecasts_q = xts::xts(pooled_forecasts_q, sq + 1/12)
ym13q = zoo::as.yearqtr("2022-04") # forecast origin
s3q = seq(ym13q, ym2q, 1/4) # create yearmon sequence
ym12q = zoo::as.yearqtr("2010-01")
s2q = seq(ym12q, ym2q, 1/4) # create yearmon sequence
datainforecastq = as.vector(vmq[[1]][(dim(vmq[[1]])[1] - (length(s2q) - 4 - 1)):dim(vmq[[1]])[1], 1])
last_pointq = datainforecastq[length(datainforecastq)]
cols = c("darkorchid4","mediumorchid1","mediumorchid2","mediumorchid3","hotpink1","hotpink2","hotpink3","hotpink4")
zoo::write.zoo(pooled_forecasts_q, sep = ",", file = "forecasts/2023-01-quarterly.csv")
```
> Taking into account the newest data while preparing my answers to the end-of-January RBA cash rate survey by [finder.com.au](https://www.finder.com.au/rba-cash-rate) resulted in a noticeable revision of the forecasts. They still indicate the upwards trend in the cash rate value flattening in mid-2023. However, the peak and end-of-the-year cash rate levels are lower than in my [November forecasts](2022_11.qmd). Considering predictions using weekly and monthly bond yield data, the peak is not higher than 3.4% in June, with a likely range between 2.9 and 3.9 per cent.\
<!-- > The survey was published on 28 October 2022: [see the survey](https://www.finder.com.au/rba-survey-28-october-2022)\ -->
<!-- > My assessments were mentioned [here](https://www.news.com.au/finance/economy/interest-rates/bitter-pill-to-swallow-experts-grim-4-interest-rate-warning/news-story/8d95ff725a45b705649c4c2dca88589f), -->
<!-- [here](https://www.news.com.au/finance/economy/interest-rates/too-much-rba-tipped-to-confirm-seventh-consecutive-rate-rise-as-mortgage-cliff-looms/news-story/8f9c421356f5a9f8c703ebc61810ebb7), -->
<!-- [here](https://www.finder.com.au/rba-survey-1-november-2022), -->
<!-- [here](https://www.dailymail.co.uk/news/article-11375371/Warning-Australian-property-prices-start-slide-faster-rates-rising.html), and -->
<!-- [here](https://dynamicbusiness.com/topics/news/there-will-likely-be-another-cash-rate-hike-on-nov-1.html) -->
## Cash rate forecasts
The figure below presents the monthly cash rate series starting from January 2010, with the forecasts reported from February 2023 to January 2024 as the forecast mean and the 68% forecasting intervals. The forecasts follow a slight upwards trend in cash rate value up to June 2023, reaching the value of 3.4% for the monthly forecast and 3.7% for the quarterly one. After that period, the quarterly forecast goes down, and the monthly flattens. Both met at a value of around 3.5% by the end of 2023.
The data updates from late 2022 and early 2023 led to a noticeable revision of forecasts compared to my [November forecasts](2022_11.qmd). As a result, both the peak and the end-of-the-year forecasted values of the cash rate are now at lower levels. In addition, the forecasting intervals narrowed down slightly, with both upper and lower ends having lower values than my previous forecasts.
```{r forecast plot}
#| echo: false
ci1_tmp = col2rgb(cols[2])
ci2_tmp = col2rgb(cols[4])
ci1 = rgb(ci1_tmp[1], ci1_tmp[2], ci1_tmp[3], 100, maxColorValue = 255)
ci2 = rgb(ci2_tmp[1], ci2_tmp[2], ci2_tmp[3], 100, maxColorValue = 255)
plot(x = s2, y = c(datainforecast, pooled_forecasts[,1]), main = "Cash rate forecast",
type = "l", ylab = "[%]", xlab = "time",
ylim = range(pooled_forecasts, datainforecast), bty = "n",
lwd = 1, col = cols[1]
)
polygon(x = c(s3, s3[13:1]),
y = c(last_point,as.vector(pooled_forecasts[,2]), as.vector(pooled_forecasts[,3])[12:1], last_point),
col = ci1, border = ci1)
polygon(x = c(s3q + .25, s3q[5:1] + .25),
y = c(last_pointq,as.vector(pooled_forecasts_q[,2]), as.vector(pooled_forecasts_q[,3])[4:1], last_pointq),
col = ci2, border = ci2)
lines(x = s2, y = c(datainforecast, pooled_forecasts[,1]), lwd = 2, col = cols[1])
lines(x = s3q + .25, y = c(last_pointq, pooled_forecasts_q[,1]), lwd = 2, col = cols[4])
abline(v = ym13, col = cols[6], lty = 3)
```
The table below makes the numerical values presented in the figure more accessible.
```{r forecast table}
#| echo: false
options(knitr.kable.NA = '')
pooled_mq = merge(pooled_forecasts,pooled_forecasts_q)
colnames(pooled_mq) = c("monthly", "lower", "upper", "quarterly", "lower", "upper")
knitr::kable(as.matrix(pooled_mq), caption = "Monthly and quarterly cash rate forecasts", digits = 2)
```
## Survey answers
Based on the forecasts above, and the analysis of forecasts from individual models, I formed the following survey answers:
**When you think the RBA will change the cash rate?**
| | Feb 2023 | Mar 2023 | Apr 2023 | May 2023 | Jun 2023 | Jul 2023 | Aug 2023 | Sep 2023 | Oct 2023 | Nov 2023 | Dec 2023 or later |
|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|----------|-------------------|
| Increase | ✓ | ✓ | ✓ | ✓ | | | | | | | |
| Decrease | | | | | | | | | | | |
**What do you expect the cash rate to be by the end of 2023?**
> 3.7%
**Why do you think this?**
> The forecasts from yield curve models using weekly and monthly rates, as well as those from the models including quarterly inflation, inflation expectations, and labour market conditions, draw a similar picture: the interest rates will keep increasing until mid-2023, reaching the level of 3.5%, with a likely range from 3.1 to 3.9%. The models of quarterly data indicate a sharper increase with higher uncertainty. The year is expected to close with the cash rate at 3.7%. The forecasts are available at <https://donotdespair.github.io/cash-rate-survey-forecasts/>
**By how much do you think the RBA will change the cash rate in the next meeting?**
> 25 basis points
**By how much do you think the RBA should change the cash rate in the next meeting?**
> 25 basis points
**At what level do you think the cash rate will peak?**
> 3.75%
**When do you think the cash rate will peak?**
> June 2023
## RBA's decision
On 7 February 2023, the [RBA announced](https://www.rba.gov.au/monetary-policy/rba-board-minutes/2023/2023-02-07.html) an **increase** in the cash rate target by **25** basis points.
## Forecasting system
Preparing my answers for this month's survey, I further expanded my forecasting system. The novelty is two new models for quarterly data downloaded from RBA's website using an **R** package **readrba**. The variables in this new system include the cash rate and CPI inflation, 1-year-ahead inflation expectations based on surveys of professional economists and union leaders, 10-year bond yields, unemployment and employment rates. Therefore, models based on such variables account for the general economic conditions and labour markets. Importantly, they take into consideration inflation and its expectations. The quarterly data spanning the period starting in the second quarter of 2002 and finishing in the last one of 2022 is plotted below.
```{r data plot rates}
#| echo: false
plot(x = index(with_exp), y = as.vector(with_exp[,1]), main = "Quarterly data",
type = "l", ylab = "[%]", xlab = "time",
ylim = range(with_exp[,1:6], with_exp[,7]-60), bty = "n",
lwd = 2, col = "darkorchid4"
)
for (i in 2:6) lines(x = index(with_exp), y = as.vector(with_exp[,i]), col = cols[i])
lines(x = index(with_exp), y = as.vector(with_exp[,7]) - 60, col = cols[7], lwd = 2)
lines(x = index(with_exp), y = as.vector(with_exp[,1]), col = "darkorchid4", lwd = 2)
axis(2, lwd = 2, col = "darkorchid4")
axis(4, c(-1, 2, 5), c(59, NA, 65), lwd = 2, col = cols[7])
var_names = c("cash rate", "10y bond yield", "inflation expectation eco", "inflation expectation union", "inflation", "unemployment", "employment")
legend("bottomleft", legend = var_names, col = cols[1:7], lwd = c(2, rep(1, 5), 2), bty = "n")
```
Based on this data set, two forecasting models were developed using the **R** package **vars**: one including all the variables as reported in the plot above, and the other without inflation expectations allowing the series to start in 1995. These limits are dictated by data availability. The two systems of variables were put in Vector Error Correction models with one cointegrating relationship. The resulting forecasts up to one year ahead were pooled and reported above.
The monthly forecasts were based on the same forecasting system as the one I developed for [November forecasts](2022_11.qmd). The updated data is plotted below.
```{r data plot yields}
#| echo: false
plot(x = index(vwa), y = as.vector(vwa[,2]), main = "Australian interest rates at various maturities",
type = "l", ylab = "yield [%]", xlab = "time",
ylim = range(vwa), bty = "n",
lwd = 1, col = "mediumorchid1"
)
for (i in 3:8) lines(x = index(vwa), y = as.vector(vwa[,i]), col = cols[i])
lines(x = index(vwa), y = as.vector(vwa[,1]), col = "darkorchid4", lwd = 2)
legend("topright", legend = colnames(vwa), col = cols, lwd = c(2, rep(1, 7)), bty = "n")
```