Poll Average Details- -
The Poll Average is a weighted and adjusted number.
[Mid Date Column] All times are calculated by the middle date of the poll if it spans multiple days.
A time window of 2 months prior to the most recent poll is used.
[Time Weight Column] Polls are weighted in the amount they contribute to the final results in a linear fashion in this time window -
the newest poll has a weight of 1, a poll 30 days prior will have a weight of 0.5 and a poll 60 days out will have a weight of 0.
If the same pollster has more than one poll in this time period, only the newest will be used.
[Internal Column] If a poll is marked as being an internal poll for one of the candidates, it's weight will be halved.
[Candidate Columns, Bias] OurCampaigns has calculated partisan bias figures for all Polling Firms based on data from final vote totals
in races they have polled. These amounts are subtracted from the poll result - in the case the bias figure is negative it will effectively
be added to the poll result and appear as two dashes (minus a negative = plus).
[TOTAL Row] The adjusted weights are summed for each poll result and the adjusted poll results for each candidate are multiplied by the poll weight and then summed.
Each candidate's poll sum is divided by their weight sum to give the total.
SELECT FirstName as CFN,LastName as CLN,CandidateLink as CL,PollAvg CPA FROM RaceMember JOIN Candidate ON CandidateID=CandidateLink WHERE RaceLink= AND RaceMember.PartyLink= AND DropoutDate='0000-00-00' ORDER BY PollAvg;OUTPUT NIL
SELECT FirstName as CFN,LastName as CLN,CandidateLink as CL FROM Leaning JOIN Candidate ON CandidateID=CandidateLink WHERE RaceLink= AND UserLink=1;OUTPUT NIL
=$in{PCL}>=$in{PCFN}>=$in{PCLN}>
SELECT * FROM Race WHERE ParentContainer= AND TakesSeat!='Y' AND TakeOffice= ORDER BY PollEnd DESC;OUTPUT
Calculate Poll Average
SELECT (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) FMidDay FROM Poll WHERE AttachTo='Race' AND AttachID= ORDER BY (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) DESC LIMIT 1;OUTPUT NIL
| Poll | Mid Date | Time Weight | Internal |
,Safe> ,Safe> |
SELECT CandidateLink,r.PartyLink,FirstName,LastName,Color FROM RaceMember as r,Candidate,Party as p WHERE RaceLink= AND DropoutDate='0000-00-00' AND CandidateID=CandidateLink AND PartyID=r.PartyLink ORDER BY PollAvg DESC,CandidateID;OUTPUT ShowHeaders
SELECT RaceID,Title,Color,Name,CandidateID,FirstName,LastName,Photo,PollEnd,TakeOffice,TermEnd,WinVotes,SecondVotes,MaxWinners,AllVotes FROM Race,Candidate,RaceMember,Party
WHERE ParentContainer= AND TakesSeat='Y' AND Type='General Election' AND PollEnd < AND CandidateID=Winner AND RaceLink=RaceID AND CandidateLink=Winner AND PartyID=RaceMember.PartyLink ORDER BY PollEnd DESC,TakeOffice DESC LIMIT 1;OUTPUT NIL
| // | X 0.25 | |
=$in{'PVotes'.$in{PartyLink}}+$in{FinalVoteTotal}>
SELECT PartyLink,FinalVoteTotal FROM RaceMember WHERE RaceLink=;OUTPUT CalcAvg
|
=$in{'PFW'.$in{CandidateLink}}+0.25>=$in{'PFA'.$in{CandidateLink}}+($in{TPcnt}*0.25)>
SELECT PartyLink,CandidateLink FROM RaceMember WHERE RaceLink= AND DropoutDate='0000-00-00' ORDER BY PollAvg DESC,CandidateLink;OUTPUT SetAverage
Bias=$in{Bias}>
=$in{'PFW'.$in{CandidateLink}}+$in{ThisWeight}>=$in{'PFA'.$in{CandidateLink}}+(($in{Result}-$in{'PF'.$in{PollingFirmLink}.'Bias'.$in{PartyPLink}})*$in{ThisWeight})>
=' - Bias,Safe> bias'>
,Safe> | =''>
| | X |
X 1/2 |
SELECT PartyLink,Bias FROM PollFirmBias WHERE PollFirmLink=;OUTPUT GetPFBias
SELECT AttachID CandidateLink,PartyPLink,Result FROM PollResult WHERE AttachTo='Candidate' AND ParentPoll= AND Grouping=;OUTPUT EachPollRes
SELECT CandidateLink FROM RaceMember WHERE RaceLink= AND DropoutDate='0000-00-00' ORDER BY PollAvg DESC,CandidateLink;OUTPUT DisplayCol
='Y'>
SELECT PollID TPID,Name,PollStart,PollEnd,(TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) as MidDay,DATE_FORMAT(FROM_DAYS((TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart)),'%c/%e') as MidDayF,PollingFirmLink,InternalFor,WinGroup FROM Poll,PollingFirm WHERE InvalidPoll='' AND AttachTo='Race' AND AttachID= AND (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) > AND PollingFirmID=PollingFirmLink ORDER BY (TO_DAYS(PollEnd)-TO_DAYS(PollStart))+TO_DAYS(PollStart) DESC;OUTPUT
0>
0>
|
UPDATE RaceMember SET PollAvg= WHERE RaceLink= AND CandidateLink=;FINISH
| TOTAL |
SELECT CandidateLink FROM RaceMember WHERE RaceLink= AND DropoutDate='0000-00-00' ORDER BY PollAvg DESC,CandidateLink;OUTPUT SetAverage
if ($in{OfficeLink} == 585999999) {
$xtmp=`curl -s 'https://www.ourcampaigns.com/OverviewMapPresGen.php'`;
}