GEOF 301 Statistikkpakken - PowerPoint PPT Presentation

1 / 22
About This Presentation
Title:

GEOF 301 Statistikkpakken

Description:

R can be used in several OS (Mac, Windows og Linux) It can be downloaded from: ... To achieve the documentation of a commando: ?solve eller help(solve) NB: R is ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 23
Provided by: Bjerknes
Category:

less

Transcript and Presenter's Notes

Title: GEOF 301 Statistikkpakken


1
GEOF 301Statistikkpakken
  • Dag Johan Steinskog
  • Ph.D. student
  • NERSC/BCCR

2
The plan for Statistikkpakken
  • 1st hour Talk and discussion about statistics
    and software
  • 2nd and 3rd hour You do three exercises working
    with statistically software
  • Please ask a lot of questions!!!!

3
This is only a teaser.
  • These courses should be considered
  • Pure statistics
  • STAT 110,STAT 111, STAT 200, STAT201 etc.
  • Geofysics and statistics
  • GEOF 210

4
After three hours you should expect to
  • Know something about simple statistics
  • Know something about R, and know where to look
    for help in statistical routines
  • Have seen the some of the purpose of statistics
  • However, not be an expert even trained
    statistians meet new challenges every day (I do
    so ?)!

5
What is statistics?
  • Major activities in statistics include
  • design of experiments and surveys to collect
    data (e.g. meteorological observation networks)
  • exploration and visualization of sample data
    (e.g. graphs, maps, tables)
  • summary description of sample data (e.g.
    climatology)
  • modelling relationships between variables (e.g.
    predictability studies)
  • stochastic modelling of uncertainty (e.g.
    stochastic parameterisations)
  • forecasting based on suitable models (e.g.
    seasonal forecasting)
  • hypothesis testing and statistical inference
    (e.g. detection and attribution of climate change)

6
Further.
  • Statistics is neither really a science nor a
    branch of mathematics. It is perhaps best
    considered as a meta-science (or language) for
    dealing with data collection, analysis, and
    interpretation. As such its scope is enormous and
    it provides much guiding insight in many branches
    of science, business, etc.
  • Critical statistical reasoning can be extremely
    useful for making sense of the ever increasing
    amount of information becoming available (e.g.
    via the web).
  • Knowledge of statistics is a very useful
    transferable skill!

7
Literature
  • Statistics and meteorology/oceanography
  • Statistical Analysis in Climate Research, by Hans
    von Storch and Francis W. Zwiers
  • Statistical Methods in the Atmospheric Sciences,
    Second Edition by Daniel S. Wilks
  • Basic Introduction
  • Introduction to Probability and Statistics for
    Engineers and Scientists, Third Edition, by
    Sheldon M. Ross

8
Some simple statistics
  • Centre/Location
  • Mean (m or x)
  • Median (x )
  • Scale/Spread
  • Standard deviation (s)
  • Interquartile range (IQR)
  • Shape
  • Skewness (e.g. b1)
  • Kurtosis (e.g. b2)

9
Shape
10
Statistical Software
  • Powerful language-based packages
  • S-PLUS, R, and SAS
  • Interactive packages
  • MINITAB and SPSS
  • Packages with statistical libraries
  • MATLAB and PV-Wave/IDL
  • Home made subroutines
  • Many climate researchers have a bad habit of
    doing statistics using subroutines in Fortran
    that they have either written by themselves,
    obtained from a friend, or copied from numerical
    recipes. This Do-It-Yourself cookbook approach
    has several disadvantages that include time being
    wasted reinventing the wheel programming routines
    rather than timebeing spent thinking about the
    appropriate choice of method etc., and lack of
    any input or contact with professional
    statisticians.

11
R
  • R is a free statistical software based on R.
  • R can be used in several OS (Mac, Windows og
    Linux)
  • It can be downloaded from
  • www.r-project.org
  • Lots of packages are available for you on the web!

12
RClim
  • A joint effort has been made to make R more
    suitable for climate researchers.
  • The initiative includes NERSC/BCCR and
    UCAR/Reading.
  • It will be launched in February 2006.
  • For more information, see
  • http//www.met.reading.ac.uk/cag/rclim/
  • http//www.nersc.no/dagjs/R.htm

13
Examples of RClim I
14
Examples from Rclim II
15
Examples from Rclim III
16
How to start up R?
  • Windows Simple click and run!
  • Linux Open a terminal window, and type the
    following
  • mkdir R/work
  • cd R/work
  • R
  • q() to quit

17
Helpful commands
  • To get up the help-page
  • help.start()
  • To achieve the documentation of a commando
  • ?solve eller help(solve)
  • NB R is case-sensitive
  • ls() to achieve an overview of objects.
  • Objects are variables, matrices, strings,
    functions or more generel structures build up by
    such components
  • rm() to delete obejcts
  • read.table() to read a dataset

18
A simple example
  • testlt-rnorm(100,3,4)
  • mean(test)
  • var(test)
  • sd(test)
  • summary(test)
  • median(test)
  • t.test(test,alternative"two.sided",mu7)
  • plot(test,typel,colred,lwd2)
  • We then end up with a figure looking like this
    one

19
Continuing the example
  • hist(test,col2)
  • ?hist
  • Does this indicate a normal distribution?
  • hist(test,col4,br40)
  • library(nortest)
  • shapiro.test(test)
  • Shapiro-Wilk normality test
  • data test
  • W 0.9918, p-value 0.8079

20
qq-plot
  • x11()
  • qqnorm(test)
  • qqline(test)
  • Library(fBasics)
  • skewness(test)
  • 1 0.1364627
  • kurtosis(test)
  • 1 -0.4187804

21
And finally
  • boxplot(test,maintest)
  • what is a boxplot?
  • acf(test)
  • What is auto-correlation function?

22
Quotations concerning statistics
  • There are three kinds of lies lies, damned lies,
    and statistics. (Benjamin Disrali)
  • Statistician A man who believes figures dont
    lie, but admits that under analysis some of them
    wont stand up either. (Evan Esar)
  • Statistics The only science that enables
    different experts using the same figures to draw
    different conclusions. (Evan Esar)
Write a Comment
User Comments (0)
About PowerShow.com