Learn R Programming

MESS (version 0.5.12)

happiness: Happiness score and tax rates for 148 countries

Description

Dataset on subjective happiness, tax rates, population sizes, continent, and major religion for 148 countries

Arguments

Format

A data frame with 148 observations on the following 6 variables.

country

a factor with 148 levels that contain the country names

happy

a numeric vector with the average subject happiness score (on a scale from 0-10)

tax

a numeric vector showing the tax revenue as percentage of GDP

religion

a factor with levels Buddhist Christian Hindu Muslim None or Other

continent

a factor with levels AF, AS, EU, NA, OC, SA, corresponding to the continents Africa, Asia, Europe, North America, Ocenaia, South American, respectively

population

a numeric vector showing the population (in millions)

Examples

Run this code

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)


Run the code above in your browser using DataLab