Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

for the data file, open R and type in > install.packages(\"alr4\") (Data file: U

ID: 3275020 • Letter: F

Question

for the data file, open R and type in >install.packages("alr4")

(Data file: UBSprices) This problem continues with the data file UBSprices described in Problem 2.2. Draw the plot of y = bigmac2009 versus x = bigmac2003, the price of a Big Mac hamburger in 2009 and 2003. On this plot draw (1) the ols fitted line: (2) the line y = x. Identify the most unusual cases and describe why they are unusual. Give two reasons why fitting simple linear regression to the figure in this problem is not likely to be appropriate. Plot log(bigmac2009) versus log(bigmac2003) and explain why this graph is more sensibly summarized with a linear regression.

Explanation / Answer

2.4.1

rm(list=ls(all=TRUE))
install.packages("alr4")
library(alr4)
z=UBSprices
y=c(z[,1])
x=c(z[,4])
plot(x,y)
abline(lm(y~x))

(2)

plot(x,y)
abline( lm(y~0+x))

2.4.2 First reasons is that there is not so much correlation between these variable and data variability is less

2.4.3

plot(log(x),log(y))
abline( lm(log(y)~log(x)))