R Dataset / Package pscl / presidentialElections
Attachment | Size |
---|---|
dataset-31287.csv | 28.72 KB |
Documentation |
---|
On this Picostat.com statistics page, you will find information about the presidentialElections data set which pertains to elections for U.S. President, 1932-2012, by state. The presidentialElections data set is found in the pscl R package. Try to load the presidentialElections data set in R by issuing the following command at the console data("presidentialElections"). This may load the data into a variable called presidentialElections. If R says the presidentialElections data set is not found, you can try installing the package by issuing this command install.packages("pscl") and then attempt to reload the data with library("pscl") followed by data("presidentialElections"). Perhaps strangley, if R gives you no output after entering a command, it means the command succeeded. If it succeeded you can see the data by typing presidentialElections at the command-line which should display the entire dataset. If you need to download R, you can go to the R project website. You can download a CSV (comma separated values) version of the presidentialElections R data set. The size of this file is about 29,408 bytes. elections for U.S. President, 1932-2012, by stateDescriptionDemocratic share of the presidential vote, 1932-2012, in each state and the District of Columbia. Usagedata(presidentialElections) Format
Note1,047 observations, unbalanced panel data in long format. Hawaii and Alaska contribute data from 1960 onwards the District of Columbia contributes data from 1964 onward; Alabama has missing data for 1948 and 1964. SourceDavid Leip's Atlas of U.S. Presidential Elections http://uselectionsatlas.org Examplesdata(presidentialElections) lattice::xyplot(demVote ~ year | state, panel=panel.lines, ylab="Democratic Vote for President (percent)", xlab="Year", data=presidentialElections, scales=list(y=list(cex=.6),x=list(cex=.35)), strip=strip.custom(par.strip.text=list(cex=.6)))## Obama vs Kerry, except DC y08 <- presidentialElections$year==2008 y04 <- presidentialElections$year==2004 tmpData <- merge(y=presidentialElections[y08,], x=presidentialElections[y04,], by="state") tmpData <- tmpData[tmpData$state!="DC",] xlim <- range(tmpData$demVote.x,tmpData$demVote.y) col <- rep("black",dim(tmpData)[1]) col[tmpData$south.x] <- "red"plot(demVote.y ~ demVote.x, xlab="Kerry Vote Share, 2004 (percent)", ylab="Obama Vote Share, 2008 (percent)", xlim=xlim, ylim=xlim, type="n", las=1, data=tmpData) abline(0,1,lwd=2,col=gray(.65)) ols <- lm(demVote.y ~ demVote.x, data=tmpData) abline(ols,lwd=2) text(tmpData$demVote.x, tmpData$demVote.y, tmpData$state, col=col, cex=.65) legend(x="topleft", bty="n", lwd=c(2,2), col=c(gray(.65),"black"), legend=c("No Change from 2004","Regression")) legend(x="bottomright", bty="n", text.col=c("red","black"), legend=c("South","Non-South")) -- Dataset imported from https://www.r-project.org. |
Picostat Manual |
---|
How To Register With a Username
How To Register With Google Single Sign On (SSO)
How To Login With a Username and Password
How To Login With Google Single Sign On (SSO)
How To Import a Dataset
How To Perform Statistical Analysis with Picostat
How To Use Educational Applications with Picostat
|
Recent Queries For This Dataset |
---|
No queries made on this dataset yet. |
Title | Authored on | Content type |
---|---|---|
R Dataset / Package Stat2Data / TwinsLungs | March 9, 2018 - 1:06 PM | Dataset |
R Dataset / Package DAAG / psid1 | March 9, 2018 - 1:06 PM | Dataset |
R Dataset / Package quantreg / gasprice | March 9, 2018 - 1:06 PM | Dataset |
R Dataset / Package datasets / nottem | March 9, 2018 - 1:06 PM | Dataset |
R Dataset / Package DAAG / hills2000 | March 9, 2018 - 1:06 PM | Dataset |