happiness | R Documentation |
Dataset on subjective happiness, tax rates, population sizes, continent, and major religion for 148 countries
A data frame with 148 observations on the following 6 variables.
a factor with 148 levels that contain the country names
a numeric vector with the average subject happiness score (on a scale from 0-10)
a numeric vector showing the tax revenue as percentage of GDP
a factor with levels Buddhist
Christian
Hindu
Muslim
None
or Other
a factor with levels AF
, AS
,
EU
, NA
, OC
, SA
, corresponding to the continents
Africa, Asia, Europe, North America, Ocenaia, South American, respectively
a numeric vector showing the population (in millions)
Data collected by Ellen Ekstroem.
Population sizes are from
Wikipedia per August 2nd, 2012
https://en.wikipedia.org/wiki/List_of_countries_by_population
Major
religions are from Wikipedia per August 2nd, 2012
https://en.wikipedia.org/wiki/Religions_by_country
Tax rates are
from Wikipedia per August 2nd, 2012
https://en.wikipedia.org/wiki/List_of_countries_by_tax_revenue_as_percentage_of_GDP
Average happiness scores are from "Veenhoven, R. Average happiness in
148 nations 2000-2009, World Database of Happiness, Erasmus University
Rotterdam, The Netherlands". Assessed on August 2nd, 2012 at:
https://worlddatabaseofhappiness-archive.eur.nl/hap_nat/findingreports/RankReport_AverageHappiness.php
data(happiness)
with(happiness, symbols(tax, happy, circles=sqrt(population)/8, inches=FALSE, bg=continent))
#
# Make a prettier image with transparent colors
#
newcols <- rgb(t(col2rgb(palette())),
alpha=100, maxColorValue=255)
with(happiness, symbols(tax, happy, circles=sqrt(population)/8,
inches=FALSE, bg=newcols[continent],
xlab="Tax (% of GDP)", ylab="Happiness"))
#
# Simple analysis
#
res <- lm(happy ~ religion + population + tax:continent, data=happiness)
summary(res)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.