39
Quantitative Data Analysis Data exploration and graphics

Data exploration and graphics with R

Embed Size (px)

DESCRIPTION

Quantitative Data Analysis - Part II: Data exploration and graphics - Master in Global Environmental Change - IE University

Citation preview

Page 1: Data exploration and graphics with R

Quantitative Data Analysis

Data exploration and graphics

Page 2: Data exploration and graphics with R

Is global warming real?

http://chartgraphs.wordpress.com

Page 3: Data exploration and graphics with R

Russian most extreme summer

http://joewheatley.net/russian-grain/

Page 4: Data exploration and graphics with R

Is the world a fair place?

http://www.gapminder.org/world

Page 5: Data exploration and graphics with R
Page 6: Data exploration and graphics with R

acpclust.R

Page 7: Data exploration and graphics with R

More linkshttp://www.statmethods.net/http://addictedtor.free.fr/graphiques/http://socserv.mcmaster.ca/jfox/Misc/Rcmdr/

Page 8: Data exploration and graphics with R

Plots and charts

Page 9: Data exploration and graphics with R

Low level functions

Page 10: Data exploration and graphics with R

graphical parameters: par()

Page 11: Data exploration and graphics with R

Lattice package

Page 12: Data exploration and graphics with R

Curves and functionsx<-seq(-2,2,0.01)y<-x^3-3*xplot(x,y,type="l")

Orcurve(x^3-3*x, -2, 2)

Page 13: Data exploration and graphics with R

Histogram

Page 14: Data exploration and graphics with R

histogram

histogram(~Countries$Population|Countries$Region)

Page 15: Data exploration and graphics with R

histogram

Page 16: Data exploration and graphics with R

histogramhistogram(~Population|Region,data=Countries, col=2:6,panel=function(x,...,col) { panel.histogram(x,...,col=col[packet.number()])})

Page 17: Data exploration and graphics with R

Pie chart

data<-read.csv("data\\piedata.csv",header=T)pie(data$amounts,labels=as.character(data$names))

Page 18: Data exploration and graphics with R

Boxplot/Barplot

source("boxplot.R")

Page 19: Data exploration and graphics with R

barplot

Barplot(tapply(Countries$Population,Countries$Region,sum) ,main="Population",col=rainbow(nlevels(Countries$Region)))

Page 20: Data exploration and graphics with R

scatterplots

source(“scatterplot.R")

Page 21: Data exploration and graphics with R

Bubble plot

source("bubble.R")

Page 22: Data exploration and graphics with R

Time series

source(“ts.R”)

Page 23: Data exploration and graphics with R

coplot

source("ozone.R")

Page 24: Data exploration and graphics with R

Interaction plot

source("interaction.R")

Page 25: Data exploration and graphics with R

Quantitative Data Analysis

Data preprocessing

Page 26: Data exploration and graphics with R

Missing valuesRemove the cases with unknownsFill in the unknown values by exploring the properties of the variableFill in the unknown values by exploring the correlations between variablesFill in the unknown values by exploring the similarity between cases

Page 27: Data exploration and graphics with R

Transformations of the response and explanatory variables

Linearize the relationship between the response and the explanatory variableslogy against x for exponential relationships;logy against logx for power functions;expy against x for logarithmic relationships;1/y against 1/x for asymptotic relationships;logp/1−p againstx for proportion data.Other transformations are useful for variance stabilization: √y to stabilize the variance for count data; arcsin(y) to stabilize the variance of percentage data.

Page 28: Data exploration and graphics with R

Quantitative Data Analysis

Data modelling

Page 29: Data exploration and graphics with R

Exponential functions

exp.R

Page 30: Data exploration and graphics with R

Power functions

power.R

Page 31: Data exploration and graphics with R

Polynomial functions

polinomials.R

Page 32: Data exploration and graphics with R

Inverse polynomial

invpol.R

Page 33: Data exploration and graphics with R

Gamma function

gamma.R

Page 34: Data exploration and graphics with R

Asymptotic functions

Page 35: Data exploration and graphics with R

Asymptotic functions

michaelis.R

Page 36: Data exploration and graphics with R

Asymptotic functions

logistic.R

Page 37: Data exploration and graphics with R

fitting1.R

Page 38: Data exploration and graphics with R

fitting2.R

Page 39: Data exploration and graphics with R

fitting3.R