Graphics with r A statistical tool for high school maths

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

description

Graphics with r A statistical tool for high school maths. By: Jade Write, 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 of Graphics with r A statistical tool for high school maths

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

GRAPHICS WITH RA STATISTICAL TOOL FOR HIGH SCHOOL MATHS

By: Jade Write, 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
Page 5: Graphics with r A statistical tool for high school maths

THE TASK• 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. Teachers who are not comfortable using R, can get their students to complete these activities in excel and still gain the same results

Page 6: 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 7: Graphics with r A statistical tool for high school maths

R - codex <- 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 8: 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 9: Graphics with r A statistical tool for high school maths

With excel

Page 10: 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 11: Graphics with r A statistical tool for high school maths
Page 12: Graphics with r A statistical tool for high school maths
Page 13: 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 14: 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 15: 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 16: Graphics with r A statistical tool for high school maths
Page 17: Graphics with r A statistical tool for high school maths

Example in Excel

This links to a video that demonstrates this activity step by step in excel http://www.youtube.com/watch?v=UASCe-3Y1to

Page 18: 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 19: 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 20: Graphics with r A statistical tool for high school maths

QUESTIONS??????