#5, First Floor, 4th Street , Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to measure the dispersion of the given data using R?
Description

To measure the dispersion of the given data in R programming.

Process

Measures of dispersion

  • Range or Variation
  • Variance
  • Standard deviation
  • 1) Range or variation :

    • Range is the difference between the smallest and highest value.
    • R Function : range()

    2) Variance :

    • Variance is the measure of how far is data vary from the average value.
    • R Function : var()

    3) Standard Deviation :

    • Standard deviation is the square root of the variance.
    • R Function : sd()
Sapmle Code

#Measure of Dispersion

#Read File
print(getwd())
setwd(“/home/sof#Measure of Dispersion

#Read File
print(getwd())
setwd(“/home/soft13″)
print(getwd())
data<-read.csv(‘input.csv’)
print(data)
print(is.data.frame(data))

#Range
range(data$salary)

#Variance
var(data$salary)

#Standard Deviation
sd(data$salat13”)
print(getwd())
data<-read.csv(‘input.csv’)
print(data)
print(is.data.frame(data))

#Range
range(data$salary)

#Variance
var(data$salary)

#Standard Deviation
sd(data$salary)

Screenshots