Last data update: 2014.03.03
R: Political knowledge in the US and Europe
politicalKnowledge R Documentation
Political knowledge in the US and Europe
Description
Data from McChesney and Nichols (2010) on domestic and international
knowledge in Denmark, Finland, the UK and the US among college
graduates, people with some college, and roughly 12th grade only.
Usage
data(politicalKnowledge)
Format
A data.frame
containing 12 columns and 4 rows.
country
a character vector of Denmark, Finland, UK, and
US, being the four countries comparied in this data set.
DomesticKnowledge.hs, DomesticKnowledge.sc,
DomesticKnowledge.c
percent correct answers to calibrated questions regarding
knowledge of prominent items in domestic news in a
survey of residents of the four countries among college
graduates (ending ".c"), some college (".sc") and
high school ("hs"). Source: McChesney and Nichols
(2010, chapter 1, chart 8).
InternationalKnowledge.hs, InternationalKnowledge.sc,
InternationalKnowledge.c
percent correct answers to calibrated questions regarding
knowledge of prominent items in international news in a
survey of residents of the four countries by education
level as for DomesticKnowledge. Source: McChesney and
Nichols (2010, chapter 1, chart 7).
PoliticalKnowledge.hs, PoliticalKnowledge.sc,
PoliticalKnowledge.c
average of domestic and international knowledge
PublicMediaPerCapita
Per capital spending on public media in 2007
in US dollars from McChesney and Nichols (2010,
chapter 4, chart 1)
PublicMediaRel2US
Spending on public media relative to the US, being
PublicMediaPerCapita / PublicMediaPerCapita[4]
.
Author(s)
Spencer Graves
Source
Robert W. McChesney and John Nichols (2010) The Death and
Life of American Journalism (Nation Books)
Examples
##
## 1. Combine first 2 rows
##
data(politicalKnowledge)
pk <- politicalKnowledge[-1,]
pk[1, -1] <- ((politicalKnowledge[1, -1] +
politicalKnowledge[2, -1])/2)
pk[1, 'country'] <- 'DK-FI'
##
## 2. plot
##
xlim <- range(pk[, 'PublicMediaPerCapita'])
ylim <- 100*range(pk[2:7])
text.cex <- 2
# to label the lines
(US.UK <- (pk[2, -1]+pk[3, -1])/2)
#png('Knowledge v. public media.png')
op <- par(mar=c(5, 7, 4, 2)+.1)
plot(c(0, 110), 100*ylim, type='n', axes=FALSE,
xlab='public media $ per capita',
ylab='Political Knowledge\n(% of standard questions)',
cex.lab=2)
axis(1, cex.axis=2)
axis(2, las=2, cex.axis=2)
with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
country, cex=text.cex, xpd=NA,
col=c('forestgreen', 'orange', 'red')))
with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
country, cex=text.cex, xpd=NA,
col=c('forestgreen', 'orange', 'red')))
with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
country, cex=text.cex, xpd=NA,
col=c('forestgreen', 'orange', 'red')))
with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
type='b', pch=' '))
with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
type='b', pch=' '))
with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
type='b', pch=' '))
with(US.UK, text(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
'High School\nor less', srt=37, cex=1.5))
with(US.UK, text(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
'some\ncollege', srt=10.5, cex=1.5))
with(US.UK, text(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
"Bachelor's\nor more", srt=-1, cex=1.5))
par(op)
#dev.off()
##
## redo for Wikimedia commons
## without English axis labels
## to facilitate multilingual use
##
#svg('Knowledge v. public media.svg')
op <- par(mar=c(3,3,2,2)+.1)
plot(c(0, 110), 100*ylim, type='n', axes=FALSE,
xlab='', ylab='', cex.lab=2)
axis(1, cex.axis=2)
axis(2, las=2, cex.axis=2)
with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
country, cex=text.cex, xpd=NA,
col=c('forestgreen', 'orange', 'red')))
with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
country, cex=text.cex, xpd=NA,
col=c('forestgreen', 'orange', 'red')))
with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
country, cex=text.cex, xpd=NA,
col=c('forestgreen', 'orange', 'red')))
with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
type='b', pch=' '))
with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
type='b', pch=' '))
with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
type='b', pch=' '))
par(op)
#dev.off()
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Ecdat)
Loading required package: Ecfun
Attaching package: 'Ecfun'
The following object is masked from 'package:base':
sign
Attaching package: 'Ecdat'
The following object is masked from 'package:datasets':
Orange
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Ecdat/politicalKnowledge.Rd_%03d_medium.png", width=480, height=480)
> ### Name: politicalKnowledge
> ### Title: Political knowledge in the US and Europe
> ### Aliases: politicalKnowledge
> ### Keywords: datasets
>
> ### ** Examples
>
> ##
> ## 1. Combine first 2 rows
> ##
> data(politicalKnowledge)
> pk <- politicalKnowledge[-1,]
> pk[1, -1] <- ((politicalKnowledge[1, -1] +
+ politicalKnowledge[2, -1])/2)
> pk[1, 'country'] <- 'DK-FI'
>
> ##
> ## 2. plot
> ##
> xlim <- range(pk[, 'PublicMediaPerCapita'])
> ylim <- 100*range(pk[2:7])
> text.cex <- 2
>
> # to label the lines
> (US.UK <- (pk[2, -1]+pk[3, -1])/2)
DomesticKnowledge.hs DomesticKnowledge.sc DomesticKnowledge.c
3 0.51 0.63 0.745
InternationalKnowledge.hs InternationalKnowledge.sc InternationalKnowledge.c
3 0.37 0.48 0.665
PoliticalKnowledge.hs PoliticalKnowledge.sc PoliticalKnowledge.c
3 0.44 0.555 0.705
PublicMediaPerCapita PublicMediaRel2US
3 40.675 30.13
>
> #png('Knowledge v. public media.png')
> op <- par(mar=c(5, 7, 4, 2)+.1)
> plot(c(0, 110), 100*ylim, type='n', axes=FALSE,
+ xlab='public media $ per capita',
+ ylab='Political Knowledge\n(% of standard questions)',
+ cex.lab=2)
> axis(1, cex.axis=2)
> axis(2, las=2, cex.axis=2)
> with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
+ country, cex=text.cex, xpd=NA,
+ col=c('forestgreen', 'orange', 'red')))
> with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
+ country, cex=text.cex, xpd=NA,
+ col=c('forestgreen', 'orange', 'red')))
> with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
+ country, cex=text.cex, xpd=NA,
+ col=c('forestgreen', 'orange', 'red')))
> with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
+ type='b', pch=' '))
> with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
+ type='b', pch=' '))
> with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
+ type='b', pch=' '))
> with(US.UK, text(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
+ 'High School\nor less', srt=37, cex=1.5))
> with(US.UK, text(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
+ 'some\ncollege', srt=10.5, cex=1.5))
> with(US.UK, text(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
+ "Bachelor's\nor more", srt=-1, cex=1.5))
>
> par(op)
> #dev.off()
>
> ##
> ## redo for Wikimedia commons
> ## without English axis labels
> ## to facilitate multilingual use
> ##
> #svg('Knowledge v. public media.svg')
> op <- par(mar=c(3,3,2,2)+.1)
> plot(c(0, 110), 100*ylim, type='n', axes=FALSE,
+ xlab='', ylab='', cex.lab=2)
> axis(1, cex.axis=2)
> axis(2, las=2, cex.axis=2)
> with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
+ country, cex=text.cex, xpd=NA,
+ col=c('forestgreen', 'orange', 'red')))
> with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
+ country, cex=text.cex, xpd=NA,
+ col=c('forestgreen', 'orange', 'red')))
> with(pk, text(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
+ country, cex=text.cex, xpd=NA,
+ col=c('forestgreen', 'orange', 'red')))
> with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.hs,
+ type='b', pch=' '))
> with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.sc,
+ type='b', pch=' '))
> with(pk, lines(PublicMediaPerCapita, 100*PoliticalKnowledge.c,
+ type='b', pch=' '))
> par(op)
> #dev.off()
>
>
>
>
>
>
> dev.off()
null device
1
>