Monday, September 29, 2014

R Statistical Software Basics – Descriptive Statistics - Quartiles

The practice sheet titled StatisticMarks Data.csv downloaded from Link. – Download Sheet

About the Data Sheet - The data in this sheet is related to marks scored by 100 Students in a Statistical Test.

Based on the data, we will use R Software Statistical functions to analyze the descriptive statistics.

In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data. I have stored the StatisticMarks.csv file in Working Directory on my Desktop.

setwd("C:/Users/Rajesh Prabhakar/Desktop/R")

For inputting or reading Data from “StatisticMarks.csv” file, R Command would be

StatMarks=read.csv("StatisticMarks.csv")

Quartiles
Quartiles divide a rank-ordered data set into four equal parts. The values that divide each part are called the first, second, and third quartiles; and they are denoted by Q1, Q2, and Q3, respectively.
Note the relationship between quartiles and percentiles. Q1 corresponds to P25, Q2 corresponds to P50, Q3 corresponds to P75. Q2 is the median value in the set.
In R Statistical Software, Quartiles & percentiles are represented by function called “quantile”

quantile(  )

In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data titled StatisticsMarks. 
quantile(StatMarks$StatisticsMarks)

StatMarks is the name of the variable in which we stored the data followed by $ sign and column header of the Data i.e. StatisticsMarks.

Remember the title of the column should be exactly same including the large caps & small caps or else it will give error.

In R the file names, column headers and row headers should exactly match the same or else the function will give errors

The result of this function in R Console is

quantile(StatMarks$StatisticsMarks)
0%    25%    50%    75%   100%
25.00  69.75  75.00  80.00 100.00

The results highlights that 25% of students scored less than 69.75 marks, 25% to 50% students scored between 69.75 & 75.00, 50% to 75% of students scored between 75.00 & 80.00 and 75 to 100% students scored between 80.00 & 100.00 marks.

                                                                           

No comments:

Post a Comment