Repository navigation
Expand file tree
/
Copy pathindex.qmd
More file actions
84 lines (72 loc) · 3.19 KB
/
Copy pathindex.qmd
File metadata and controls
84 lines (72 loc) · 3.19 KB
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
---
title: Voter Perceptions
html:
toc: false
execute:
echo: false
warning: false
---
This website provides information about the Voter Perception data created in [Hassell, Heseltine and Reuning (2025)](https://osf.io/pqgxu_v1) and then further expanded here. The scores here are estimates of _voter perceptions_ of politician ideology. Unlike other measures these scores use survey data, but adjust them to account for the fact that voters differ in their own internal understanding of liberal and conservative. In addition the scores are dynamically estimated so that you can track how a politician moves over time.
Below shows the perceived ideology of all candidates in a given state and year by election. In some instances candidates are missing because of difficulties labeling and changes in who is included, see the [FAQ](faq.qmd) for details. There are also visualizations showing [over time changes](overtime.qmd) and how [legislative and perception ideology relate](legislative.qmd).
This data is based on C/CES survey data. The actual [data is available at the Harvard Dataverse](https://doi.org/10.7910/DVN/VSRRIY), including IDs that connects the perception scores to [DIME](https://data.stanford.edu/dime), [Nominate](https://voteview.com/) and [538 Election](https://github.com/fivethirtyeight/election-results) data. In order to help anyone interested in the data the site includes an (overly) detailed [explanation of the methodology used.](generate/index.qmd)
## Estimates
```{ojs}
Plot.plot({
className: "plot",
color: {
legend: true,
domain: ["Democratic", "Other", "Republican"],
range: ["#083a90", "#06be37", "#e81b23"]
},
x: {
domain: [-4, 4]
},
y: {
label: null,
domain: d3.groupSort(
datafiltered,
([d]) => d.Order,
(d) => d.Seat
)
},
height: 1000,
marks: [
Plot.axisX({
label: "Conservative",
labelAnchor: "right"}),
Plot.axisX({
label: "Voter Perceptions",
labelAnchor: "center",
labelArrow: false}),
Plot.axisX({
label: "Liberal",
labelArrow: "left",
labelAnchor: "left"}),
Plot.dot(datafiltered, {x: "Ideology", y: "Seat", stroke: "Party", tip:true, channels: {Name: "Candidate", Party: "Party", Ideology: "Ideology"},}),
Plot.link(datafiltered, {y: "Seat", x1: "Lower", x2: "Upper", stroke: "Party"})
]
})
viewof selection = Inputs.form(
{
state: Object.assign(Inputs.select(
data.map((d) => d.State),
{sort: true, unique: true, label: "State", multiple: true, value: ["California"]}), {style: '--label-width: 50px'}),
year: Object.assign(Inputs.select(
["2010","2012","2014","2016","2018","2020","2022","2024"],
{sort: true, unique: true, label: "Year", multiple: true, value: ["2020"]}) , {style: '--label-width: 50px'}),
},
{
template: (formParts) => htl.html`
<div>
<div style="
width: 600px;
display: flex
">
${Object.values(formParts)}
</div>
</div>`
}
)
data = FileAttachment("/generate/out/campaign_data.csv").csv({ typed: true })
datafiltered = data.filter((d, i) => selection.state.includes(d.State) && selection.year.includes(String(d.Year)))
```