Research breakthrough possible @S-Logix pro@slogix.in

Office Address

  • 2nd Floor, #7a, High School Road, Secretariat Colony Ambattur, Chennai-600053 (Landmark: SRM School) Tamil Nadu, India
  • 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
measure the dispersion of the given data using R
Measure of Dispersion