July 18, 2018

Getting started

Week 1

'Mathews…we are getting another of those strange 'aw blah es pan yol' sounds.'

Good communication is essential! We need…

  • A common language (English)
  • A platform (lectures, labs, tutorials, email, blackboard)
  • Some rules and common sense
  • A comfortable, safe work atmosphere, and fun!

Getting started

Week 1
  • A little bit about myself
  • The process of learning at uni (as opposed to high school…)
  • Why are we here? What do you expect?
  • Why come to lectures?
  • What makes good learning?
  • Relationship student-teacher, student-TA (make it interactive!)
  • Relationship student-student (learning groups!)
  • Learning and emotions, creativity (studies show that learning difficult stuff is associated with positive emotions!)

Getting started

Week 1
  • the twofold difficulty of learning statistics and R
  • the twofold reward of learning statistics and R!
  • with R, you are standing on the shoulder of giants!
  • The difficulty of teaching statistical concepts and R… (what first?)
  • This can make the start a bit tricky, but we are here to help!

My philosophy - or how not to fail this paper (evidence based!)

Week 1
  • COME TO YOUR LECTURES/LABS/TUTORIALS: those who are present tend to do well
  • Have the right attitude (YOU are responsible for your learning, we are here to help)
  • Be organised, time yourself: Revise your labs every single week!
  • Be creative, inquisitive, ask questions, don't miss the train!
  • Be realistic: 102 hours self-directed learning (as per paper descriptor) equates to 8.5 hours of homework per week, that's 2 afternoons/week!
  • Don't get lost in the ocean of available resources, choose one, stick to it, read!

My philosophy - or how to not fail this paper (evidence based!)

Week 1

Lectures and labs

Week 1
  • Lecture: Wednesdays 09:00 - 11.00 am, WE240
  • Be there there on time!
  • Labs in WZ337, but double-check all times/rooms
  • No labs in week 1

Lectures and labs

Week 1
  • Semester overview

    Stream Lab Tutorial
    1W WED 3 - 5 pm WZ337 WED 11 am - 12 pm WZ140
    2W MON 4.30 - 6.30 pm WZ337 MON 12 - 1 pm WZ141
    3W FRI 10.30 am - 12.30 pm WZ337 TUE 11 am - 12 pm WH415
    4W WED 1 - 3 pm WZ337 THU 11 am - 12 pm WZ140
    5W WED 5.30 pm - 7.30 pm WZ337 THU 10 - 11 am WH415

Course administration and structure

Week 1
  • Need to access blackboard and AUT email address regularly!
  • Change lab stream? Please see the Science office staff (WZ level 5)
  • Theory: midsemester test/exam (30/70)
  • Practical: 2 marks from lab reports (50/50)
  • Overall mark: theory/practical (70/30)
  • Calculate your overall mark as follows

\[(lab_1 \cdot 0.5 + lab_2 \cdot 0.5) \cdot 0.3 + (test \cdot 0.3 + exam \cdot 0.7) \cdot 0.7 \] - AND you need to pass both the practical and the theory!

Course administration and structure

Week 1
  • 100% presence during labs is required to (School policy)
  • If you can't attend a lab for a valid reason, contact the School office and fill in a form, we will try to accommodate you in another lab stream for that week
  • If you are sick or have other valid reasons for not attending a lab, apply for special consideration
  • Lab reports are due on Thursday 4 pm following the week of the lab
  • Labs to be submitted via turnitin only! (First one August 2, 4 pm, etc.)
  • Midsemester test: 1 hour in week 6 (August 21-25, during lab sessions)
  • Exam: 2 hours, exact date will be communicated, during weeks 13-15
  • Format of test and exam: short answer questions and multiple choice
  • Allowed documents: cheat sheet (single sided A4 page for the test, double sided for the exam), can be hand-written or typed

Example of an A4 'Cheat Sheet'

Week 1

Key elements to this paper

Week 1
  • A preview of what is to come at the beginning of a lecture ('learning outcomes')
  • A summary of what you should have learnt at the end of a lecture
  • A glossary at the end of the lecture
  • The lab reports: take them seriously, they are your foundation for passing this paper. Follow the rules, but be creative! Add to them, make them your personal little course manual!
  • Practice in them and with them!
  • E.g., take notes during the lectures, then put them into your lab reports under the section 'what have I learnt today…'
  • Please help me keep lectures and labs interactive. There is nothing better than a seemingly 'dumb question'!

Resources for this paper

Week 1

'If you want a stats lecturer, I'll do anything I can for you - I'm your man' (modified from Leonard Cohen)…but:

'Follow me the wise man said, but he walked behind.' (also by Leonard Cohen, unmodified)


I am here for you, but you first need to do your homework, come to lectures, do the labs, read up on things…

Resources for this paper

Week 1
  • MOST IMPORTANT: Lectures (your presence, your notes) and lab reports, including your own additions, tutorials
  • Slides from lectures (accessed via link and pdf sent out shortly before lectures)
  • Leuzinger S (2017), An Introduction to R ($20). Required and also used in other papers (SCIE602)

If you want to dig deeper

  • M.J. Crawley, The R Book, Springer (approx. $120), also available as free ebook from the AUT library

Slides are NOT enough! Not everything is online, if you are not in the lecture, it's up to you to figure out what's happened!

Timetable first half (tentative)

Week 1
Date Week Lab Report Topic
18.7. 1 - - Introduction, R, Rmarkdown
25.7. 2 1 - Hypotheses, variables, variation
1.8. 3 2 1 Organising data, measuring variation
8.8. 4 3 2 Distributions, quartiles, quantiles, probabilities
15.8. 5 4 3 Type I and type II error
22.8. 6 - 4 Week of midsemester test

Dates refer to lecture only!

Timetable second half (tentative)

Week 1
Date Week Lab Report Topic
12.9. 7 5 - The t-test
19.9. 8 6 5 The Chi-squared test, R coaching
26.9. 9 7 6 Statistical power, power test, plotting/tabulating data correctly
3.10. 10 8 7 Correlation analysis, scientific reporting
10.10. 11 9 8 Linear Regression
17.10. 12 10 9 Revision
24.10. 13 - 10 NA, lab 10 due on Thursday this week

Learning outcomes (from the paper outline)

Week 1

1. Demonstrate an understanding of biological variability and how it is measured and reported.

  • Explain systematic vs. unsystematic biological variation, explain accuracy and precision
  • Understand what a frequency distribution is
  • Be able to plot and interpret histograms
  • Be familiar with the most common distributions that are relevant for biological data sets (e.g. normal, uniform, poisson), be able to calculate probabilities and quantiles

Learning outcomes

Week 1

2. Demonstrate an understanding of sampling.

  • Explain the difference between a population and a sample
  • Know when to use the standard deviation vs. the standard error
  • Be able to design a simple biological experiment or observational study

Learning outcomes

Week 1

3. Demonstrate competence in basic biological and ecological data analyses

  • Be able to organise and process biological data sets
  • Use a series of simple tests like the t-test, correlation test, regression, Chi-squared, and their non-parametric alternatives where applicable.
  • Interpret the results in a biological context

Learning outcomes

Week 1

4. Demonstrate competence in reporting experimental results in a written format suitable for publication

  • Be able to draw scientifically accurate and correct figures and tables
  • Understand the basic structure of a scientific report
  • Appropriately report statistical results (scientific writing and layout, proper use of units etc.)

Learning outcomes

Week 1

5. Demonstrate an understanding of “significance”

  • Understand the difference between the word ‘significance’ in common language vs. statistics
  • Understand the concept of type I and type II errors
  • Understand the concept of statistical power

6. Present work at an appropriate academic standard.

Our tools

Week 1

Drawing


What's R? Who wants R?

Week 1
  • A free statistics package, created by Ross Ihaka (Prof. at UoA) and Robert Gentleman in the early nineties
  • Now covering everything from data processing to graphing
  • Based on a command line interface
  • R has become the data processing, analysis, plotting and programming tool in science
  • Your future employer may well ask for your R skills!
  • Commercial users include Google, Pfizer, Shell, Bank of America… but also DOC, crown research institutes, councils…
  • Enormous free online resources (helplists, code)
  • If this is the first and last time you do stats, look at R as an important learning experience!

Do I really have to learn R? Can I use Excel?

Week 1
  • The short answer is: there is no way around R if you are doing a Bachelor of Science at AUT or at any top uni
  • You will use it in Research Techniques (BIOL602), Terrestrial Ecology (ECOL602), Biogeography (ENVS622), Graphs R Us SCIE605 Pacific Islands Coastal Ecology (ECOL732), Research Project (SCIE701), Quantitative Analysis (SCIE805, postgrad), Advanced Ecological Data Analysis (SCIE807) and many more!
  • You will need it for your Honours, Masters and PhD theses
  • Our recommendation to use R is not commercially motivated (R is free)
  • AUT is a top ranking uni and we are simply keeping up with the best universities

Pacific Islands Costal Ecology ECOL732

Week 1

Pacific Islands Costal Ecology ECOL732

Week 1

Pacific Islands Costal Ecology ECOL732

Week 1

What can R do?

Week 1

The 'Excel mess'

Week 1

The 'art of R'

Week 1

RStudio

Week 1

The R syntax

Week 1
  • …is intuitive, because your commands are interactive
> 2+3
[1] 5
> sqrt(9)
[1] 3
> sqrt('Peter')
Error in sqrt("Peter"): non-numeric argument to mathematical function
  • …is intuitive, because the structure remains always the same:

function(argument1 = value1, argument2 = value2, ...)

The function could be round, the first argument the numbers you want to round, and the second argument the digits after the comma you would like to retain (see lab)

> round(x = 4.3498727, digits = 2)
[1] 4.35

Because learning statistics AND R is difficult

Week 1

…you will receive an ‘R Markdown’ file for every lab:

  • the file is ready to be compiled or 'knitted', but you still need to do work… (fill things in, eventually edit and write short pieces of R code)
  • you need to do ALL lab reports and follow instructions therein, 2 random reports will be selected and marked as per earlier slide and paper booklet

Step-by-step guide NOW…

Rules for the lab reports

Week 1
  • Yes, you MUST use R markdown
  • We will help you with the technicalities, it may appear messy at first but you will see the benefits soon and get used to the process
  • Some flexibility is expected (trouble shooting, using google)
  • You may delete the instructions if you want to, the lab reports are living, interactive, and personalised documents!
  • You are encouraged to add extra stuff, but keep it concise and well organised. Messy and partly wrong additions will lead to a lower mark!
  • Use '>' before you type, it makes it easier for us to see your answers

Rules for the lab reports

Week 1
  • You MUST submit every single lab report on time (Thursday 4 pm the following week after the lab, through turnitin)!
  • I will randomly select 2 out of the 10 reports and mark them, one before, and one after the break
  • Make sure you save both your code (the R Markdown file) and your (compiled) word file!
  • You must submit your own report. If you plagiarise, there will be drastic consequences

If you would like to get started at home

Week 1
  • Download and install R (google 'R software' > Download R for Windows/mac)
  • Close R
  • Download and install RStudio (google 'Rstudio')
  • Open RStudio
  • Click on Packages (one of the tabs in the lower right-hand panel) > Install, select 'knitr', 'markdown', and 'rmarkdown'
  • Go to file > new file > R Markdown
  • Start playing :)

What will we have learnt by the end of this week?

Week 1
  • How to study for this paper
  • What resources to use
  • How/when to hand in lab reports (this is most important and has caused good students to fail this paper in the past!)
  • How to use RMarkdown for lab reports

Glossary

Week 1
  • R
  • RStudio
  • RMarkdown
  • to 'knit' (compile) an Rmarkdown file
  • Console
  • Editor
  • R function, arguments