#Data analysis

# Daily Food Budget of BSS students
X = c(65,70,150,200,75,155,145,50,85,60,95,80,100,45,60,150,80,160,45,60,45,55,60,45,50,
      150,65,80,145,60,85,100,60,45,55,50,65,60,80,150,50,50,35,150,100,100,100,85,100,
      100,150,200,150,100,50,45,150,100,150,85,45,65)


# Individual Satisfaction on VSU Food Pricing 
Y = c(5,5,6,6,5,6,6,4,5,5,6,6,5,4,5,8,5,6,4,5,4,4,5,4,4,7,5,5,7,6,5,5,5,4,5,5,5,5,6,7,5,
      5,4,6,6,6,5,5,6,6,6,5,5,5,4,4,6,5,5,5,4,6)


DATA = cbind(X,Y)
DATA
##         X Y
##  [1,]  65 5
##  [2,]  70 5
##  [3,] 150 6
##  [4,] 200 6
##  [5,]  75 5
##  [6,] 155 6
##  [7,] 145 6
##  [8,]  50 4
##  [9,]  85 5
## [10,]  60 5
## [11,]  95 6
## [12,]  80 6
## [13,] 100 5
## [14,]  45 4
## [15,]  60 5
## [16,] 150 8
## [17,]  80 5
## [18,] 160 6
## [19,]  45 4
## [20,]  60 5
## [21,]  45 4
## [22,]  55 4
## [23,]  60 5
## [24,]  45 4
## [25,]  50 4
## [26,] 150 7
## [27,]  65 5
## [28,]  80 5
## [29,] 145 7
## [30,]  60 6
## [31,]  85 5
## [32,] 100 5
## [33,]  60 5
## [34,]  45 4
## [35,]  55 5
## [36,]  50 5
## [37,]  65 5
## [38,]  60 5
## [39,]  80 6
## [40,] 150 7
## [41,]  50 5
## [42,]  50 5
## [43,]  35 4
## [44,] 150 6
## [45,] 100 6
## [46,] 100 6
## [47,] 100 5
## [48,]  85 5
## [49,] 100 6
## [50,] 100 6
## [51,] 150 6
## [52,] 200 5
## [53,] 150 5
## [54,] 100 5
## [55,]  50 4
## [56,]  45 4
## [57,] 150 6
## [58,] 100 5
## [59,] 150 5
## [60,]  85 5
## [61,]  45 4
## [62,]  65 6

DATA CALCATIONS

Summations= read.csv("Pearsons R Summations.csv", header = T, sep = ",")

as.data.frame(Summations)
##        X     Y     X.2     Y.2     XY
## 1     65     5    4225      25    325
## 2     70     5    4900      25    350
## 3    150     6   22500      36    900
## 4    200     6   40000      36   1200
## 5     75     5    5625      25    375
## 6    155     6   24025      36    930
## 7    145     6   21025      36    870
## 8     50     4    2500      16    200
## 9     85     5    7225      25    425
## 10    60     5    3600      25    300
## 11    95     6    9025      36    570
## 12    80     6    6400      36    480
## 13   100     5   10000      25    500
## 14    45     4    2025      16    180
## 15    60     5    3600      25    300
## 16   150     8   22500      64   1200
## 17    80     5    6400      25    400
## 18   160     6   25600      36    960
## 19    45     4    2025      16    180
## 20    60     5    3600      25    300
## 21    45     4    2025      16    180
## 22    55     4    3025      16    220
## 23    60     5    3600      25    300
## 24    45     4    2025      16    180
## 25    50     5    2500      25    250
## 26   150     7   22500      49   1050
## 27    65     5    4225      25    325
## 28    80     5    6400      25    400
## 29   145     7   21025      49   1015
## 30    60     6    3600      36    360
## 31    85     5    7225      25    425
## 32   100     5   10000      25    500
## 33    60     4    3600      16    240
## 34    45     4    2025      16    180
## 35    55     5    3025      25    275
## 36    50     5    2500      25    250
## 37    65     5    4225      25    325
## 38    60     5    3600      25    300
## 39    80     6    6400      36    480
## 40   150     7   22500      49   1050
## 41    50     5    2500      25    250
## 42    50     5    2500      25    250
## 43    35     4    1225      16    140
## 44   150     6   22500      36    900
## 45   100     6   10000      36    600
## 46   100     6   10000      36    600
## 47   100     5   10000      25    500
## 48    85     5    7225      25    425
## 49   100     6   10000      36    600
## 50   100     6   10000      36    600
## 51   150     6   22500      36    900
## 52   200     5   40000      25   1000
## 53   150     5   22500      25    750
## 54   100     5   10000      25    500
## 55    50     4    2500      16    200
## 56    45     4    2025      16    180
## 57   150     6   22500      36    900
## 58   100     5   10000      25    500
## 59   150     5   22500      25    750
## 60    85     5    7225      25    425
## 61    45     4    2025      16    180
## 62    65     6    4225      36    390
## 63 SUM_X SUM_Y SUM_X^2 SUM_Y^2 SUM_XY
## 64  5595   324  616775    1740  30800

#Manual Computation: Using Pearson’s R correlation Analysis

\(n=62\)

\[r=\frac{n\Sigma(xy)-\Sigma(x)\Sigma(y)}{\sqrt([n(\Sigma(x^2)-(\Sigma(x)^2][n(\Sigma(y^2)-(\Sigma(y)^2])}\] \[r=\frac{62(30800)-(5595)(324)}{\sqrt([62(616775)-(5595)^2][62(1740)-(324)^2])}\]

\[=\frac{96820}{144923.3}\]

\[=0.6821995\] #R COdes Computation

#library(tidyverse)

Pearson_Correlation = cor.test(X,Y)
Pearson_Correlation
## 
##  Pearson's product-moment correlation
## 
## data:  X and Y
## t = 7.2272, df = 60, p-value = 1.024e-09
## alternative hypothesis: true correlation is not equal to 0
## 95 percent confidence interval:
##  0.5212477 0.7962870
## sample estimates:
##       cor 
## 0.6821996

HYPOTHESIS TESTING

Alternative and Null Hypothesis

\(H_{0}:p = 0\) : There is no significant linear relationship between BSS student’s daily food budget and satisfaction on the VSU food prices

\(H_{1}:p \neq 0\) : There is a significant linear relationship between BSS student’s daily food budget and satisfaction on the VSU food prices

Alpha:
\(a = 0.01\)

Test Statistics : T-TEST

\[t = \frac{r}{\sqrt(\frac{1-r^2}{n-2})}= t = \frac{0.6821996 }{\sqrt(\frac{1-(0.6821996 )^2}{62-2})}= 7.227215158\]

Decision Rule

qt(0.005,60, lower.tail = FALSE)
## [1] 2.660283

Reject \(H_{0}\) if \(|t_{c}|\ge t_{(0.005,60)} = 2.660283\), otherwise, do not reject \(H_{0}\).

Decision

We will reject \(H_{0}\) since \(t_{c}=7.227215158 \ge t_{(0.005,60)}= 2.660283\).

Conclusion

Therefore at 1% level of significance, we can say that the data is sufficient to conclude that there is a significant linear relationship between students daily food budget and their satisfaction on the food pricing at Visayas State University.

Generally, the result shows that as the BSS students allocated a greater amount of daily food budget, it indicates that their satisfaction on the pricing of food products also increases,since they can afford to buy their necessities and they have extra money to satisfy their cravings.

However, when they allocate smaller amount of daily food budget it means their satisfaction also decreases because due to the high prices of some food products, their budget is not sufficient to buy those products, thus they often buy affordable foods that serve as alternative to satisfy their hunger.