User talk:Ralbegen/Opinion poll code

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

min segment = 2[edit]

Hi Ralbegen, I've always wondered who updates the graph on the Next UK General Election article, then I found this page. Can I as why you run the number of polls averaged down to 2 at the end of the graph? The results can be misleading and are often revised the next time the graph is updates. I wonder if it would be better to keep the averaging to a minimum of 5 or so? Smart51 (talk) 22:12, 8 January 2024 (UTC)[reply]

Hi Smart51! The min.segment.length = 2 part is about the position of the party text labels on the right of the graph, not the curves, which are just calculated using a built-in LOESS method (the geom_smooth() part). The edges of these lines will always fluctuate more: in the middle of the graph we know what came before and what came after, so we have a better idea as to what the results are. Towards the right-hand side especially, we usually don't even have all the polls that had been taken in the most recent week all at once, let alone the polls that are going to be taken next week and the week after! Does that make sense? Ralbegen (talk) 19:30, 10 January 2024 (UTC)[reply]