In: Statistics and Probability
The following sets of data represent the cost of living index for utilities and the cost of living index for transportation for 46 randomly chosen metropolitan areas in the United States.
utilities=c(90,84,85,106,83,101,89,125,105, 118,133,104,84,80,77,90,92,90, 106,95,110,112,105,93,119,99,109, 109,113,90,121,120,85,91,91,97, 95,115,99,86,88,106,80,108,90,87)
transportation=c(100,91,103,103,109,109,94,114,113, 120,130,117,109,107,104,104,113,101, 96,109,103,107,103,102,101,86,94, 88,100,104,119,116,104,121,108,86, 100,83,88,103,94,125,115,100,96,127)
Include your R commands and output for each part of the problem
uti=sort(utilities)
> uti
[1] 77 80 80 83 84 84 85 85 86 87 88 89 90 90 90 90 90 91 91 92 93
95 95 97 99 99 101
[28] 104 105 105 106 106 106 108 109 109 110 112 113 115 118 119
120 121 125 133
> mean=mean(uti)
> mean
[1] 99.02174
mode=90
var=var(uti)
> var
[1] 184.0217
> sd=sd(uti)
> sd
[1] 13.56546
> median=median(uti)
> median
[1] 96
>
dt=data.frame(summry=c(99.02174,96,90,13.5654,184.0217),stat=c("mean","median","mode","sd","variance"))
> dt
summry stat
1 99.02174 mean
2 96.00000 median
3 90.00000 mode
4 13.56540 sd
5 184.02170 variance
## Transportation ##
> tra=sort(transportation)
> tra
[1] 83 86 86 88 88 91 94 94 94 96 96 100 100 100 100 101 101 102
103 103 103 103 103 104 104 104 104
[28] 107 107 108 109 109 109 109 113 113 114 115 116 117 119 120
121 125 127 130
> mean=mean(tra);mean
[1] 104.7609
> median=median(tra);median
[1] 103.5
> mode=103
> var=var(tra)
> var
[1] 122.4082
> sd=sd(tra)
> sd
[1] 11.06382
>
dt1=data.frame(summry=c(104.7609,103.5,103,11.063,122.4082),stat=c("mean","median","mode","sd","variance"))
> dt1
summry stat
1 104.7609 mean
2 103.5000 median
3 103.0000 mode
4 11.0630 sd
5 122.4082 variance
Boxplot of utilities
boxplot(uti)
boxplot of trasportation
boxplot(tra)
1.As from the summary of the two data set we observe that first data set utilities look like positively skewed because from the summary we observe that
mean > median> mode
In that case the distribution is positively skewed.
also form the box plot we observe that the data has no any outliers
.
2. And from the second data set transportation we observe that the data set is approximately symmetric because the mean median and mode are approximately equal.
Also from the box plot we observe that the there is no outliers is the data set.