In: Statistics and Probability
Consider the following Data:
Year |
Tea |
Coffee |
---|---|---|
1994 |
42.4 |
95.85 |
1995 |
42.12 |
97.28 |
1996 |
47.61 |
87.62 |
1997 |
60.86 |
92.04 |
1998 |
55.58 |
99.21 |
1999 |
50.61 |
95.63 |
2000 |
49.89 |
97.42 |
2001 |
56.77 |
93.93 |
2002 |
62.53 |
95.67 |
2003 |
68.31 |
99.25 |
2004 |
69.88 |
101.31 |
2005 |
72.99 |
101.68 |
2006 |
71.36 |
104.02 |
2007 |
90.78 |
106.09 |
2008 |
74.7 |
105.8 |
2009 |
67.15 |
102.15 |
2010 |
67.03 |
101.15 |
2011 |
87.83 |
104.05 |
2012 |
93.4 |
102.7 |
2013 |
78.9 |
105.28 |
2014 |
111.32 |
106.3 |
2015 |
98.39 |
104.96 |
2016 |
105.25 |
103.57 |
Here I attach the R code with output
tea=c(42.4,42.12,47.61,60.86,55.58,50.61,49.89,56.77,62.53,68.31,69.88,72.99,71.36,90.78,74.7,67.15,67.03,87.83,93.4,78.9,111.32,98.39,105.25)
coffee=c(95.85,97.28,87.62,92.04,99.21,95.63,97.42,93.93,95.67,99.27,101.31,101.68,104.02,106.09,105.8,102.15,101.15,104.05,102.7,105.28,106.3,104.96,103.57)
year=c(1994:2016)
mean(tea)
median(tea)
mfv1(tea)
range(tea)
mean(coffee)
median(coffee)
mfv1(coffee)
range(coffee)
hist(coffee)
hist(tea)
boxplot(coffee)
boxplot(tea)
plot(coffee,tea)
plot(year,coffee)
plot(year,tea)
m=lm(coffee~tea)
summary(m)
cor(coffee,tea)
The measure of central tendency are mean, median , mode(mfv-most frequent observation) etc..
Measure of spread is range
range(tea)=111.32-42.12=69.2
range(coffee)=106.30-87.62=18.68
Boxplot of coffee
From the plot it is clear that the distribution is negatively skewed and there is no outliers in the data.
Boxplot of tea
From the plot we can infer that the distribution is positively skewed and there is no outliers in the model.
The correlation between Coffee and tea is 0.769, which implies there is positive linear relatioship exist between the variable tea and coffee.
The obtained model is:
coffee=86.3200+0.1954*tea