Skip to content

Commit

Permalink
Changes from Biden to Harris
Browse files Browse the repository at this point in the history
  • Loading branch information
technocrat committed Jul 24, 2024
1 parent 744d9a3 commit 31937a7
Show file tree
Hide file tree
Showing 49 changed files with 964 additions and 966 deletions.
Empty file added .!1310!.DS_Store
Empty file.
Empty file added .!1481!.DS_Store
Empty file.
Empty file added .!1596!.DS_Store
Empty file.
12 changes: 6 additions & 6 deletions 12th.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ tags = ["tag1", "tag2"]

## Tie scenario

If **President Biden wins only Pennsylvania, Michigan and Wisconsin** the outcome will be a 269-269 tie in the Electoral College. This assumes that Biden does not win Georgia, North Carolina, Arizona or Nevada, each of which Trump wins. Otherwise, every remaining state is won by the candidate who won it in 2020.
If **Vice President Harris wins only Pennsylvania, Michigan and Wisconsin** the outcome will be a 269-269 tie in the Electoral College. This assumes that Harris does not win Georgia, North Carolina, Arizona or Nevada, each of which Trump wins. Otherwise, every remaining state is won by the candidate who won it in 2020.

## Without the Nebraska Second

The models assume that except for the seven swing states, each candidate will win the states and election districts won in 2020. For Biden, the total includes a Nebraska
The models assume that except for the seven swing states, each candidate will win the states and election districts won in 2020. For Harris, the total includes a Nebraska
district that centers on Omaha. Nebraska is one of two states that have this arrangement. The other is Maine. An attempt was made earlier this year to change Nebraska to the winner-take-all system used by other states. It was unsuccessful, and it is not clear if another attempt will be made. It could be added to a special session anticipated for July to deal with property tax relief, but as of mid-June there has been a scarcity of news raising this. There also appears to be some internecine conflict going on between the Congressional delegation and the MAGA-aligned party apparatus. Should winner take all be implemented or if the Nebraska Second this time votes for Trump, possible outcomes differ.

A tie outcome that was produced by Biden winning only Wisconsin, Michigan and Pennsylvania, now has three different possible scenarios
A tie outcome that was produced by Harris winning only Wisconsin, Michigan and Pennsylvania, now has three different possible scenarios

* Wisconsin, Georgia and Pennsylvania
* Wisconsin, Pennsylvania and North Carolina (through May, NC is not moving in Biden's direction)
* Wisconsin, Pennsylvania and North Carolina (through May, NC is not moving in Harris's direction)
* Arizona, Michigan and Pennsylvania

Those three scenarios, which were formally wins, are replaced as the smallest possible victories by
Expand All @@ -36,9 +36,9 @@ A majority of 50 state delegations is 26, which is currently what the Republican

## Following the presidential and congressional elections

If the Republican Party retains control of 26 states, it is in a position to choose the President.
If the Republican Party retains control of 26 states, it is in a position to choose the Vice President.

If the Republican Party loses control of one state, no party has sole power to choose the President.
If the Republican Party loses control of one state, no party has sole power to choose the Vice President.

In that case, the provisions of the [Presidential Succession Act](https://www.law.cornell.edu/uscode/text/3/19) come into operation.

Expand Down
12 changes: 6 additions & 6 deletions 2020model.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ title = "Election of 2020"

The model used to assess monthly polls begins with the assumption that the 2024 election will resemble the 2020 election in that

* Biden will win the same states as in 2020, except for seven swing states
* Harris will win the same states as Biden won in 2020, except for seven swing states
* Trump will win the same states as in 2020, except for North Carolina

Models of the 2020 election for each of the seven swing states considers the number of votes won by Biden as a starting point. The results of each model will feed-forward as partial inputs to monthly poll models. In turn, the results of those will be input for subsequent months.
Models of the 2020 election for each of the seven swing states considers the number of votes won by Harris as a starting point. The results of each model will feed-forward as partial inputs to monthly poll models. In turn, the results of those will be input for subsequent months.

~~~
<table>
<thead>
<tr class = "header headerLastRow">
<th style = "text-align: right;">State</th>
<th style = "text-align: right;">Biden Proportion</th>
<th style = "text-align: right;">Biden Votes</th>
<th style = "text-align: right;">Harris Proportion</th>
<th style = "text-align: right;">Harris Votes</th>
<th style = "text-align: right;">Both Candidate Votes</th>
</tr>
</thead>
Expand Down Expand Up @@ -71,7 +71,7 @@ Models of the 2020 election for each of the seven swing states considers the num
## Explanation

- **Median**: Half of the random samples have probabilities greater than and half less than the median.
- **Mean**: The average of the 10,000 random samples constructed. It coincides with the Biden Proportion in the table above.
- **Mean**: The average of the 10,000 random samples constructed. It coincides with the Harris Proportion in the table above.
- **Mode**: The probability that occurs most often.
- **q025**: The value below which 2.5% of the probabilities occur.
- **q975**: The value below which 97.5% of the probabilities occur.
Expand All @@ -84,7 +84,7 @@ The density plots show the number of observations on the $y$-axis and the probab

## Rationale

Although there will be a different electorate, for the reasons explained [here](/typology), most voters in 2024 are highly likely to have voted in 2020. A high degere of political polarization makes it likely that most of those voters will vote the same way. However, it is unrealistic to expect that they will vote exactly the same way. An approach to adjusting for this is to introduce mathematical uncertainty into the results of the 2020 election, explained in more detail [here](/prior).
Although there will be a different candidate and a different electorate, for the reasons explained [here](/typology), most voters in 2024 are highly likely to have voted in 2020. A high degere of political polarization makes it likely that most of those voters will vote the same way. However, it is unrealistic to expect that they will vote exactly the same way. An approach to adjusting for this is to introduce mathematical uncertainty into the results of the 2020 election, explained in more detail [here](/prior).

## Results

Expand Down
10 changes: 5 additions & 5 deletions _assets/docs/pa_long.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

The poll does not specify whether the panel (N = 1305) was divided into subgroups for the presidential preference questions. Assuming that it was sub-grouped, half of the panel (N = 653) were asked to choose among “Joe Biden, the Democrat,” “Donald Trump, the Republican,” “Other,” “Do not plan to vote,” or “No opinion.” That is reflected in the two-way plot above. In the plot below (N = 652), the choices were “Joe Biden, the Democrat”, “Donald Trump, the Republican,” “Robert F. Kennedy, Jr., an independent”, “Cornel West, an independent”,” Other,” “Do not plan to vote,” “No opinion.”
The poll does not specify whether the panel (N = 1305) was divided into subgroups for the presidential preference questions. Assuming that it was sub-grouped, half of the panel (N = 653) were asked to choose among “Joe Harris, the Democrat,” “Donald Trump, the Republican,” “Other,” “Do not plan to vote,” or “No opinion.” That is reflected in the two-way plot above. In the plot below (N = 652), the choices were “Joe Harris, the Democrat”, “Donald Trump, the Republican,” “Robert F. Kennedy, Jr., an independent”, “Cornel West, an independent”,” Other,” “Do not plan to vote,” “No opinion.”


~~~
Expand All @@ -15,7 +15,7 @@ The poll does not specify whether the panel (N = 1305) was divided into subgroup
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_bl_2.png"style="width: 100%; display: block;">
~~~

The panel (N = 807) were asked first to choose among “Democrat Joe Biden,” “Republican Donald Trump,” “Would not vote,” or “Don’t know/No opinion” That is reflected in the two-way plot above. In the plot below, they were asked to choose among “Democrat Joe Biden”, “Republican Donald Trump”, “Independent Robert F. Kennedy Jr.”, “Independent Cornel West”, “Green Party candidate Jill Stein”, “Someone else, please specify”,”Would not vote”, or “Don’t know/No opinion”
The panel (N = 807) were asked first to choose among “Democrat Joe Harris,” “Republican Donald Trump,” “Would not vote,” or “Don’t know/No opinion” That is reflected in the two-way plot above. In the plot below, they were asked to choose among “Democrat Joe Harris”, “Republican Donald Trump”, “Independent Robert F. Kennedy Jr.”, “Independent Cornel West”, “Green Party candidate Jill Stein”, “Someone else, please specify”,”Would not vote”, or “Don’t know/No opinion”

~~~
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_bl_3.png"style="width: 100%; display: block;">
Expand All @@ -27,7 +27,7 @@ The panel (N = 807) were asked first to choose among “Democrat Joe Biden,”
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_cn_2.png"style="width: 100%; display: block;">
~~~

Half of the panel (N = 520) were asked to choose among “Joe Biden, the Democrat,” “Donald Trump, the Republican,” “Other,” “Do not plan to vote,” or “No opinion.” hat is reflected in the two-way plot above. In the plot below, the choices were “Joe Biden, the Democrat”, “Donald Trump, the Republican,” “Robert F. Kennedy, Jr., an independent”, “Cornel West, an independent”,” Other,” “Do not plan to vote,” “No opinion”
Half of the panel (N = 520) were asked to choose among “Joe Harris, the Democrat,” “Donald Trump, the Republican,” “Other,” “Do not plan to vote,” or “No opinion.” hat is reflected in the two-way plot above. In the plot below, the choices were “Joe Harris, the Democrat”, “Donald Trump, the Republican,” “Robert F. Kennedy, Jr., an independent”, “Cornel West, an independent”,” Other,” “Do not plan to vote,” “No opinion”

~~~
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_cn_3.png"style="width: 100%; display: block;">
Expand All @@ -47,7 +47,7 @@ Two-way poll with N = 1000.
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_fm_2.png" style="width: 100%; display: block;">
~~~

Half of the panel (N = 431) were asked to choose among “Biden”, “Trump”, “Someone else” or “Do not know.” That is reflected in the two-way plot above. In the plot below, there were additional choices of “Robert Kennedy Jr.” and “Jill Stein” for the other half of the panel (N = 430).
Half of the panel (N = 431) were asked to choose among “Harris”, “Trump”, “Someone else” or “Do not know.” That is reflected in the two-way plot above. In the plot below, there were additional choices of “Robert Kennedy Jr.” and “Jill Stein” for the other half of the panel (N = 430).

~~~
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_fm_3.png" style="width: 100%; display: block;">
Expand All @@ -68,7 +68,7 @@ This was an N = 1000 two-way poll.
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_ws_2.png" style="width: 100%; display: block;">
~~~

The panel (N = 600) were given three presidential preference sets of choices: 1) "Republican Donald Trump," or "Democrat Joe Biden," shown above as 2-way, 2) "Republican Donald Trump,", "Democrat Joe Biden," "Independent Robert F. Kennedy, Jr," "Independent Cornel West," "Libertarian Lars Mapstead," "Green Party Candidate Jill Stein," or "Undecided" and 3) "Republican Donald Trump," or "Democrat Joe Biden," "Libertarian Lars Mapstead," "Green Party Candidate Jill Stein," or "Undecided" shown below as 3-way long and 3-way short.
The panel (N = 600) were given three presidential preference sets of choices: 1) "Republican Donald Trump," or "Democrat Joe Harris," shown above as 2-way, 2) "Republican Donald Trump,", "Democrat Joe Harris," "Independent Robert F. Kennedy, Jr," "Independent Cornel West," "Libertarian Lars Mapstead," "Green Party Candidate Jill Stein," or "Undecided" and 3) "Republican Donald Trump," or "Democrat Joe Harris," "Libertarian Lars Mapstead," "Green Party Candidate Jill Stein," or "Undecided" shown below as 3-way long and 3-way short.

~~~
<img src="https://careaga.s3-us-west-2.amazonaws.com/img/mar_ws_3_long.png" style="width: 100%; display: block;">
Expand Down
140 changes: 70 additions & 70 deletions _assets/objs/outcome.csv
Original file line number Diff line number Diff line change
Expand Up @@ -56,73 +56,73 @@ PA and NC,35,260,278,Trump
"NV, WI, AZ and NC",43,268,270,Trump
"AZ, GA and NC",43,268,270,Trump
"WI, MI and PA",44,269,269,Tie
"WI, GA and PA",45,270,268,Biden
"WI, PA and NC",45,270,268,Biden
"AZ, MI and PA",45,270,268,Biden
"NV, WI, AZ and PA",46,271,267,Biden
"AZ, GA and PA",46,271,267,Biden
"AZ, PA and NC",46,271,267,Biden
"NV, WI, GA and MI",47,272,266,Biden
"NV, WI, MI and NC",47,272,266,Biden
"GA, MI and NC",47,272,266,Biden
"NV, WI, GA and NC",48,273,265,Biden
"NV, AZ, GA and MI",48,273,265,Biden
"NV, AZ, MI and NC",48,273,265,Biden
"NV, AZ, GA and NC",49,274,264,Biden
"NV, WI, MI and PA",50,275,263,Biden
"GA, MI and PA",50,275,263,Biden
"MI, PA and NC",50,275,263,Biden
"NV, WI, GA and PA",51,276,262,Biden
"NV, WI, PA and NC",51,276,262,Biden
"NV, AZ, MI and PA",51,276,262,Biden
"GA, PA and NC",51,276,262,Biden
"NV, AZ, GA and PA",52,277,261,Biden
"NV, AZ, PA and NC",52,277,261,Biden
"WI, AZ, GA and MI",52,277,261,Biden
"WI, AZ, MI and NC",52,277,261,Biden
"NV, GA, MI and NC",53,278,260,Biden
"WI, AZ, GA and NC",53,278,260,Biden
"WI, AZ, MI and PA",55,280,258,Biden
"NV, GA, MI and PA",56,281,257,Biden
"NV, MI, PA and NC",56,281,257,Biden
"WI, AZ, GA and PA",56,281,257,Biden
"WI, AZ, PA and NC",56,281,257,Biden
"NV, GA, PA and NC",57,282,256,Biden
"WI, GA, MI and NC",57,282,256,Biden
"NV, WI, AZ, GA and MI",58,283,255,Biden
"NV, WI, AZ, MI and NC",58,283,255,Biden
"AZ, GA, MI and NC",58,283,255,Biden
"NV, WI, AZ, GA and NC",59,284,254,Biden
"WI, GA, MI and PA",60,285,253,Biden
"WI, MI, PA and NC",60,285,253,Biden
"NV, WI, AZ, MI and PA",61,286,252,Biden
"WI, GA, PA and NC",61,286,252,Biden
"AZ, GA, MI and PA",61,286,252,Biden
"AZ, MI, PA and NC",61,286,252,Biden
"NV, WI, AZ, GA and PA",62,287,251,Biden
"NV, WI, AZ, PA and NC",62,287,251,Biden
"AZ, GA, PA and NC",62,287,251,Biden
"NV, WI, GA, MI and NC",63,288,250,Biden
"NV, AZ, GA, MI and NC",64,289,249,Biden
"NV, WI, GA, MI and PA",66,291,247,Biden
"NV, WI, MI, PA and NC",66,291,247,Biden
"GA, MI, PA and NC",66,291,247,Biden
"NV, WI, GA, PA and NC",67,292,246,Biden
"NV, AZ, GA, MI and PA",67,292,246,Biden
"NV, AZ, MI, PA and NC",67,292,246,Biden
"NV, AZ, GA, PA and NC",68,293,245,Biden
"WI, AZ, GA, MI and NC",68,293,245,Biden
"WI, AZ, GA, MI and PA",71,296,242,Biden
"WI, AZ, MI, PA and NC",71,296,242,Biden
"NV, GA, MI, PA and NC",72,297,241,Biden
"WI, AZ, GA, PA and NC",72,297,241,Biden
"NV, WI, AZ, GA, MI and NC",74,299,239,Biden
"WI, GA, MI, PA and NC",76,301,237,Biden
"AZ, GA, MI, PA and NC",77,302,236,Biden
"NV, WI, AZ, GA, MI and PA",77,302,236,Biden
"NV, WI, AZ, MI, PA and NC",77,302,236,Biden
"NV, WI, AZ, GA, PA and NC",78,303,235,Biden
"NV, WI, GA, MI, PA and NC",82,307,231,Biden
"NV, AZ, GA, MI, PA and NC",83,308,230,Biden
"WI, AZ, GA, MI, PA and NC",87,312,226,Biden
"NV, WI, AZ, GA, MI, PA and NC",93,318,220,Biden
"WI, GA and PA",45,270,268,Harris
"WI, PA and NC",45,270,268,Harris
"AZ, MI and PA",45,270,268,Harris
"NV, WI, AZ and PA",46,271,267,Harris
"AZ, GA and PA",46,271,267,Harris
"AZ, PA and NC",46,271,267,Harris
"NV, WI, GA and MI",47,272,266,Harris
"NV, WI, MI and NC",47,272,266,Harris
"GA, MI and NC",47,272,266,Harris
"NV, WI, GA and NC",48,273,265,Harris
"NV, AZ, GA and MI",48,273,265,Harris
"NV, AZ, MI and NC",48,273,265,Harris
"NV, AZ, GA and NC",49,274,264,Harris
"NV, WI, MI and PA",50,275,263,Harris
"GA, MI and PA",50,275,263,Harris
"MI, PA and NC",50,275,263,Harris
"NV, WI, GA and PA",51,276,262,Harris
"NV, WI, PA and NC",51,276,262,Harris
"NV, AZ, MI and PA",51,276,262,Harris
"GA, PA and NC",51,276,262,Harris
"NV, AZ, GA and PA",52,277,261,Harris
"NV, AZ, PA and NC",52,277,261,Harris
"WI, AZ, GA and MI",52,277,261,Harris
"WI, AZ, MI and NC",52,277,261,Harris
"NV, GA, MI and NC",53,278,260,Harris
"WI, AZ, GA and NC",53,278,260,Harris
"WI, AZ, MI and PA",55,280,258,Harris
"NV, GA, MI and PA",56,281,257,Harris
"NV, MI, PA and NC",56,281,257,Harris
"WI, AZ, GA and PA",56,281,257,Harris
"WI, AZ, PA and NC",56,281,257,Harris
"NV, GA, PA and NC",57,282,256,Harris
"WI, GA, MI and NC",57,282,256,Harris
"NV, WI, AZ, GA and MI",58,283,255,Harris
"NV, WI, AZ, MI and NC",58,283,255,Harris
"AZ, GA, MI and NC",58,283,255,Harris
"NV, WI, AZ, GA and NC",59,284,254,Harris
"WI, GA, MI and PA",60,285,253,Harris
"WI, MI, PA and NC",60,285,253,Harris
"NV, WI, AZ, MI and PA",61,286,252,Harris
"WI, GA, PA and NC",61,286,252,Harris
"AZ, GA, MI and PA",61,286,252,Harris
"AZ, MI, PA and NC",61,286,252,Harris
"NV, WI, AZ, GA and PA",62,287,251,Harris
"NV, WI, AZ, PA and NC",62,287,251,Harris
"AZ, GA, PA and NC",62,287,251,Harris
"NV, WI, GA, MI and NC",63,288,250,Harris
"NV, AZ, GA, MI and NC",64,289,249,Harris
"NV, WI, GA, MI and PA",66,291,247,Harris
"NV, WI, MI, PA and NC",66,291,247,Harris
"GA, MI, PA and NC",66,291,247,Harris
"NV, WI, GA, PA and NC",67,292,246,Harris
"NV, AZ, GA, MI and PA",67,292,246,Harris
"NV, AZ, MI, PA and NC",67,292,246,Harris
"NV, AZ, GA, PA and NC",68,293,245,Harris
"WI, AZ, GA, MI and NC",68,293,245,Harris
"WI, AZ, GA, MI and PA",71,296,242,Harris
"WI, AZ, MI, PA and NC",71,296,242,Harris
"NV, GA, MI, PA and NC",72,297,241,Harris
"WI, AZ, GA, PA and NC",72,297,241,Harris
"NV, WI, AZ, GA, MI and NC",74,299,239,Harris
"WI, GA, MI, PA and NC",76,301,237,Harris
"AZ, GA, MI, PA and NC",77,302,236,Harris
"NV, WI, AZ, GA, MI and PA",77,302,236,Harris
"NV, WI, AZ, MI, PA and NC",77,302,236,Harris
"NV, WI, AZ, GA, PA and NC",78,303,235,Harris
"NV, WI, GA, MI, PA and NC",82,307,231,Harris
"NV, AZ, GA, MI, PA and NC",83,308,230,Harris
"WI, AZ, GA, MI, PA and NC",87,312,226,Harris
"NV, WI, AZ, GA, MI, PA and NC",93,318,220,Harris
4 changes: 2 additions & 2 deletions _assets/scripts/CreateOutcomes.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# purpose: create a dataframe `outcomes` with variables state containing states
# that vote in combination in the sample space, the collective electoral votes
# and whether that results in a Biden win, loss or draw
# and whether that results in a Harris win, loss or draw

using CSV
using DataFrames
Expand Down Expand Up @@ -69,6 +69,6 @@ outcome.result = Vector{String}(undef, size(outcome, 1))

outcome.result[outcome[:,:biden] .< TIE] .= "Trump"
outcome.result[outcome[:,:biden] .== TIE] .= "Tie"
outcome.result[outcome[:,:biden] .> TIE] .= "Biden"
outcome.result[outcome[:,:biden] .> TIE] .= "Harris"

# CSV.write(""/Users/ro/projects/swingwatch/_assets/objs/outcome.csv",outcome)
2 changes: 1 addition & 1 deletion _assets/scripts/alt_swing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ outcome.result = Vector{String}(undef, size(outcome, 1))

outcome.result[outcome[:,:biden] .< TIE] .= "Trump"
outcome.result[outcome[:,:biden] .== TIE] .= "Tie"
outcome.result[outcome[:,:biden] .> TIE] .= "Biden"
outcome.result[outcome[:,:biden] .> TIE] .= "Harris"

states = collect(keys(votes))

4 changes: 2 additions & 2 deletions _assets/scripts/bayes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,15 @@ end
"""
normalize_poll(poll::Poll)
Normalizes the poll results for Biden and Trump by dividing their respective support values
Normalizes the poll results for Harris and Trump by dividing their respective support values
by the total support, and returns a `NormalizedPoll` object with the normalized values and sample size.
# Arguments
- `poll::Poll`: A `Poll` object containing the raw poll data, including `biden_support`, `trump_support`, and `sample_size` fields.
# Returns
- `NormalizedPoll`: A `NormalizedPoll` object with the following fields:
- `normalized_biden::Float64`: The normalized support for Biden (between 0 and 1).
- `normalized_biden::Float64`: The normalized support for Harris (between 0 and 1).
- `normalized_trump::Float64`: The normalized support for Trump (between 0 and 1).
- `sample_size::Int64`: The sample size of the poll.
Expand Down
Loading

0 comments on commit 31937a7

Please sign in to comment.