*How to have our basic statistics (Mean, Median, SD, Var, Cor, Cov) computed using R language?*

The dataottam team has come up with blog sharing initiative called “Celebrate the Big Data Problems”. In this series of blogs we will share our big data problems using *CPS* (*Context, Problem, Solutions*) Framework.

Context:

In statistics Mean, Median, Standard Deviations, Variance, Correlation, or Covariance are foundations steps. From Data Analyst to Data Scientist they will use the basic statistics. It can be arrived using many languages. But here we will use the language called R.

- Mean – The mean is the average of the numbers. And it’s easy to calculate; add up all the numbers, then divide by how many numbers there are. In another words it is the sum divided by the count.
- Median – The median is the middle of a sorted list of numbers. To find the median, place the numbers in value order and find the middle.
- Standard Deviation – SD is a measure of how spreads out numbers are. And the symbol for SD is sigma, a greek letter.
- Variance – The Variance is a measure of how spread out numbers are and it is the average of the squared difrences from mean.
- Correlation- The Corereltion is when two sets of data are strongly linked together we say they have a high correlation. Correlation is positive when the values increase together, and it is negative when one value decreases as the other increases.
- Covariance – covariance is a measure of how much two random variables change together.

Problem:

How to have our basic statistics Mean, Median, Standard Deviation, Variance, Correlation, and Covariance are computed using R language.

Solutions:

Use the below functions as applies with assumptions of x and y are vectors.

- mean(x)
- median(x)
- sd(x)
- var(x)
- cor(x,y)
- cov(x,y)

Big Thank You – R Cookbook, Paul Teetor .

© 2020 Data Science Central ® Powered by

Badges | Report an Issue | Privacy Policy | Terms of Service

**Most Popular Content on DSC**

To not miss this type of content in the future, subscribe to our newsletter.

- Book: Statistics -- New Foundations, Toolbox, and Machine Learning Recipes
- Book: Classification and Regression In a Weekend - With Python
- Book: Applied Stochastic Processes
- Long-range Correlations in Time Series: Modeling, Testing, Case Study
- How to Automatically Determine the Number of Clusters in your Data
- New Machine Learning Cheat Sheet | Old one
- Confidence Intervals Without Pain - With Resampling
- Advanced Machine Learning with Basic Excel
- New Perspectives on Statistical Distributions and Deep Learning
- Fascinating New Results in the Theory of Randomness
- Fast Combinatorial Feature Selection

**Other popular resources**

- Comprehensive Repository of Data Science and ML Resources
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- 100 Data Science Interview Questions and Answers
- Cheat Sheets | Curated Articles | Search | Jobs | Courses
- Post a Blog | Forum Questions | Books | Salaries | News

**Archives:** 2008-2014 |
2015-2016 |
2017-2019 |
Book 1 |
Book 2 |
More

**Most popular articles**

- Free Book and Resources for DSC Members
- New Perspectives on Statistical Distributions and Deep Learning
- Time series, Growth Modeling and Data Science Wizardy
- Statistical Concepts Explained in Simple English
- Machine Learning Concepts Explained in One Picture
- Comprehensive Repository of Data Science and ML Resources
- Advanced Machine Learning with Basic Excel
- Difference between ML, Data Science, AI, Deep Learning, and Statistics
- Selected Business Analytics, Data Science and ML articles
- How to Automatically Determine the Number of Clusters in your Data
- Fascinating New Results in the Theory of Randomness
- Hire a Data Scientist | Search DSC | Find a Job
- Post a Blog | Forum Questions

## You need to be a member of Data Science Central to add comments!

Join Data Science Central