---
# System prepended metadata

title: '<center><i class="fa fa-edit"></i> Smart Dispenser: Data Analysis Proposals </center>'
tags: [Internship]

---

# <center><i class="fa fa-edit"></i> Smart Dispenser: Data Analysis Proposals </center>
###### tags: `Internship`
:::info
**Goal:**
To gain a basic understanding of the big data analytics techniques. Focus on any suggestions or improvements that can be made to the current Smart Dispenser Project data analysis.
- [x] Overview
- [x] Health Suggestions Based on Water Intake
- [x] Water Intake Suggestions Based on Preference of User
- [x] ANOVA test Among Temperature of Water (2)
- [x] ANOVA test Among Different BMIs
- [x] ANOVA test Among Different Heights (For Each Grade Level)
- [x] Linear Regression for BMI effect on Water Intake Levels
- [x] Linear Regression for Water Intake on BMI
- [x] Linear Regression for Height on Water Intake Levels (2)
- [x] Linear Regression for Water Intake Levels on Height (2)
- [x] Two Tailed T-test Between Faculty and Students' Water Intake Levels

**Resources:**
[Smart Dispenser Project](https://hackmd.io/@RayCheng/HJk_YpRou)
[MongoDB 常用Query指令](/b2Y7lgR1RaeQyMHp9RGHdQ)
[新興國中開始畫圖數據觀察](/IQjmnYUHSyCnOfTo_CQd-Q)
:::

---
:::spoiler **Expand Catalog**
[TOC]
:::

---

## Overview
- Focus on collection `processed_raw_data`
    - Contains:
        | Key      | Value    |
        | -------- | -------- |
        | CardID   |Stores the ID of the User's Card |
        | Choose   |"Hot", "Warm", or "Cold" water|
        | Dispenser|"xinxing01", "xinxing02", "xinxing03", "xinxing04", "xinxing05", "xinxing06"|
        | Timing   | Date (YYYY-MM-DD) and Time (HH:MM:SS)|
        | WaterTemp| Temperature of water in celcius |
        | WaterVolume |0.0~1015.0 mL          |
        | Class         | Class of student         |
        | Grade        |  Grade of student        |
        | Identity         | "Public" or "Private" |
        | Room         | Room of user         |
        | SchoolID         | "anyone"         |

**example**
```
{
    "_id" : ObjectId("627245505306ff4876844382"),
    "CardID" : "0443158826",
    "Choose" : "Cold",
    "Dispenser" : "xinxing01",
    "Timming" : "2021-10-01 06:44:33",
    "WaterTemp" : 6.0,
    "WaterVolume" : 1015.0,
    "Class" : "none",
    "Gender" : "none",
    "Grade" : "none",
    "Identity" : "Public",
    "Room" : "none",
    "SchoolID" : "anyone3"
}
```
:::
**Goals**
- Dynamically propose recommendations for people to analyze and improve their experience
    - Users: can further analyze the drinking habits of each member and make suggestions to improve health 
    - Managers: can provide recommendations for improving the UX design 

## Proposals
### Health Suggestions Based on Water Intake 
- A common recommendation is to drink six or eight 250 mL glasses of water or other fluid every day
- Therefore the range for the amount of healthy water intake is 1500 mL ~ 2000 mL
:::warning
1. Measure the water intake from the smart dispenser of the user in the whole day and see if the user is drinking a healthy amount of water and notify accordingly 
2. Can also keep track of which time periods the user prefers to take water and notify them during those time spans
3. Notify the user if there has been a prolonged time span in which they have not refilled for water (i.e. 2 hours or 3 hours)
:::

### Water Intake Suggestions Based on Preference of User
- Each person prefers to drink different amounts of water:
    - Some prefer to drink the recommended amount
    - Some would prefer to drink more if they are sick
    - Some would prefer to drink more if they are excersing throughout the day
    - Some prefer to drink less due to test taking.
:::warning
1. Can let user set the amount of water they prefer to drink each day and give notifcations accordingly 
2. User can alter the time span between notifications (i.e. User X can prefer to be notified every 1.5 hours)
3. Can recommend the temperature of water for the upcoming smart dispenser refill based on health conditions (i.e. User Y is sick and should have warm or hot water to help improve health so the system notifies the user of this suggestion)
:::

### ANOVA test Among Temperature of Water (2)
- Can conduct one for the entire data set
- Can conduct a test *for each grade level*
:::warning
What is the difference in average water intake levels in a whole day among XinXing Middle School students given three different temperature choices (Hot, Warm, Cold)?

**Needs hypothesis and null hypothesis**
Can use excel to conduct the test
(I have experience with this test)

Can inform students and staff if there is a significant difference to aid more intake of water
:::

### ANOVA test Among Different BMIs 
:::warning
What is the difference in average water intake levels in a whole day among XinXing Middle School students given three different weight ranges?

|          | Category         | BMI Range    |
| ---      | --------         | ----------   |
| 1.       | Underweight      | BMI＜18.5    |
| 2.       | Healthy Weight   | 18.5≦BMI＜24 |
| 3.       | Overweight       | 24≦BMI  |

OR

What is the difference in average water intake levels in a whole day among XinXing Middle School students given six different weight ranges?

|          | Category         | BMI Range    |
| ---      | --------         | ----------   |
| 1.       | Underweight      | BMI＜18.5    |
| 2.       | Healthy Weigh    | 18.5≦BMI＜24 |
| 3.       | Overweight       | 24≦BMI＜27   |
| 4.       | Mildy Obese      | 27≦BMI＜30   |
| 5.       | Moderately Obese | 30≦BMI＜35   |
| 6.       | Severely Obese   | BMI≧35       |

**Needs hypothesis and null hypothesis**
:::

### ANOVA test Among Different Heights (For Each Grade Level)
- This would require collecting data about the height of each student (May add significant amount of workload)
:::warning
 What is the difference in average water intake levels in a whole day among XinXing Middle School students given three different height ranges(short, average, tall)?
- The height ranges would be determined by 
    1. Finding the range of average heights of the grade level measured based on the data provided by the grade level
    2. Looking online for resources that state what the average height for students in that grade level should be
:::

### Linear Regression for BMI effect on Water Intake Levels
- Previous data was all done as CDF charts per person
- This aims to see if weight has an affect on water intake 

:::warning
1. X-axis: Weight of each student (based on BMI) from least to greatest
2. Y axis: Average water intake of each student in a day OR Average water intake of each student in a week (this probably requires more data processing and cleaning)
3. Graph line-of-best fit and see if there is strong correlation (absolute value of r-value is close to 1)
:::

### Linear Regression for Water Intake on BMI
- Help answers: Does higher water intake help lower BMI?
:::warning
- Opposite of the graph above, therefore, only need to conduct one of the two 
- Switch the X and Y axis
::: 

### Linear Regression for Height on Water Intake Levels (2)
- Can conduct one for the entire data set
- Can conduct a test *for each grade level*
:::warning
1. X-axis: Height of each student (in cm) from least to greatest
2. Y axis: Average water intake of each student in a day OR Average water intake of each student in a week (this probably requires more data processing and cleaning)
3. Graph line-of-best fit and see if there is strong correlation (absolute value of r-value is close to 1)
::: 

### Linear Regression for Water Intake Levels on Height (2)
- Can conduct one for the entire data set
- Can conduct a test *for each grade level*
- Help answers: Does higher water intake help students grow taller?
:::warning
- Opposite of the graph above, therefore, only need to conduct one of the two 
- Switch the X and Y axis
::: 

### Two Tailed T-test Between Faculty and Students' Water Intake Levels

:::warning
- Tests for an significant increase or decrease in the water intake levels between faculty and students

**Needs hypothesis and null hypothesis**

Can use excel to conduct the test

Graph can be conveyed by standard error bars
:::