You are on page 1of 88

Lecture 3:

Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
Lecture 3: Descriptive Statistics
Chapter
Objectives

Displaying
Data
Histograms Assoc. Prof. Amany E. Aly
Box Plots

Measures of
the Center of Department of Mathematics, Faculty of Science,
Data Helwan University, Ain Helwan, Cairo, Egypt.
Measures of
the Spread of
Data
6 / 3 / 2023
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 1 / 39
Chapter Objectives

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 2 / 39
Presentation Outline

Lecture 3:
Descriptive
Statistics
1 Chapter Objectives
Assoc. Prof.
Amany E. Aly

Chapter
2 Displaying Data
Objectives
Histograms
Displaying
Data
Histograms
Box Plots
Box Plots

Measures of
the Center of
3 Measures of the Center of Data
Data

Measures of
the Spread of
4 Measures of the Spread of Data
Data

Solved
Exercises
5 Solved Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 3 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The student should be able to:
Amany E. Aly
1 Use histograms and box plots in order to display data graphi-
Chapter
Objectives cally.
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 4 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The student should be able to:
Amany E. Aly
1 Use histograms and box plots in order to display data graphi-
Chapter
Objectives cally.
Displaying
Data 2 Calculate measures of central location: mean and median.
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 4 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The student should be able to:
Amany E. Aly
1 Use histograms and box plots in order to display data graphi-
Chapter
Objectives cally.
Displaying
Data 2 Calculate measures of central location: mean and median.
Histograms
Box Plots

Measures of
3 Calculate measures of the spread: variance, standard devia-
the Center of
Data tion, and interquartile range.
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 4 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The student should be able to:
Amany E. Aly
1 Use histograms and box plots in order to display data graphi-
Chapter
Objectives cally.
Displaying
Data 2 Calculate measures of central location: mean and median.
Histograms
Box Plots

Measures of
3 Calculate measures of the spread: variance, standard devia-
the Center of
Data tion, and interquartile range.
Measures of
the Spread of 4 Identify outliers, which are values that do not fit the rest of
Data

Solved
Exercises
the distribution.

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 4 / 39
Presentation Outline

Lecture 3:
Descriptive
Statistics
1 Chapter Objectives
Assoc. Prof.
Amany E. Aly

Chapter
2 Displaying Data
Objectives
Histograms
Displaying
Data
Histograms
Box Plots
Box Plots

Measures of
the Center of
3 Measures of the Center of Data
Data

Measures of
the Spread of
4 Measures of the Spread of Data
Data

Solved
Exercises
5 Solved Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 5 / 39
Displaying Data

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying Statisticians often start the analysis by graphing the data in order
Data
Histograms
Box Plots
to get an overall picture of it.
Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 6 / 39
Histograms

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
The histogram is a frequently used method for displaying the
Chapter
Objectives distribution of continuous numerical data.
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 7 / 39
Histograms

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
The histogram is a frequently used method for displaying the
Chapter
Objectives distribution of continuous numerical data.
Displaying
Data
Histograms
An advantage of a histogram is that it can readily display large
Box Plots

Measures of
data sets.
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 7 / 39
Histograms

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
The histogram is a frequently used method for displaying the
Chapter
Objectives distribution of continuous numerical data.
Displaying
Data
Histograms
An advantage of a histogram is that it can readily display large
Box Plots

Measures of
data sets.
the Center of
Data Use a histogram when the data set consists of 100 values or
Measures of
the Spread of more.
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 7 / 39
Lecture 3:
Descriptive
Statistics
Example:
Assoc. Prof.
Amany E. Aly Read into R the data frame ”ex.1” that contains data on the sex
Chapter
Objectives
and height and create a histogram of the heights:
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 8 / 39
Lecture 3:
Descriptive
Statistics
Example:
Assoc. Prof.
Amany E. Aly Read into R the data frame ”ex.1” that contains data on the sex
Chapter
Objectives
and height and create a histogram of the heights:
Displaying
Data
Histograms
Box Plots
> ex.1 < − read.csv(”ex1.csv”)
Measures of
the Center of
> hist(ex.1$height)
Data

Measures of
the Spread of
Data The outcome of the function is a plot that appears in the graphical
Solved
Exercises
window and is presented in the next figure.

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 8 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 9 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly The first line of the above script reads in the data from ”ex1.csv”
Chapter
into a data frame object named ”ex.1” that maintains the data
Objectives

Displaying
internally in R.
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 10 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly The first line of the above script reads in the data from ”ex1.csv”
Chapter
into a data frame object named ”ex.1” that maintains the data
Objectives

Displaying
internally in R.
Data
Histograms
Box Plots
The second line of the script produces the histogram.
Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 10 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly The first line of the above script reads in the data from ”ex1.csv”
Chapter
into a data frame object named ”ex.1” that maintains the data
Objectives

Displaying
internally in R.
Data
Histograms
Box Plots
The second line of the script produces the histogram.
Measures of
the Center of One may use the function ”c” to produce a sequence of data
Data

Measures of
and apply the histogram plotting function to the output of the
the Spread of
Data sequence producing function.
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 10 / 39
Lecture 3:
Descriptive
Statistics Typing the expression ”ex.1$height” we get as an output the val-
Assoc. Prof.
Amany E. Aly
ues of the variable ”height”
Chapter
Objectives

Displaying
> ex.1$height
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 11 / 39
Lecture 3:
Descriptive
Statistics
Notice that the square brackets on the left hand side of each line
Assoc. Prof.
Amany E. Aly indicate the position in the sequence of the first value on that line.
Chapter
Objectives
Hence, the number on the first line is ”[1]”. The number on the
Displaying
Data
second line is ”[16]”, since the second line starts with the 16th
Histograms
Box Plots
observation in the display given in the book.
Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 12 / 39
Lecture 3:
Descriptive
Statistics
Notice that the square brackets on the left hand side of each line
Assoc. Prof.
Amany E. Aly indicate the position in the sequence of the first value on that line.
Chapter
Objectives
Hence, the number on the first line is ”[1]”. The number on the
Displaying
Data
second line is ”[16]”, since the second line starts with the 16th
Histograms
Box Plots
observation in the display given in the book.
Measures of
the Center of
Data

Measures of
Notice, that numbers in the square brackets on your R Console
the Spread of
Data window may be different, depending on the setting of the display
Solved
Exercises
on your computer.

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 12 / 39
Box Plots

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
It shows how far from most of the data the extreme values
Objectives

Displaying
are.
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 13 / 39
Box Plots

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
It shows how far from most of the data the extreme values
Objectives

Displaying
are.
Data
Histograms
Box Plots
The box plot is constructed from five values: the smallest
Measures of
the Center of
value, the first quartile, the median, the third quartile, and
Data
the largest value.
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 13 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The median, a number, is a way of measuring the ”center” of
Amany E. Aly
the data. ( The data must be ordered )
Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 14 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The median, a number, is a way of measuring the ”center” of
Amany E. Aly
the data. ( The data must be ordered )
Chapter
Objectives Quartiles are numbers that separate the data into quarters.
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 14 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The median, a number, is a way of measuring the ”center” of
Amany E. Aly
the data. ( The data must be ordered )
Chapter
Objectives Quartiles are numbers that separate the data into quarters.
Displaying
Data
Histograms
To find the quartiles, first find the median or second quartile.
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 14 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The median, a number, is a way of measuring the ”center” of
Amany E. Aly
the data. ( The data must be ordered )
Chapter
Objectives Quartiles are numbers that separate the data into quarters.
Displaying
Data
Histograms
To find the quartiles, first find the median or second quartile.
Box Plots

Measures of The first quartile is the middle value of the lower half of the
the Center of
Data data.
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 14 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
The median, a number, is a way of measuring the ”center” of
Amany E. Aly
the data. ( The data must be ordered )
Chapter
Objectives Quartiles are numbers that separate the data into quarters.
Displaying
Data
Histograms
To find the quartiles, first find the median or second quartile.
Box Plots

Measures of The first quartile is the middle value of the lower half of the
the Center of
Data data.
Measures of
the Spread of
Data the third quartile is the middle value of the upper half of the
Solved
Exercises
data.

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 14 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Outliers are values that do not fit with the rest of the data
Objectives

Displaying
and lie outside of the normal range.
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 15 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Outliers are values that do not fit with the rest of the data
Objectives

Displaying
and lie outside of the normal range.
Data
Histograms The inter-quartile range (IQR) is the distance between the
Box Plots

Measures of third quartile (Q3) and the first quartile (Q1),


the Center of
Data
i.e., IQR = Q3 - Q1.
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 15 / 39
Lecture 3:
Descriptive > boxplot(c(1,11.5,6,7.2,4,8,9,10,6.8,8.3,2,2,10,1))
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 16 / 39
Lecture 3:
Descriptive > boxplot(ex.1$height)
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 17 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives > summary(ex.1$height)
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 18 / 39
Presentation Outline

Lecture 3:
Descriptive
Statistics
1 Chapter Objectives
Assoc. Prof.
Amany E. Aly

Chapter
2 Displaying Data
Objectives
Histograms
Displaying
Data
Histograms
Box Plots
Box Plots

Measures of
the Center of
3 Measures of the Center of Data
Data

Measures of
the Spread of
4 Measures of the Spread of Data
Data

Solved
Exercises
5 Solved Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 19 / 39
Skewness, the Mean and the Median

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives Example 1
Displaying
Data
Histograms
Compute the mean and the median for the following data set:
Box Plots

Measures of
4; 5; 6; 6; 6; 7; 7; 7; 7; 7; 7; 8; 8; 8; 9; 10.
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 20 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
> x < − c(4,5,6,6,6,7,7,7,7,7,7,8,8,8,9,10)
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 21 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
> x < − c(4,5,6,6,6,7,7,7,7,7,7,8,8,8,9,10)
Objectives
> mean(x)
Displaying
Data
Histograms
[1] 7
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 21 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
> x < − c(4,5,6,6,6,7,7,7,7,7,7,8,8,8,9,10)
Objectives
> mean(x)
Displaying
Data
Histograms
[1] 7
Box Plots

Measures of
> median(x)
the Center of
Data [1] 7
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 21 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
Example 2
Chapter
Objectives
Compute the mean and the median for the data set in ex1.
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 22 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
Example 2
Chapter
Objectives
Compute the mean and the median for the data set in ex1.
Displaying
Data
Histograms
> mean(ex.1$height)
Box Plots

Measures of [1] 170.11


the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 22 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
Example 2
Chapter
Objectives
Compute the mean and the median for the data set in ex1.
Displaying
Data
Histograms
> mean(ex.1$height)
Box Plots

Measures of [1] 170.11


the Center of
Data > median(ex.1$height)
Measures of
the Spread of [1] 171
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 22 / 39
Presentation Outline

Lecture 3:
Descriptive
Statistics
1 Chapter Objectives
Assoc. Prof.
Amany E. Aly

Chapter
2 Displaying Data
Objectives
Histograms
Displaying
Data
Histograms
Box Plots
Box Plots

Measures of
the Center of
3 Measures of the Center of Data
Data

Measures of
the Spread of
4 Measures of the Spread of Data
Data

Solved
Exercises
5 Solved Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 23 / 39
Measures of the Spread of Data

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives
Example 3
Displaying
Data
Here are the ages of her students to the nearest half a year:
Histograms
Box Plots 9; 9.5; 9.5; 10; 10; 10; 10; 10.5; 10.5; 10.5; 10.5; 11; 11; 11; 11;
Measures of
the Center of 11; 11; 11.5; 11.5; 11.5.
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 24 / 39
Lecture 3:
Descriptive
Statistics
>x<− c(9,9.5,9.5,10,10,10,10,10.5,10.5,10.5,10.5,11,11,11,11,11, 11,11.5,11.5,11.5)
Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 25 / 39
Lecture 3:
Descriptive
Statistics
> x < − c(9,9.5,9.5,10,10,10,10,10.5,10.5,10.5,10.5,11,11,11,11,11, 11,11.5,11.5,11.5)
Assoc. Prof.
Amany E. Aly
> length(x)
Chapter
[1] 20
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 25 / 39
Lecture 3:
Descriptive
Statistics
> x < − c(9,9.5,9.5,10,10,10,10,10.5,10.5,10.5,10.5,11,11,11,11,11, 11,11.5,11.5,11.5)
Assoc. Prof.
Amany E. Aly
> length(x)
Chapter
[1] 20
Objectives
> x.bar < − mean(x)
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 25 / 39
Lecture 3:
Descriptive
Statistics
> x < − c(9,9.5,9.5,10,10,10,10,10.5,10.5,10.5,10.5,11,11,11,11,11, 11,11.5,11.5,11.5)
Assoc. Prof.
Amany E. Aly
> length(x)
Chapter
[1] 20
Objectives
> x.bar < − mean(x)
Displaying
Data
Histograms
> x.bar
Box Plots

Measures of
[1] 10.525
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 25 / 39
Lecture 3:
Descriptive
Statistics
> x < − c(9,9.5,9.5,10,10,10,10,10.5,10.5,10.5,10.5,11,11,11,11,11, 11,11.5,11.5,11.5)
Assoc. Prof.
Amany E. Aly
> length(x)
Chapter
[1] 20
Objectives
> x.bar < − mean(x)
Displaying
Data
Histograms
> x.bar
Box Plots

Measures of
[1] 10.525
the Center of
Data > x - x.bar
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 25 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
> (x - x.bar)2
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 26 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof. > sum((x − x.bar)2 )/(length(x) − 1)


Amany E. Aly
[1] 0.5125
Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 27 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof. > sum((x − x.bar)2 )/(length(x) − 1)


Amany E. Aly
[1] 0.5125
Chapter
Objectives > sqrt(sum((x − x.bar)2 )/(length(x) − 1))
Displaying
Data [1] 0.715891
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 27 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof. > sum((x − x.bar)2 )/(length(x) − 1)


Amany E. Aly
[1] 0.5125
Chapter
Objectives > sqrt(sum((x − x.bar)2 )/(length(x) − 1))
Displaying
Data [1] 0.715891
Histograms
Box Plots
> var(x)
Measures of
the Center of
Data
[1] 0.5125
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 27 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof. > sum((x − x.bar)2 )/(length(x) − 1)


Amany E. Aly
[1] 0.5125
Chapter
Objectives > sqrt(sum((x − x.bar)2 )/(length(x) − 1))
Displaying
Data [1] 0.715891
Histograms
Box Plots
> var(x)
Measures of
the Center of
Data
[1] 0.5125
Measures of
the Spread of
> sd(x)
Data
[1] 0.715891
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 27 / 39
Presentation Outline

Lecture 3:
Descriptive
Statistics
1 Chapter Objectives
Assoc. Prof.
Amany E. Aly

Chapter
2 Displaying Data
Objectives
Histograms
Displaying
Data
Histograms
Box Plots
Box Plots

Measures of
the Center of
3 Measures of the Center of Data
Data

Measures of
the Spread of
4 Measures of the Spread of Data
Data

Solved
Exercises
5 Solved Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 28 / 39
Solved Exercises

Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 29 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives
Question 1.
Displaying
Data
Three sequences of data were saved in 3 R objects named ”x1”,
Histograms
Box Plots
”x2” and ”x3”, respectively. Find the summary to each of these
Measures of
the Center of
objects.
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 30 / 39
Lecture 3:
Descriptive
Statistics
> summary(x1)
Assoc. Prof.
Amany E. Aly Min. 1st Qu. Median Mean 3rd Qu. Max.
Chapter
Objectives
0.000 2.498 3.218 3.081 3.840 4.871
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 31 / 39
Lecture 3:
Descriptive
Statistics
> summary(x1)
Assoc. Prof.
Amany E. Aly Min. 1st Qu. Median Mean 3rd Qu. Max.
Chapter
Objectives
0.000 2.498 3.218 3.081 3.840 4.871
Displaying
Data
> summary(x2)
Histograms
Box Plots Min. 1st Qu. Median Mean 3rd Qu. Max.
Measures of
the Center of 0.0001083 0.5772000 1.5070000 1.8420000 2.9050000 4.9880000
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 31 / 39
Lecture 3:
Descriptive
Statistics
> summary(x1)
Assoc. Prof.
Amany E. Aly Min. 1st Qu. Median Mean 3rd Qu. Max.
Chapter
Objectives
0.000 2.498 3.218 3.081 3.840 4.871
Displaying
Data
> summary(x2)
Histograms
Box Plots Min. 1st Qu. Median Mean 3rd Qu. Max.
Measures of
the Center of 0.0001083 0.5772000 1.5070000 1.8420000 2.9050000 4.9880000
Data

Measures of
the Spread of
> summary(x3)
Data
Min. 1st Qu. Median Mean 3rd Qu. Max.
Solved
Exercises 2.200 3.391 4.020 4.077 4.690 6.414
Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture
Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 31 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 32 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 33 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives Question 2.
Displaying
Data The number of toilet facilities in 30 buildings were counted. The
Histograms
Box Plots
results are recorded in an R object by the name ”x”.
Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 34 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
(1) Find the frequency table of the data ”x”?
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 35 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
(1) Find the frequency table of the data ”x”?
Objectives

Displaying
> table(x)
Data
Histograms x
Box Plots

Measures of 2 4 6 8 10
the Center of
Data 10 6 10 2 2
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 35 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly (2) What is the mean (x) of the data?
Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 36 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly (2) What is the mean (x) of the data?
Chapter
Objectives
> x.val <- c(2,4,6,8,10)
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 36 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly (2) What is the mean (x) of the data?
Chapter
Objectives
> x.val <- c(2,4,6,8,10)
Displaying > freq <- c(10,6,10,2,2)
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 36 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly (2) What is the mean (x) of the data?
Chapter
Objectives
> x.val <- c(2,4,6,8,10)
Displaying > freq <- c(10,6,10,2,2)
Data
Histograms
Box Plots
> rel.freq <- freq/sum(freq)
Measures of
the Center of
Data

Measures of
the Spread of
Data 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 36 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly (2) What is the mean (x) of the data?
Chapter
Objectives
> x.val <- c(2,4,6,8,10)
Displaying > freq <- c(10,6,10,2,2)
Data
Histograms
Box Plots
> rel.freq <- freq/sum(freq)
Measures of
the Center of
> x.bar <- sum(x.val∗rel.freq)
Data

Measures of
the Spread of
Data 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 36 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly (2) What is the mean (x) of the data?
Chapter
Objectives
> x.val <- c(2,4,6,8,10)
Displaying > freq <- c(10,6,10,2,2)
Data
Histograms
Box Plots
> rel.freq <- freq/sum(freq)
Measures of
the Center of
> x.bar <- sum(x.val∗rel.freq)
Data

Measures of
> x.bar
the Spread of
Data 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 36 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly Or
Chapter > x < − rep(x.val,freq)
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 37 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly Or
Chapter > x < − rep(x.val,freq)
Objectives

Displaying >x
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 37 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly Or
Chapter > x < − rep(x.val,freq)
Objectives

Displaying >x
Data
Histograms
Box Plots
[1] 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 6 6 6
Measures of
the Center of
[20] 6 6 6 6 6 6 6 8 8 10 10
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 37 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly Or
Chapter > x < − rep(x.val,freq)
Objectives

Displaying >x
Data
Histograms
Box Plots
[1] 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 6 6 6
Measures of
the Center of
[20] 6 6 6 6 6 6 6 8 8 10 10
Data
> mean(x)
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 37 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly Or
Chapter > x < − rep(x.val,freq)
Objectives

Displaying >x
Data
Histograms
Box Plots
[1] 2 2 2 2 2 2 2 2 2 2 4 4 4 4 4 4 6 6 6
Measures of
the Center of
[20] 6 6 6 6 6 6 6 8 8 10 10
Data
> mean(x)
Measures of
the Spread of
Data
[1] 4.666667
Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 37 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives > var.x < − sum((x.val-x.bar)2 ∗freq)/(sum(freq)-1)
Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives > var.x < − sum((x.val-x.bar)2 ∗freq)/(sum(freq)-1)
Displaying
Data > sqrt(var.x)
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives > var.x < − sum((x.val-x.bar)2 ∗freq)/(sum(freq)-1)
Displaying
Data > sqrt(var.x)
Histograms
Box Plots [1] 2.425914
Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives > var.x < − sum((x.val-x.bar)2 ∗freq)/(sum(freq)-1)
Displaying
Data > sqrt(var.x)
Histograms
Box Plots [1] 2.425914
Measures of
the Center of
Data
> sd(x)
Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive
Statistics

Assoc. Prof.
Amany E. Aly
(2) What is the sample standard deviation of the data?
Chapter
Objectives > var.x < − sum((x.val-x.bar)2 ∗freq)/(sum(freq)-1)
Displaying
Data > sqrt(var.x)
Histograms
Box Plots [1] 2.425914
Measures of
the Center of
Data
> sd(x)
Measures of [1] 2.425914
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 38 / 39
Lecture 3:
Descriptive (3) What is the median of the data?
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 39 / 39
Lecture 3:
Descriptive (3) What is the median of the data?
Statistics

Assoc. Prof.
Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 39 / 39
Lecture 3:
Descriptive (3) What is the median of the data?
Statistics

Assoc. Prof. > data.frame(x.val,cumsum(rel.freq))


Amany E. Aly

Chapter
Objectives

Displaying
Data
Histograms
Box Plots

Measures of
the Center of
Data

Measures of
the Spread of
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 39 / 39
Lecture 3:
Descriptive (3) What is the median of the data?
Statistics

Assoc. Prof. > data.frame(x.val,cumsum(rel.freq))


Amany E. Aly
x.val cumsum.rel.freq.
Chapter
Objectives 1 2 0.3333333
Displaying
Data 2 4 0.5333333
Histograms
Box Plots
3 6 0.8666667
Measures of
the Center of
Data
4 8 0.9333333
Measures of
the Spread of
5 10 1.0000000
Data

Solved
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 39 / 39
Lecture 3:
Descriptive (3) What is the median of the data?
Statistics

Assoc. Prof. > data.frame(x.val,cumsum(rel.freq))


Amany E. Aly
x.val cumsum.rel.freq.
Chapter
Objectives 1 2 0.3333333
Displaying
Data 2 4 0.5333333
Histograms
Box Plots
3 6 0.8666667
Measures of
the Center of
Data
4 8 0.9333333
Measures of
the Spread of
5 10 1.0000000
Data

Solved
> summary(x)
Exercises

Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture


Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 39 / 39
Lecture 3:
Descriptive (3) What is the median of the data?
Statistics

Assoc. Prof. > data.frame(x.val,cumsum(rel.freq))


Amany E. Aly
x.val cumsum.rel.freq.
Chapter
Objectives 1 2 0.3333333
Displaying
Data 2 4 0.5333333
Histograms
Box Plots
3 6 0.8666667
Measures of
the Center of
Data
4 8 0.9333333
Measures of
the Spread of
5 10 1.0000000
Data

Solved
> summary(x)
Exercises
Min. 1st Qu. Median Mean 3rd Qu. Max.
2.000 2.000 4.000 4.667 6.000 10.000
Assoc. Prof. Amany E. Aly ( Department of Mathematics, Faculty ofLecture
Science,3: Helwan
Descriptive
University,
Statistics
Ain Helwan, Cairo, Egypt.) 6 / 3 / 2023 39 / 39

You might also like