Team Name

Rahul Lamba

Robert Adams

FA 4 Group 12

Reading data

cardat<-read.csv("https://raw.githubusercontent.com/tmatis12/datafiles/main/US_Japanese_Cars.csv")

Separation of Data

uscarmpg<-cardat$USCars
japancarmpg<-cardat$JapaneseCars
str(cardat)
## 'data.frame':    35 obs. of  2 variables:
##  $ USCars      : int  18 15 18 16 17 15 14 14 14 15 ...
##  $ JapaneseCars: int  24 27 27 25 31 35 24 19 28 23 ...

Does the mpg of both US cars and Japanese cars appear to be Normally distributed (use NPPs)?

US Car

qqnorm(uscarmpg)
qqline(uscarmpg)

Japan Car

qqnorm(japancarmpg)
qqline(japancarmpg)

Does the variance appear to be constant (use side-by-side box plots)?

boxplot(uscarmpg,japancarmpg,names=c('uscar','japancar'),main='Boxplot of Cars',ylab='Mpg')

Comment

Variance does not appear to be constant.

Transformation of Data

tranuscarmpg<-log(uscarmpg)
tranjapancarmpg<-log(japancarmpg)

Box Plot of Transform Data

boxplot(tranuscarmpg,tranjapancarmpg,names=c('uscar','japancar'),main='Boxplot of Cars',ylab='Mpg')

Transform NPP Plot

US Car

qqnorm(tranuscarmpg)
qqline(tranuscarmpg)

Japan Car

qqnorm(tranjapancarmpg)
qqline(tranjapancarmpg)

Comment

There in no significant change in transformed data, so data is not fit for T Test.

State the null and alternative hypothesis and test using a 0.05 level of significance.

Part (A) State the Hypotheses:

Null Hypotheses: \[H_{0}:\mu US car = \mu Japan Cae \]

\[ H_{0}: \mu US Car - \mu Japan Car = 0 \]

Alternative Hypotheses :\[H_{a}: \mu US Car \neq \mu Japan Car \]

\[ H_{a}: \mu US Car - \mu Japan Car \neq 0 \]

t.test(tranuscarmpg,tranjapancarmpg,var.equal=TRUE, alternative = "two.sided")
## 
##  Two Sample t-test
## 
## data:  tranuscarmpg and tranjapancarmpg
## t = -9.4828, df = 61, p-value = 1.306e-13
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
##  -0.6417062 -0.4182053
## sample estimates:
## mean of x mean of y 
##  2.741001  3.270957

What are the sample averages for the log of the mpg of US and Japanese cars?

US Car Average 2.74 MPG

Japan Car Average 3.27 MPG

State your conclusions

As Shown in early Box Plot of Data, there variance is not equal so there is no significant of performing Pooled Variance T Test.

We are going to fail reject Null Hypothesis that mean we select Null Hypothesis.