Title UN FAO Data

require(DCF)
## Loading required package: DCF
## Loading required package: mosaic
## Loading required package: lattice
## Loading required package: grid
## Loading required package: survival
## Loading required package: splines
## Loading required package: Hmisc
## Hmisc library by Frank E Harrell Jr
## 
## Type library(help='Hmisc'), ?Overview, or ?Hmisc.Overview') to see overall
## documentation.
## 
## NOTE:Hmisc no longer redefines [.factor to drop unused levels when
## subsetting.  To get the old behavior of Hmisc type dropUnusedLevels().
## Attaching package: 'Hmisc'
## The following object(s) are masked from 'package:survival':
## 
## untangle.specials
## The following object(s) are masked from 'package:base':
## 
## format.pval, round.POSIXt, trunc.POSIXt, units
## Attaching package: 'mosaic'
## The following object(s) are masked from 'package:Hmisc':
## 
## do
## The following object(s) are masked from 'package:stats':
## 
## D, binom.test, median, prop.test, sd, var
## The following object(s) are masked from 'package:base':
## 
## max, mean, min, print, sample
## Loading required package: ggplot2
## Loading required package: reshape2
## Loading required package: plyr
## Attaching package: 'plyr'
## The following object(s) are masked from 'package:mosaic':
## 
## count
## The following object(s) are masked from 'package:Hmisc':
## 
## is.discrete, summarize

We are going to analyze the FAO data based on country size and population. This document is a self contained report meaning that on top of document type in require (DCF)

Is there a clear relationship between area of a country and the total population?

data("FAOsimple")
ggplot(data = FAOsimple) + geom_point(aes(x = Country.area, y = Total.Population...Both.sexes))

plot of chunk unnamed-chunk-2

This plot, which looks at the relationship between population and country area,shows that in general there may be a trend that as the country area increases the population is larger. This is especially true for the cluster of countries in the bottom corner of the graph. But for the extreme examples (the countries with extremely large populations or extremely large country size) this trend is perhaps a bit less followed.

Is there a clear relationship between the fraction of a country's total land that is arable and the fraction of a country's total population that is engaged in agricultural work?

ggplot(data = FAOsimple) + geom_point(aes(x = Arable.land, y = Agricultural.population))
## Warning: Removed 7 rows containing missing values (geom_point).

plot of chunk unnamed-chunk-3

Perhaps there is a slight trend between arable land and the fraction of a country's total population that is engaged in agricultural work but many countries that have extremely large amounts of arable land relative to percent of the population that is engaged in agricultural work.

Now I must contruct the new variable population density

FAOsimple = transform(FAOsimple, pop.density = Total.Population...Both.sexes/Country.area)
ggplot(data = FAOsimple) + geom_point(aes(x = pop.density, y = Forest.area))

plot of chunk unnamed-chunk-4

As you can see by the graph, I created the variable 'pop.density' which represents the populations density by taking the total population of both sexes/country area which I then compared to the total area of forest a country has.

FAOsimple = transform(FAOsimple, pop.density.ag = Total.Population...Both.sexes/Agricultural.area)
ggplot(data = FAOsimple) + geom_point(aes(x = pop.density.ag, y = Forest.area))
## Warning: Removed 2 rows containing missing values (geom_point).

plot of chunk unnamed-chunk-5

As you can see by the graph above, I created the variable 'pop.density.ag' which represents the population density for agricultural land by taking the total population of both sexes/ the area of total agricultrual land which I then compared to the total area of forest a country has.

FAOsimple = transform(FAOsimple, pop.both = Total.Population...Male + Total.Population...Female)
ggplot(data = FAOsimple) + geom_point(aes(x = pop.both, y = Total.Population...Both.sexes))

plot of chunk unnamed-chunk-6

To make sure that the number of males and number of females adds up to the total population of a country I created the new variable 'pop.both' which is the variable 'Total.Population…Female' + 'Total.Population…Male'.