Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
man
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

Lifecycle: stable CRAN_Status_Badge Rdoc

Guerry

The Guerry package comprises maps of France in 1830, multivariate data from A.-M. Guerry and others, and statistical and graphic methods related to Guerry's Moral Statistics of France. The goal is to facilitate the exploration and development of statistical and graphic methods for multivariate data in a geo-spatial context of historical interest. The package stems from Friendly (2007).

Installation

You can install Guerry from CRAN with:

install.packages("Guerry")

You can install Guerry from github with:

# install.packages("devtools")
devtools::install_github("friendly/Guerry")

Examples

Guerry was most interested in determining whether the occurrence of crimes was related to literacy or other "moral variables". But the idea of correlation had not been invented, and he was not aware of the idea of a scatterplot.

Plotting crimes against persons vs. Literacy ("% who can read & write"). In this base R version, we might want to code the point symbols and colors by regions of France.

data(Guerry)

plot(Crime_pers ~ Literacy, data=Guerry,
	col=Region, 
	pch=(15:19)[Region],
	ylab = "Pop. per crime against persons",
	xlab = "Percent who can read & write"
	)

legend(x="bottomright", 
	legend = c("Center", "East", "North", "South", "West"), 
	pch = 15:19,
	col = as.factor(levels(Guerry$Region)))

Now try this with a data ellipse, and a regression line. This version also uses a a loess smooth and labels the 8 most outlying departments.

library(car)
with(Guerry,{
  dataEllipse(Literacy, Crime_pers,
      levels = 0.68,
      ylim = c(0,40000), xlim = c(0, 80),
      ylab="Pop. per crime against persons",
      xlab="Percent who can read & write",
      pch = 16,
      grid = FALSE,
      id = list(method="mahal", n = 8, labels=Department, location="avoid", cex=1.2),
      center.pch = 3, center.cex=5,
      cex.lab=1.5)
  dataEllipse(Literacy, Crime_pers,
      levels = 0.95, add=TRUE,
      ylim = c(0,40000), xlim = c(0, 80),
      lwd=2, lty="longdash",
      col="gray",
      center.pch = FALSE
      )

  abline( lm(Crime_pers ~ Literacy), lwd=2)	
  lines(loess.smooth(Literacy, Crime_pers), col="red", lwd=3)
  }
  	)

Vignettes

An old vignette for this package, Spatial Multivariate Analysis of Guerry's Data in R, written by Stephan Dray was removed from the package because it no longer complies with CRAN policies.

References

Friendly, M. (2007). A.-M. Guerry's Moral Statistics of France: Challenges for Multivariable Spatial Analysis. Statistical Science, 22, 368-399. http://www.datavis.ca/papers/guerry-STS241.pdf

Friendly, M. (2007). Supplementary materials for Andre-Michel Guerry's Moral Statistics of France: Challenges for Multivariate Spatial Analysis, http://www.datavis.ca/gallery/guerry/.

About

Maps, data and methods related to Guerry (1833) "Moral Statistics of France"

Resources

Packages

No packages published
You can’t perform that action at this time.