| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

AMOWithCode

This version was saved 17 years, 10 months ago View current version     Page history
Saved by PBworks
on June 12, 2006 at 10:18:50 am
 

AMO graph

 

R has very versatile graphical capabilities; it can also fit a variety of smoothers to the data.

 

As an example of this, some may have seen this graph http://toolkit.pbwiki.com/f/AMOAndHurricanes.jpeg published in this recent series of lloyds papers

 

Here is the R code which produces the graph. The AMO data can be found from here, the number of major hurricanes data was taken from this paper by Goldenburg, Gray et al from Science (Vol293, pg474) (you'll need a Science subscription). Note this data has been converted into a database which you can download below.

 

If you want to trial run the code you will need to:

 

* Download this database.

* Set up an ODBC link; naming the database "ClimateChangeData", here is how to do this (it really isnt hard).

* Make sure you have downloaded the R package RODBC; this is a really useful package which enables you to run SQL from R to query and write to an external database. Here is how to download packages.

* Run the R code through R

 

Note if you want to supress the individual data points (grey) then see the "typeVal" variable in the code and follow the comment.

 

Notes on the Graph:

 

* The two orange (smoothers) are gaussian Kernel Smoothers with a 10 year bandwidth

* The blue long term trend line for the AMO data is a 120 year bandwidth guassian Kernel smoother

* The blue long term trend line for the hurricane data is a simple linear regression through the data.

 

The first two bullets would have been time consuming to do in Excel; as usual the power of the R community wins!

Comments (0)

You don't have permission to comment on this page.