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

  • Finally, you can manage your Google Docs, uploads, and email attachments (plus Dropbox and Slack files) in one convenient place. Claim a free account, and in less than 2 minutes, Dokkio (from the makers of PBworks) can automatically organize your content for you.

View
 

AMOWithCode

Page history last edited by PBworks 14 years, 7 months ago

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 the graph below published in this recent series of Lloyd's 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.