Per default, pools surveys starting from current date and going 14 days back. For each pollster within the defined time-frame, only the most recent survey is used.
pool_surveys( surveys, last_date = Sys.Date(), pollsters = c("allensbach", "emnid", "forsa", "fgw", "gms", "infratest", "dimap", "infratestdimap", "insa"), period = 14, period_extended = NA, corr = 0.5, weights = NULL )
surveys | A |
---|---|
last_date | Only surveys in the time-window from |
pollsters | Character vector of pollsters that should be considered for pooling. |
period | See |
period_extended | Optional. If specified, all surveys in the time-window
from |
corr | Assumed correlation between surveys (of different pollsters). Defaults to 0.5. |
weights | Additional weights for individual surveys. |
library(coalitions) library(dplyr) latest <- get_latest(surveys_sample) pool_surveys(surveys_sample, last_date=as.Date("2017-09-02"))#> # A tibble: 7 x 8 #> pollster date start end respondents party percent votes #> <chr> <date> <date> <date> <dbl> <chr> <dbl> <dbl> #> 1 pooled 2017-09-02 2017-08-22 2017-09-02 3055. afd 8.89 272. #> 2 pooled 2017-09-02 2017-08-22 2017-09-02 3055. cdu 38.0 1161. #> 3 pooled 2017-09-02 2017-08-22 2017-09-02 3055. fdp 8.52 260. #> 4 pooled 2017-09-02 2017-08-22 2017-09-02 3055. greens 7.41 226. #> 5 pooled 2017-09-02 2017-08-22 2017-09-02 3055. left 9.06 277. #> 6 pooled 2017-09-02 2017-08-22 2017-09-02 3055. others 4.51 138. #> 7 pooled 2017-09-02 2017-08-22 2017-09-02 3055. spd 23.6 722.