Showing posts with label Percentiles. Show all posts
Showing posts with label Percentiles. Show all posts

Monday, September 29, 2014

R Statistical Software Basics – Descriptive Statistics - Percentiles

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")

Percentiles
Assume that the elements in a data set are rank ordered from the smallest to the largest. The values that divide a rank-ordered set of elements into 100 equal parts are called percentiles.
An element having a percentile rank of Pi would have a greater value than i percent of all the elements in the set. Thus, the observation at the 50th percentile would be denoted P50, and it would be greater than 50 percent of the observations in the set.
An observation at the 50th percentile would correspond to the median value in the set.
In R Statistical Software, Quartiles & percentiles are represented by function called “quantile”

quantile(filename, c(.10,.20,.30,.40,.50,.60,.70,.80,.90,.95))

In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data titled StatisticsMarks.

quantile(StatMarks$StatisticsMarks, c(.10,.20,.30,.40,.50,.60,.70,.80,.90,.95)) 

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,c(.10,.20,.30,.40,.50,.60,.70,.80,.90,.95))
 10%  20%  30%  40%  50%  60%  70%  80%  90%  95%
  56.8 66.0   71.0  73.0   75.0  78.0  80.0   81.2  91.1   97.0


10% of students scored upto 56.8 marks, 20% of students scored upto 66 marks, 30% scored upto 71 marks, 50% scored upto 75 marks, etc.

Sunday, September 14, 2014

PERCENTILES - Descriptive Statistics using Microsoft Excel Statistical Functions

The practice sheet can be downloaded from Link. Statistics Marks Data - 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 Microsoft Excel Statistical functions to analyse the descriptive statistics. 

In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data. 

Percentiles
Assume that the elements in a data set are rank ordered from the smallest to the largest. The values that divide a rank-ordered set of elements into 100 equal parts are called percentiles.

An element having a percentile rank of Pi would have a greater value than i percent of all the elements in the set. Thus, the observation at the 50th percentile would be denoted P50, and it would be greater than 50 percent of the observations in the set.

An observation at the 50th percentile would correspond to the median value in the set.

=PERCENTILE(array,k)
Array     The array or range of data that defines relative standing.

K     The percentile value in the range 0 to 1, inclusive.


In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data. 
=PERCENTILE(A2:A101,0.3)  gives the 30th percentile
=PERCENTILE(A2:A101,0.5) gives 50th percentile or Median



This means that 30% (30 out of 100) of the scores are lower or equal to 71. 

Quartiles - Descriptive Statistics using Microsoft Excel Statistical Functions

The practice sheet can be downloaded from Link. Statistics Marks Data - 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 Microsoft Excel Statistical functions to analyse the descriptive statistics. 

In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data. 

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.

Quartiles are mostly used in sales and survey data to divide populations into groups.

=QUARTILE(array,quart)

Array     is the array or cell range of numeric values for which you want the quartile value.
Quart     indicates which value to return.

Quartile = 0 returns Minimum Value
Quartile = 1 returns First Quartile (25th   Percentile)
Quartile = 2 returns Second Quartile (50th Percentile) = Median
Quartile = 3 returns Third Quartile (75th Percentile)
Quartile = 4 returns Maximum Value

In the Data Sheet, we have Data from A2:A101, A1 being the header of the Data. 
=Quartile(A2:A101,0)
=Quartile(A2:A101,1)
=Quartile(A2:A101,2)
=Quartile(A2:A101,3)
=Quartile(A2:A101,4)


First Quartile i.e. 25% of students scored less than 69.75 Marks 

Second Quartile i.e. 25% of students scored between 69.75 to 75 Marks 
Third Quartile i.e. 25% of students scored between 75 & 80 Marks 
Fourth Quartile i.e. 25% of students scored between 80 & maximum 100 Marks.
Minimum Marks scored in test is 25



Result is below Table





The practice sheet can be downloaded from Link. Statistics Marks Data - Download Sheet