SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Swipe
R - Mean, Median and Mode
Statistical analysis in R is performed by using
many in-built functions.
Most of these functions are part of the R base
package.
These functions take R vector as an input along
with the arguments and give the result.
R - Mean, Median and Mode
Mean
It is calculated by taking the sum of the values
and dividing with the number of values in a data
series.
The function mean() is used to calculate this in R.
Syntax
The basic syntax for calculating mean in R is:-
mean(x, trim = 0, na.rm = FALSE, ...)
Following is the description of the parameters
used
x is the input vector.
trim is used to drop some observations from
both end of the sorted vector.
na.rm is used to remove the missing values
from the input vector.
Median
The middle most value in a data series is called
the median.
The median() function is used in R to calculate this
value.
Syntax
The basic syntax for calculating median in R is
median(x, na.rm = FALSE)
Following is the description of the parameters
used
x is the input vector.
na.rm is used to remove the missing values
from the input vector.
The mode is the value that has highest number of
occurrences in a set of data.
Unike mean and median, mode can have both
numeric and character data.
R does not have a standard in-built function to
calculate mode.
So we create a user function to calculate mode of
a data set in R.
This function takes the vector as input and gives
the mode value as output.
Mode
R - Vectors
R - Linear Regression
R - Multiple Regression
Stay Tuned with
Topics for next Post

More Related Content

PPT
Ppt for 1.1 introduction to statistical inference
PPTX
Percentile
PPT
Stem and-leaf plots
PPTX
Hypothesis and Hypothesis Testing
PDF
Data Mining : Healthcare Application
PPTX
Data Analysis and Statistics
PPTX
Statistics
PPTX
What's Significant? Hypothesis Testing, Effect Size, Confidence Intervals, & ...
Ppt for 1.1 introduction to statistical inference
Percentile
Stem and-leaf plots
Hypothesis and Hypothesis Testing
Data Mining : Healthcare Application
Data Analysis and Statistics
Statistics
What's Significant? Hypothesis Testing, Effect Size, Confidence Intervals, & ...

What's hot (20)

PPT
Probability And Probability Distributions
PPTX
Estimation and hypothesis
PPT
1.introduction
PPTX
Lecture 6 Point and Interval Estimation.pptx
PPTX
Simple Linear Regression: Step-By-Step
PPT
Data preprocessing
PDF
Data Visualisation.pdf
PPT
Descriptive Statistics and Data Visualization
PDF
Assumptions of Linear Regression - Machine Learning
PPTX
Data cubes
PPTX
3.5 Exploratory Data Analysis
PPTX
"A basic guide to SPSS"
PPTX
INFERENTIAL STATISTICS: AN INTRODUCTION
PPT
Chapter 3 Confidence Interval
PPTX
Hypothesis testing
PPTX
Measures of dispersion
PPTX
A.6 confidence intervals
PPTX
Introduction to statistics
PPTX
Hypothesis testing
PPTX
Blue property assumptions.
Probability And Probability Distributions
Estimation and hypothesis
1.introduction
Lecture 6 Point and Interval Estimation.pptx
Simple Linear Regression: Step-By-Step
Data preprocessing
Data Visualisation.pdf
Descriptive Statistics and Data Visualization
Assumptions of Linear Regression - Machine Learning
Data cubes
3.5 Exploratory Data Analysis
"A basic guide to SPSS"
INFERENTIAL STATISTICS: AN INTRODUCTION
Chapter 3 Confidence Interval
Hypothesis testing
Measures of dispersion
A.6 confidence intervals
Introduction to statistics
Hypothesis testing
Blue property assumptions.
Ad

Similar to R - mean, median and mode (20)

PDF
A short tutorial on r
DOCX
Summerization notes for descriptive statistics using r
PPT
R programming slides
PDF
2 data structure in R
DOC
2. operator
PPTX
r language ...basic introduction Unit 2.pptx
PPTX
r language ...basic introduction Unit 1 R.pptx
PPTX
Lab-V-N.pptxvfxbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
PPTX
component of c language.pptx
PDF
java or oops class not in kerala polytechnic 4rth semester nots j
PPT
Apply Type functions in R.ppt ppt made by me
PPT
Python - Data Collection
PDF
In the binary search, if the array being searched has 32 elements in.pdf
PPTX
Chapter 3.3
PDF
4 R Tutorial DPLYR Apply Function
PPT
R Programming Intro
PDF
[ITP - Lecture 15] Arrays & its Types
PPTX
Variables, Data Types, Operator & Expression in c in detail
PPTX
Lecture5.pptx
A short tutorial on r
Summerization notes for descriptive statistics using r
R programming slides
2 data structure in R
2. operator
r language ...basic introduction Unit 2.pptx
r language ...basic introduction Unit 1 R.pptx
Lab-V-N.pptxvfxbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
component of c language.pptx
java or oops class not in kerala polytechnic 4rth semester nots j
Apply Type functions in R.ppt ppt made by me
Python - Data Collection
In the binary search, if the array being searched has 32 elements in.pdf
Chapter 3.3
4 R Tutorial DPLYR Apply Function
R Programming Intro
[ITP - Lecture 15] Arrays & its Types
Variables, Data Types, Operator & Expression in c in detail
Lecture5.pptx
Ad

More from Learnbay Datascience (20)

PDF
Top data science projects
PDF
Python my SQL - create table
PDF
Python my SQL - create database
PDF
Python my sql database connection
PDF
Python - mySOL
PDF
AI - Issues and Terminology
PDF
AI - Fuzzy Logic Systems
PDF
AI - working of an ns
PDF
Artificial Intelligence- Neural Networks
PDF
AI - Robotics
PDF
Applications of expert system
PDF
Components of expert systems
PDF
Artificial intelligence - expert systems
PDF
AI - natural language processing
PDF
Ai popular search algorithms
PDF
AI - Agents & Environments
PDF
Artificial intelligence - research areas
PDF
Artificial intelligence composed
PDF
Artificial intelligence intelligent systems
PDF
Applications of ai
Top data science projects
Python my SQL - create table
Python my SQL - create database
Python my sql database connection
Python - mySOL
AI - Issues and Terminology
AI - Fuzzy Logic Systems
AI - working of an ns
Artificial Intelligence- Neural Networks
AI - Robotics
Applications of expert system
Components of expert systems
Artificial intelligence - expert systems
AI - natural language processing
Ai popular search algorithms
AI - Agents & Environments
Artificial intelligence - research areas
Artificial intelligence composed
Artificial intelligence intelligent systems
Applications of ai

Recently uploaded (20)

PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Cell Types and Its function , kingdom of life
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
01-Introduction-to-Information-Management.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PPTX
Presentation on HIE in infants and its manifestations
PDF
RMMM.pdf make it easy to upload and study
PPTX
Lesson notes of climatology university.
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Supply Chain Operations Speaking Notes -ICLT Program
Cell Types and Its function , kingdom of life
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
human mycosis Human fungal infections are called human mycosis..pptx
01-Introduction-to-Information-Management.pdf
VCE English Exam - Section C Student Revision Booklet
102 student loan defaulters named and shamed – Is someone you know on the list?
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Final Presentation General Medicine 03-08-2024.pptx
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
Presentation on HIE in infants and its manifestations
RMMM.pdf make it easy to upload and study
Lesson notes of climatology university.
STATICS OF THE RIGID BODIES Hibbelers.pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
O7-L3 Supply Chain Operations - ICLT Program
Anesthesia in Laparoscopic Surgery in India
Pharmacology of Heart Failure /Pharmacotherapy of CHF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape

R - mean, median and mode

  • 1. Swipe R - Mean, Median and Mode
  • 2. Statistical analysis in R is performed by using many in-built functions. Most of these functions are part of the R base package. These functions take R vector as an input along with the arguments and give the result. R - Mean, Median and Mode
  • 3. Mean It is calculated by taking the sum of the values and dividing with the number of values in a data series. The function mean() is used to calculate this in R. Syntax The basic syntax for calculating mean in R is:- mean(x, trim = 0, na.rm = FALSE, ...) Following is the description of the parameters used x is the input vector. trim is used to drop some observations from both end of the sorted vector. na.rm is used to remove the missing values from the input vector.
  • 4. Median The middle most value in a data series is called the median. The median() function is used in R to calculate this value. Syntax The basic syntax for calculating median in R is median(x, na.rm = FALSE) Following is the description of the parameters used x is the input vector. na.rm is used to remove the missing values from the input vector.
  • 5. The mode is the value that has highest number of occurrences in a set of data. Unike mean and median, mode can have both numeric and character data. R does not have a standard in-built function to calculate mode. So we create a user function to calculate mode of a data set in R. This function takes the vector as input and gives the mode value as output. Mode
  • 6. R - Vectors R - Linear Regression R - Multiple Regression Stay Tuned with Topics for next Post