UPI: msuv992
library(s20x)
nzfood.df = read.csv("NZ_Food_Prices.csv", header=TRUE)
avocado.df = nzfood.df[nzfood.df$Item == "Avocados",]
avocado.df = avocado.df[!is.na(avocado.df$Value),]
boxplot(avocado.df$Value)
Center : 8.63 Spread : between 3.38 - 28.67 Skew : Right-skewed
normcheck(avocado.df$Value)
summaryStats(avocado.df$Value)
Minimum value: 3.38
Maximum value: 28.67
Mean value: 9.7
Median: 8.63
Upper quartile: 11.22
Lower quartile: 7.19
Variance: 17.54
Standard deviation: 4.19
Midspread (IQR): 4.03
Skewness: 1.77
Number of data values: 211
t.test(avocado.df$Value, mu=10)
One Sample t-test
data: avocado.df$Value
t = -1.0354, df = 210, p-value = 0.3017
alternative hypothesis: true mean is not equal to 10
95 percent confidence interval:
9.133091 10.269847
sample estimates:
mean of x
9.701469
Methods and Assumptions We want to identify whether the true mean price of avocados is equal to $520 as according to a popular YouTube guru. We accomplish this by carrying out a on sample t-test.
The avocados are assumed to be purchased independently of each other per week. The boxplot and QQ plot show that the data is right-skewed however Central Limit Thereom can be applied to justify our assumption of Normality.
The model fitted is \(Value_i\) = \(\mu + \varepsilon_i\) where \(\mu\) is the mean value of avocados and \(\varepsilon_i \overset{\text{iid}}{\sim} N(0, \sigma^2)\).
Executive Summary Our aim in analysing this data set is to confirm whether the YouTube guru’s claim about the weekly cost of $10 for a kg of avocado is true.
The results of our test shows that our mean price for avocados historically is between 9.10 and 10.30 NZ dollars.