This histogram visualizes the salary distribution of different academic professions.
In this Markdown, we use the dataset “Salary” to answer:
o How does the distribution look? Describe its shape:
o How many peaks - unimodal, bimodal, or other
o Is it symmetrical?
o Does it have a left or right tail? Are there outliers?
To answer these questions, we will use built-in functions in R to show the frequency and distribution histograms of the salary.
Read the data:
setwd("~/Desktop/Stat Computing/Data Sets")
Salary<- read.csv('Salary.csv')
x<- Salary[,2]
The following histogram shows the frequency distribution of salaries.
xlab="Salary per Title "
main="Distribution of Salaries"
hist(x, xlab=xlab, main=main)
The following histogram shows the density distribution of salaries.
xlab="Salary per Title "
main="Distribution of Salaries"
hist(x, freq=FALSE, xlab=xlab, main=main)
The freqency and density histogram of salaries per academic profession (i.e. Title) is centered around about 60 and is slightly skewed towards the right.
How does the distribution look? Describe its shape
The distribution is relatively symmetrical, with a slight skew towards the right.
How many peaks - unimodal, bimodal, or other?
The distribution is unimodal.
Is it symmetrical?
The distribution is slightly symmetrical.
Does it have a left or right tail? Are there outliers?
The distribution has a right tail. To determine if there were any outliers, the following R script was run:
boxplot(x, data=Salary)
boxplot(x)$out
## [1] 123 134 139 141
The outliers of the data are: 122, 134, 139, 141.