cont_data_trans = transpose(cont_data)
Plot.plot({
y: {percent: true, label: "Percent", labelAnchor: "center", labelArrow: "none"},
x: {label: "Rating", labelAnchor: "center", labelArrow: "none"},
fy: {
tickRotate: 90
},
marks: [
Plot.rectY(cont_data_trans, Plot.normalizeY("sum", Plot.binX({y:"sum"},
{x: {thresholds: 40, value: "rating"}, y:"n"})))
],
facet: {
data:cont_data_trans,
y: "candidate",
label: null
}
})
(C)CES Data
The data is all from the (C)CES. They have been asking, since 2009, how liberal or conservative different candidates are using a 7 point likert scale question. From 2006 to 2009 they used a very similar question but instead relied upon a thermometer style question. Here I provide some useful (maybe?) details about the data along with some information about how I accommodated 2006-2008.
Pre-2009 Data
Bridging
Odds and Ends
There are several years where the CES has included a panel of voters across multiple survey years. In this case I have opted to ignore the panel aspect and treat them as if they are different people. This is likely throwing out some information but it seemed like the best option. There are three ways to approach this:
Assume that voters have not changed at all across the survey panels. For this choice there would be one \(\beta\) and one \(\alpha\) for each voter which would be used repeatedly across panels. This assumes that they have not change their own political views in this time period, having roughly the same understanding of liberal-conservative across the time period. I thought this assumption was overly restrictive.
Use some sort of pooling model where each year’s scores would help inform the other year’s, but not entirely constrain them. This could be implemented with some sort of hierarchical prior on them or even a dynamic prior overtime. Although I think this is interesting, the computational complexity concerned me.
Treat them as all independent. This, as I said, ignores potentially useful information but was feasible.
I might return to try 2 at some point, we will see what the future holds.