Git Product home page Git Product logo

dsc-1-02-16-measures-of-dispersion-quiz-online-ds-ft-021119's Introduction

Measures of Dispersion - Quiz

Objectives

You will be able to:

  • Describe the significance of calculating measures of dispersion for continuous data
  • Understand the formula and intuition behind mean absolute deviation, standard deviation and variance
  • Understand the formula and intuition behind quantiles/quartiles and percentiles
  • Understand and interpret Interquartile distances with box plots

Exercise 1

Summary statistics for two samples of data are

Sample 1:	
mean = 19 
variance = 10

Sample 2:	
mean = 10
variance = 19

Which sample has the larger spread of observations?

2
2

Exercise 2

Consider the following ordered set of data

4 4 4 9 5 0 5 1 5 3 5 7 5 8 6 2

6 6 6 6 6 8 7 1 7 5 7 7 8 0 8 5
  • What is the IQR?
  • Optional extension: Verify your answer in Python
import numpy as np
dist = [4, 4, 4, 9, 5, 0, 5, 1, 5, 3, 5, 7, 5, 8, 6, 2, 6, 6, 6, 6, 6, 8, 7, 1, 7, 5, 7, 7, 8, 0, 8, 5]
def iqr(dist):
    return np.percentile(dist, 75) - np.percentile(dist, 25)

print(iqr(dist))
3.0

Exercise 3

Create a box-and-whisker plot for the judges' scores for an artist's performances in a talent competition.

Evan L	52
Nicole S  50
Pamela A  47
Chad O	44
Erin A	39
Jake P	38
Niecy N   36
Kate G	32

Create a box plot in matplotlib to identify the median for giving a final score to the artist. Are there any outliers ?

import matplotlib.pyplot as plt
plt.style.use('ggplot')
dict = {"Evan L  ":  52,
"Nicole S":  50,
"Pamela A":  47,
"Chad O  ":  44,
"Erin A  ":  39,
"Jake P  ":  38,
"Niecy N ":  36,
"Kate G  ":  32}

print(np.median(list(dict.values())))

plt.boxplot(list(dict.values()), showfliers=True)
plt.show()
41.5

png

print(np.median(list(dict.values())))
41.5

Exercise 4

Imagine that the number of marriages registered over a 10 year period were as follows:

Table 1. Number of registered marriages

Year  Number of marriages

1	40,650
2	40,812
3	41,300
4	41,450
5	39,594
6	40,734
7	39,993
8	38,814
9	37,828
10   35,716

Using the data above:

Find the median

# Your answer here 

#### Find the upper and lower quartiles

# Your answer here 

Calculate the interquartile range

# Your answer here 

Plot a boxplot to verify your answers

# Your answer here 

dsc-1-02-16-measures-of-dispersion-quiz-online-ds-ft-021119's People

Contributors

shakeelraja avatar peterbell avatar voxoff avatar tkoar avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.