In: Statistics and Probability
32. Gas Prices for Rental Cars The first column of these data represents the prebuy gas price of a rental car, and the second column represents the price charged if the car is returned without refilling the gas tank for a selected car rental company. Draw two boxplots for the data and compare the distributions. (Note: The data were collected several years ago.)
Prebuy cost No prebuy cost
$1.55 $3.80
1.54 3.99
1.62 3.99
1.65 3.85
1.72 3.99
1.63 3.95
1.65 3.94
1.72 4.19
1.45 3.84
1.52 3.94
Solution-:
Let, x=Prebuy cost and y= No prebuy cost
By using R-Software:
>
x=c(1.55,1.54,1.62,1.65,1.72,1.63,1.65,1.72,1.45,1.52);x
[1] 1.55 1.54 1.62 1.65 1.72 1.63 1.65 1.72 1.45 1.52
> boxplot(x,main="Prebuy cost")
> f1=fivenum(x);f1
[1] 1.450 1.540 1.625 1.650 1.720
>
text(rep(1.3,5),f1,labels=c("Min=1.450","Q1=1.540","Med=1.625","Q3=1.650","Max=1.720"))
> Q1=1.540;Q2=1.625;Q3=1.650
> a1=Q3-Q2;a1
[1] 0.025
> a2=Q2-Q1;a2
[1] 0.085
> # Here, a1=Q3-Q2=0.025 < a2=Q2-Q1=0.085, hence distribution
is negatively skewed.
R-Code:
x=c(1.55,1.54,1.62,1.65,1.72,1.63,1.65,1.72,1.45,1.52);x
boxplot(x,main="Prebuy cost")
f1=fivenum(x);f1
text(rep(1.3,5),f1,labels=c("Min=1.450","Q1=1.540","Med=1.625","Q3=1.650","Max=1.720"))
Q1=1.540;Q2=1.625;Q3=1.650
a1=Q3-Q2;a1
a2=Q2-Q1;a2
# Here, a1=Q3-Q2=0.025 < a2=Q2-Q1=0.085, hence distribution is
negatively skewed.
>
y=c(3.80,3.99,3.99,3.85,3.99,3.95,3.94,4.19,3.84,3.94);y
[1] 3.80 3.99 3.99 3.85 3.99 3.95 3.94 4.19 3.84 3.94
> boxplot(y,main="No prebuy cost")
> f2=fivenum(y);f2
[1] 3.800 3.850 3.945 3.990 4.190
>
text(rep(1.3,5),f2,labels=c("Min=3.800","Q1=3.850","Med=3.945","Q3=3.990","Max=4.190"))
> Q1=3.850;Q2=3.945;Q3=3.990
> b1=Q3-Q2;b1
[1] 0.045
> b2=Q2-Q1;b2
[1] 0.095
> # Here, b1=Q3-Q2=0.045 <b2=Q2-Q1=0.095, hence distribution
is negatively skewed.
R-Code:
boxplot(y,main="No prebuy cost")
f2=fivenum(y);f2
text(rep(1.3,5),f2,labels=c("Min=3.800","Q1=3.850","Med=3.945","Q3=3.990","Max=4.190"))
Q1=3.850;Q2=3.945;Q3=3.990
b1=Q3-Q2;b1
b2=Q2-Q1;b2
# Here, b1=Q3-Q2=0.045 <b2=Q2-Q1=0.095, hence distribution is
negatively skewed.
From these two boxplot we seen that both data are said negatively skewed distribution.