SlideShare a Scribd company logo
1 of 11
Measures of Central Tendency
with R Programming Language
Ph.D Kucherenko Svitlana
There are three measures of central tendencies:
modemedianmean
Mean
Example :
Data Set = 3, 5, 1,
4, 7, 6, 8, 2, 9
Number of
Elements in Data
Set = 9
Mean
=(3+5+1+4+7+6+8
+2+9)/ 9 =45/9=5
R can be downloaded from
http://cran.r-project.org/
x<-c(3,5,1,4,7,6,8,2,9)
Where x – vector name; <- Assignment Operator;
c(3,5,1,4,7,6,8,2,9) – Vector Contents
c() (for concatenate)
x
>x<-c(3,5,1,4,7,6,8,2,9)
> x
x[1] 3 5 1 4 7 6 8 2 9
> mean(x)
[1] 5
mean ()
Median
1. Reorder the data set from the smallest to
the largest
2. Understand the number of elements are
odd or even
Examples : Odd Number of Elements
Data Set = 1, 5, 9, 3, 5, 4, 8
Reordered = 1, 3, 4, 5, 5, 8, 9
Median = 5
Examples : Even Number of Elements
Data Set = 1, 5, 8, 3, 5, 4
Reordered = 1, 3, 4, 5, 5, 8
Median = ( 4 + 5 ) / 2 = 4.5
median()
Mode
A data set with two modes is called bimodal.
A data set with three modes is called
trimodal.
Examples:
Single Mode Data Set = 1, 5, 8, 3, 5, 4, 7
Mode = 5
Examples:
Bimodal Data Set = 2, 5, 2, 1, 5, 4, 9
Modes = 2 and 5
Examples:
Trimodal Data Set = 2, 5, 2, 8, 5, 6, 8
Modes = 2, 5, and 8
Mean- Average
Median - Middle of the data set
Mode - Most often

More Related Content

What's hot

Day 1b R structures objects.pptx
Day 1b   R structures   objects.pptxDay 1b   R structures   objects.pptx
Day 1b R structures objects.pptxAdrien Melquiond
 
Data structure lecture 2
Data structure lecture 2Data structure lecture 2
Data structure lecture 2Abbott
 
Three way join in one round on hadoop
Three way join in one round on hadoopThree way join in one round on hadoop
Three way join in one round on hadoopIraj Hedayati
 
Sorting and hashing concepts
Sorting and hashing conceptsSorting and hashing concepts
Sorting and hashing conceptsLJ Projects
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structureeShikshak
 
2 1 Bzca5e
2 1 Bzca5e2 1 Bzca5e
2 1 Bzca5esilvia
 
Prac 3 lagrange's thm
Prac  3 lagrange's thmPrac  3 lagrange's thm
Prac 3 lagrange's thmHimani Asija
 
Open addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashingOpen addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashingSangeethaSasi1
 
1 5 graphs of functions
1 5 graphs of functions1 5 graphs of functions
1 5 graphs of functionsAlaina Wright
 
Information and network security 34 primality
Information and network security 34 primalityInformation and network security 34 primality
Information and network security 34 primalityVaibhav Khanna
 
Open Addressing on Hash Tables
Open Addressing on Hash Tables Open Addressing on Hash Tables
Open Addressing on Hash Tables Nifras Ismail
 
Function or not function
Function or not functionFunction or not function
Function or not functionMartinGeraldine
 
Distributive Property 8th
Distributive Property 8th Distributive Property 8th
Distributive Property 8th jscafidi7
 
Distributive Property 7th
Distributive Property 7thDistributive Property 7th
Distributive Property 7thjscafidi7
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in indiaEdhole.com
 
Divide and conquer 1
Divide and conquer 1Divide and conquer 1
Divide and conquer 1Kumar
 

What's hot (20)

Day 1b R structures objects.pptx
Day 1b   R structures   objects.pptxDay 1b   R structures   objects.pptx
Day 1b R structures objects.pptx
 
Data structure lecture 2
Data structure lecture 2Data structure lecture 2
Data structure lecture 2
 
Three way join in one round on hadoop
Three way join in one round on hadoopThree way join in one round on hadoop
Three way join in one round on hadoop
 
Sorting and hashing concepts
Sorting and hashing conceptsSorting and hashing concepts
Sorting and hashing concepts
 
Chapter 11 ds
Chapter 11 dsChapter 11 ds
Chapter 11 ds
 
Introduction of data structure
Introduction of data structureIntroduction of data structure
Introduction of data structure
 
2 1 Bzca5e
2 1 Bzca5e2 1 Bzca5e
2 1 Bzca5e
 
Prac 3 lagrange's thm
Prac  3 lagrange's thmPrac  3 lagrange's thm
Prac 3 lagrange's thm
 
Open addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashingOpen addressiing &amp;rehashing,extendiblevhashing
Open addressiing &amp;rehashing,extendiblevhashing
 
Function Basics Math Wiki
Function Basics   Math WikiFunction Basics   Math Wiki
Function Basics Math Wiki
 
1 5 graphs of functions
1 5 graphs of functions1 5 graphs of functions
1 5 graphs of functions
 
Information and network security 34 primality
Information and network security 34 primalityInformation and network security 34 primality
Information and network security 34 primality
 
Open Addressing on Hash Tables
Open Addressing on Hash Tables Open Addressing on Hash Tables
Open Addressing on Hash Tables
 
Function or not function
Function or not functionFunction or not function
Function or not function
 
Distributive Property 8th
Distributive Property 8th Distributive Property 8th
Distributive Property 8th
 
Distributive Property 7th
Distributive Property 7thDistributive Property 7th
Distributive Property 7th
 
Ds 8
Ds 8Ds 8
Ds 8
 
Mba admission in india
Mba admission in indiaMba admission in india
Mba admission in india
 
Forest plot in r
Forest plot in rForest plot in r
Forest plot in r
 
Divide and conquer 1
Divide and conquer 1Divide and conquer 1
Divide and conquer 1
 

Similar to Mean, median, mode 1

Introduction to R r.nabati - iausdj.ac.ir
Introduction to R   r.nabati - iausdj.ac.irIntroduction to R   r.nabati - iausdj.ac.ir
Introduction to R r.nabati - iausdj.ac.irnabati
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdfRohanBorgalli
 
Comparing EDA with classical and Bayesian analysis.pptx
Comparing EDA with classical and Bayesian analysis.pptxComparing EDA with classical and Bayesian analysis.pptx
Comparing EDA with classical and Bayesian analysis.pptxPremaGanesh1
 
UNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllegeUNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllegeRamanamurthy Banda
 
UNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllegeUNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllegeRamanamurthy Banda
 
R language tutorial
R language tutorialR language tutorial
R language tutorialDavid Chiu
 
Chap03 numerical descriptive measures
Chap03 numerical descriptive measuresChap03 numerical descriptive measures
Chap03 numerical descriptive measuresUni Azza Aunillah
 
Introduction to Data Structure
Introduction to Data Structure Introduction to Data Structure
Introduction to Data Structure Kamal Singh Lodhi
 
Lecture 3 & 4 Measure of Central Tendency.pdf
Lecture 3 & 4 Measure of Central Tendency.pdfLecture 3 & 4 Measure of Central Tendency.pdf
Lecture 3 & 4 Measure of Central Tendency.pdfkelashraisal
 
R programming intro with examples
R programming intro with examplesR programming intro with examples
R programming intro with examplesDennis
 
Machine Learning With R
Machine Learning With RMachine Learning With R
Machine Learning With RDavid Chiu
 
Evaluating classifierperformance ml-cs6923
Evaluating classifierperformance ml-cs6923Evaluating classifierperformance ml-cs6923
Evaluating classifierperformance ml-cs6923Raman Kannan
 

Similar to Mean, median, mode 1 (20)

R Programming Intro
R Programming IntroR Programming Intro
R Programming Intro
 
Introduction to R r.nabati - iausdj.ac.ir
Introduction to R   r.nabati - iausdj.ac.irIntroduction to R   r.nabati - iausdj.ac.ir
Introduction to R r.nabati - iausdj.ac.ir
 
R Programming - part 1.pdf
R Programming - part 1.pdfR Programming - part 1.pdf
R Programming - part 1.pdf
 
arrays
arraysarrays
arrays
 
Comparing EDA with classical and Bayesian analysis.pptx
Comparing EDA with classical and Bayesian analysis.pptxComparing EDA with classical and Bayesian analysis.pptx
Comparing EDA with classical and Bayesian analysis.pptx
 
proj1v2
proj1v2proj1v2
proj1v2
 
UNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllegeUNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllege
 
UNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllegeUNIT III_Python Programming_aditya COllege
UNIT III_Python Programming_aditya COllege
 
R language tutorial
R language tutorialR language tutorial
R language tutorial
 
Chap03 numerical descriptive measures
Chap03 numerical descriptive measuresChap03 numerical descriptive measures
Chap03 numerical descriptive measures
 
Mathematica for Physicits
Mathematica for PhysicitsMathematica for Physicits
Mathematica for Physicits
 
Introduction to Data Structure
Introduction to Data Structure Introduction to Data Structure
Introduction to Data Structure
 
Lecture 3 & 4 Measure of Central Tendency.pdf
Lecture 3 & 4 Measure of Central Tendency.pdfLecture 3 & 4 Measure of Central Tendency.pdf
Lecture 3 & 4 Measure of Central Tendency.pdf
 
R programming intro with examples
R programming intro with examplesR programming intro with examples
R programming intro with examples
 
R and data mining
R and data miningR and data mining
R and data mining
 
Machine Learning With R
Machine Learning With RMachine Learning With R
Machine Learning With R
 
IA-advanced-R
IA-advanced-RIA-advanced-R
IA-advanced-R
 
Slides ads ia
Slides ads iaSlides ads ia
Slides ads ia
 
Array i imp
Array  i impArray  i imp
Array i imp
 
Evaluating classifierperformance ml-cs6923
Evaluating classifierperformance ml-cs6923Evaluating classifierperformance ml-cs6923
Evaluating classifierperformance ml-cs6923
 

Recently uploaded

VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxolyaivanovalion
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptxAnupama Kate
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfadriantubila
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxolyaivanovalion
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Delhi Call girls
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023ymrp368
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...SUHANI PANDEY
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz1
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightDelhi Call girls
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxolyaivanovalion
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfLars Albertsson
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxolyaivanovalion
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxolyaivanovalion
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxfirstjob4
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxolyaivanovalion
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...shambhavirathore45
 

Recently uploaded (20)

VidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptxVidaXL dropshipping via API with DroFx.pptx
VidaXL dropshipping via API with DroFx.pptx
 
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts ServiceCall Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
Call Girls In Shalimar Bagh ( Delhi) 9953330565 Escorts Service
 
100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx100-Concepts-of-AI by Anupama Kate .pptx
100-Concepts-of-AI by Anupama Kate .pptx
 
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdfAccredited-Transport-Cooperatives-Jan-2021-Web.pdf
Accredited-Transport-Cooperatives-Jan-2021-Web.pdf
 
BabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptxBabyOno dropshipping via API with DroFx.pptx
BabyOno dropshipping via API with DroFx.pptx
 
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
Best VIP Call Girls Noida Sector 22 Call Me: 8448380779
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Data-Analysis for Chicago Crime Data 2023
Data-Analysis for Chicago Crime Data  2023Data-Analysis for Chicago Crime Data  2023
Data-Analysis for Chicago Crime Data 2023
 
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
VIP Model Call Girls Hinjewadi ( Pune ) Call ON 8005736733 Starting From 5K t...
 
Invezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signalsInvezz.com - Grow your wealth with trading signals
Invezz.com - Grow your wealth with trading signals
 
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 nightCheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
Cheap Rate Call girls Sarita Vihar Delhi 9205541914 shot 1500 night
 
Mature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptxMature dropshipping via API with DroFx.pptx
Mature dropshipping via API with DroFx.pptx
 
Schema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdfSchema on read is obsolete. Welcome metaprogramming..pdf
Schema on read is obsolete. Welcome metaprogramming..pdf
 
Edukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFxEdukaciniai dropshipping via API with DroFx
Edukaciniai dropshipping via API with DroFx
 
Carero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptxCarero dropshipping via API with DroFx.pptx
Carero dropshipping via API with DroFx.pptx
 
Introduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptxIntroduction-to-Machine-Learning (1).pptx
Introduction-to-Machine-Learning (1).pptx
 
Smarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptxSmarteg dropshipping via API with DroFx.pptx
Smarteg dropshipping via API with DroFx.pptx
 
Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...Determinants of health, dimensions of health, positive health and spectrum of...
Determinants of health, dimensions of health, positive health and spectrum of...
 

Mean, median, mode 1

  • 1. Measures of Central Tendency with R Programming Language Ph.D Kucherenko Svitlana
  • 2. There are three measures of central tendencies: modemedianmean
  • 3. Mean Example : Data Set = 3, 5, 1, 4, 7, 6, 8, 2, 9 Number of Elements in Data Set = 9 Mean =(3+5+1+4+7+6+8 +2+9)/ 9 =45/9=5
  • 4. R can be downloaded from http://cran.r-project.org/ x<-c(3,5,1,4,7,6,8,2,9) Where x – vector name; <- Assignment Operator; c(3,5,1,4,7,6,8,2,9) – Vector Contents c() (for concatenate) x >x<-c(3,5,1,4,7,6,8,2,9) > x x[1] 3 5 1 4 7 6 8 2 9 > mean(x) [1] 5 mean ()
  • 5.
  • 6. Median 1. Reorder the data set from the smallest to the largest 2. Understand the number of elements are odd or even
  • 7. Examples : Odd Number of Elements Data Set = 1, 5, 9, 3, 5, 4, 8 Reordered = 1, 3, 4, 5, 5, 8, 9 Median = 5 Examples : Even Number of Elements Data Set = 1, 5, 8, 3, 5, 4 Reordered = 1, 3, 4, 5, 5, 8 Median = ( 4 + 5 ) / 2 = 4.5
  • 9. Mode A data set with two modes is called bimodal. A data set with three modes is called trimodal. Examples: Single Mode Data Set = 1, 5, 8, 3, 5, 4, 7 Mode = 5 Examples: Bimodal Data Set = 2, 5, 2, 1, 5, 4, 9 Modes = 2 and 5 Examples: Trimodal Data Set = 2, 5, 2, 8, 5, 6, 8 Modes = 2, 5, and 8
  • 10.
  • 11. Mean- Average Median - Middle of the data set Mode - Most often