graphics with r a statistical tool for high school maths

18
GRAPHICS WITH R A STATISTICAL TOOL FOR HIGH SCHOOL MATHS By: Jade Wright, Garth Lo Bello, Andrew Roberts, Prue Tinsey and Tania Young

Upload: xantha-hewitt

Post on 01-Jan-2016

14 views

Category:

Documents


0 download

DESCRIPTION

Graphics with r A statistical tool for high school maths. By: Jade Wright, Garth Lo Bello, Andrew Roberts, Prue Tinsey and Tania Young. Why Should We Use R?. Using R, students have access to open source, professional quality, software - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Graphics with r A statistical tool for high school maths

GRAPHICS WITH RA STATISTICAL TOOL FOR HIGH SCHOOL MATHS

By: Jade Wright, Garth Lo Bello, Andrew Roberts, Prue Tinsey and Tania Young

Page 2: Graphics with r A statistical tool for high school maths

• Using R, students have access to open source, professional quality, software

•Unlike Excel, this program requires knowledge of computing language

• Simple code can be provided by a teacher for the students to use with their own data.

• Not having “built in functions,” students have the chance to see more of what is involved in statistical procedures.

• R can perform all the tasks Excel can, but provided many more enhanced abilities, is free and is also used by professional statisticians.

Why Should We Use R?

Page 3: Graphics with r A statistical tool for high school maths

Syllabus Outcomes

Page 4: Graphics with r A statistical tool for high school maths

THE TASK• Syllabus Outcome (MA3-18SP)

• Students will be asked to collect data from the classroom

• Examples could include hours spent studying vs. Other activities, their height, the time it takes them to complete homework, etc.

• Then the students will run R using code given by their teacher andproduce relevant graphical displays for interpreting their findings.

• In doing so, students will have a choice of an appropriate display

Page 5: Graphics with r A statistical tool for high school maths

Example 1:

Hours spent on various activities

Suppose a student spends:

5 hours at school3 hours with friends1 hour doing homework2 hours working at a job1 hour travelling8 hours sleeping4 hours watching TV

Page 6: Graphics with r A statistical tool for high school maths

x <- c(5, 3, 1, 2, 1,8,4)

pie(x, main="Hours of Student Life", col=rainbow(length(x)), labels=c("School","Friends","Homework", "Job", "Travel", "Sleep", "TV"))

pie(x, main="Hours of Student Life", col=rainbow(length(x)),labels <- round(x/sum(x) * 100, 1))x_labels <- paste(labels, "%", sep="")

pie(x, main="Daily Hours as Percent of Day", col=rainbow(length(x)), labels=x_labels,)

legend("bottomleft", c("School","Friends","Homework","Job","Travel","Sleep", "TV"), cex=0.9,bty="n",fill=rainbow(length(x)))

Page 7: Graphics with r A statistical tool for high school maths

The student is asked to produce a pie chart with legend to represent their daily lifestyle.

Page 8: Graphics with r A statistical tool for high school maths

Now let’s look at the normal distribution

Suppose students compile data regarding the amount of time perDay they spend on homework in minutes.

Ex: 20, 25,....120

And the teacher asks the student to use R to represent this data inA histogram that shows the mean.

R can do this rather simply

Page 9: Graphics with r A statistical tool for high school maths
Page 10: Graphics with r A statistical tool for high school maths
Page 11: Graphics with r A statistical tool for high school maths

A normal curve fittedTo a sample of 100

With R, simply change onenumber and students can see how sample size affects the shape

Page 12: Graphics with r A statistical tool for high school maths

What if you have student’s measure their own heightsand want them to analyse that?

You could have them first collect the heights of allThe students in the class.....

Then compare the results when the separate the heights of boysFrom girls

This could spark a discussion about how certain displaysCan be more illustrative than others

And why, in statistics, knowing your target population has greatimportance.

Page 13: Graphics with r A statistical tool for high school maths

RESULTSALL STUDENTS: Min. 1st Qu. Median Mean 3rd Qu. Max. 153.0 155.0 161.5 161.0 166.0 170.0

BOYS

Min. 1st Qu. Median Mean 3rd Qu. Max. 163.0 165.8 166.0 166.4 167.2 170.0

GIRLS

Min. 1st Qu. Median Mean 3rd Qu. Max. 153.0 154.0 155.0 155.5 156.2 160.0

Page 14: Graphics with r A statistical tool for high school maths

Data RepresentationDS4.1 (p 114)Constructs, reads andinterprets graphs, tables,charts and statisticalinformation

Now, for an activity, once students learn the basic of R would be to Perform the exercise involving calculating the heights of students in their Class.

They would be given the code, collect the data and have to discuss the shape of a relevant bar graph (not box plot).

The students should be able to relate frequency, find the mode, and meanFrom the data after producing the graph.

Page 15: Graphics with r A statistical tool for high school maths
Page 16: Graphics with r A statistical tool for high school maths

CONFUSED OR WORRIED ABOUT USING A PROGRAM THAT REQUIRES CODE?

There are thousands

of free examples

online

Page 17: Graphics with r A statistical tool for high school maths

SUMMARYR is a free program that not only does everything excel doesbut also provides the ability for the student to see the steps involved by avoiding built in functions.

This enhances learning and allows for creativity while at the same time providing students the chance to learn a piece of Software statisticians ACTUALLY use

Writing code can be daunting at first, but a simple Google searchprovides numerous scripts that can be amended to fit any task

The R website also provides free help and downloads at:

http://www.r-project.org/

Page 18: Graphics with r A statistical tool for high school maths

QUESTIONS??????