2025-03-15

Hypothesis Testing

Involves the procedural testing of a particular data set that relates to a theory in order to prove.

Research Hypothesis is part of the hypothesis testing that consist of the theory needed to be tested.

Null Hypothesis \[H_O:\mu=O\] counteracts the research hypothesis with the intent to have no Affect from the data set.

Data Set

this data set was collected from a csv file ‘steps_tracker_dataset.csv’ found online through the website https://www.kaggle.com/datasets/monicahjones/steps-tracker-dataset/data

## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
##           date steps distance_km calories_burned active_minutes sleep_hours
## 1   08/10/2022  4147        3.11          124.41             41        10.5
## 2   11/06/2022   323        0.24            9.69              3         6.0
## 3   28/01/2022  6622        4.97          198.66             66         6.0
## 4   23/03/2022 11136        8.35          334.08            111         8.0
## 5   20/05/2022  2718        2.04           81.54             27         4.9
## 6   26/12/2022  4972        3.73          149.16             50         6.0
## 7   27/07/2022 15271       11.45          458.13            153         3.4
## 8   13/07/2022 17290       12.97          518.70            173        11.6
## 9   17/06/2022  1042        0.78           31.26             10         6.5
## 10  25/06/2022  6818        5.11          204.54             68         6.5
## 11  16/01/2022 13141        9.86          394.23            131         6.5
## 12  16/06/2022  5046        3.78          151.38             50         6.0
## 13  30/10/2022 11615        8.71          348.45            116         7.8
## 14  22/08/2022  4301        3.23          129.03             43         9.0
## 15  22/07/2022  8655        6.49          259.65             87         9.0
## 16  08/09/2022 14113       10.58          423.39            141         7.0
## 17  09/07/2022 15435       11.58          463.05            154         6.5
## 18  04/04/2022 18451       13.84          553.53            185         8.0
## 19  26/01/2022 11850        8.89          355.50            119         6.5
## 20  24/01/2022  1075        0.81           32.25             11         7.0
## 21  28/07/2022  5340        4.01          160.20             53         4.8
## 22  09/02/2022 13972       10.48          419.16            140         6.0
## 23  06/08/2022 17002       12.75          510.06            170         9.0
## 24  31/10/2022  7786        5.84          233.58             78         6.0
## 25  26/03/2022 10776        8.08          323.28            108         6.0
## 26  19/05/2022 15203       11.40          456.09            152         6.5
## 27  10/05/2022  2644        1.98           79.32             26        10.6
## 28  13/05/2022  1905        1.43           57.15             19         3.3
## 29  13/06/2022  7467        5.60          224.01             75         6.5
## 30  24/07/2022 15005       11.25          450.15            150         8.2
## 31  01/02/2022  1811        1.36           54.33             18         4.6
## 32  23/01/2022 17812       13.36          534.36            178         8.0
## 33  08/05/2022  1193        0.89           35.79             12         3.1
## 34  07/03/2022 14118       10.59          423.54            141         6.0
## 35  20/08/2022 17536       13.15          526.08            175         8.3
## 36  20/09/2022  8159        6.12          244.77             82         4.8
## 37  01/08/2022 16123       12.09          483.69            161         8.0
## 38  26/07/2022  5606        4.20          168.18             56         8.0
## 39  07/07/2022  6292        4.72          188.76             63         9.0
## 40  23/01/2022  7740        5.81          232.20             77         6.5
## 41  17/08/2022  8678        6.51          260.34             87         6.5
## 42  01/03/2022  5861        4.40          175.83             59         5.7
## 43  22/04/2022 10948        8.21          328.44            109         6.0
## 44  14/12/2022 11079        8.31          332.37            111         6.5
## 45  03/03/2022 14928       11.20          447.84            149         8.7
## 46  21/05/2022 19940       14.96          598.20            199         6.0
## 47  11/01/2022 10598        7.95          317.94            106         7.0
## 48  06/03/2022 17134       12.85          514.02            171         4.8
## 49  29/08/2022  3276        2.46           98.28             33         6.0
## 50  16/11/2022 17751       13.31          532.53            178         7.0
## 51  14/02/2022  6679        5.01          200.37             67         5.6
## 52  18/01/2022  8929        6.70          267.87             89         8.0
## 53  15/04/2022   329        0.25            9.87              3         8.0
## 54  13/03/2022 17094       12.82          512.82            171         6.5
## 55  25/04/2022  1964        1.47           58.92             20         5.2
## 56  30/07/2022 19702       14.78          591.06            197         6.0
## 57  12/01/2022 13813       10.36          414.39            138         6.5
## 58  03/02/2022  6169        4.63          185.07             62         8.0
## 59  16/06/2022 11000        8.25          330.00            110         8.0
## 60  12/11/2022  6683        5.01          200.49             67         6.0
## 61  10/03/2022   843        0.63           25.29              8         8.0
## 62  05/06/2022  5397        4.05          161.91             54         6.5
## 63  06/07/2022 12976        9.73          389.28            130         8.0
## 64  08/02/2022  2169        1.63           65.07             22         8.0
## 65  18/04/2022  7287        5.47          218.61             73         9.1
## 66  14/05/2022 10720        8.04          321.60            107         6.0
## 67  07/09/2022   765        0.57           22.95              8         7.0
## 68  24/06/2022 18989       14.24          569.67            190         8.0
## 69  12/09/2022  3105        2.33           93.15             31         6.8
## 70  18/01/2022  7445        5.58          223.35             74         4.8
## 71  15/12/2022 15063       11.30          451.89            151         6.0
## 72  15/03/2022  1505        1.13           45.15             15         8.4
## 73  10/10/2022 18313       13.73          549.39            183         6.5
## 74  16/01/2022 13681       10.26          410.43            137        10.9
## 75  18/11/2022 17964       13.47          538.92            180         4.4
## 76  24/10/2022  8497        6.37          254.91             85         9.0
## 77  01/04/2022 17993       13.49          539.79            180         7.0
## 78  14/06/2022 19143       14.36          574.29            191         6.0
## 79  22/04/2022 19529       14.65          585.87            195        10.7
## 80  17/10/2022  1683        1.26           50.49             17         9.0
## 81  25/04/2022 14008       10.51          420.24            140        12.0
## 82  16/07/2022 10941        8.21          328.23            109         8.5
## 83  30/11/2022  6220        4.67          186.60             62         9.0
## 84  09/01/2022 19260       14.45          577.80            193         6.5
## 85  22/05/2022  4237        3.18          127.11             42         6.0
## 86  29/12/2022 16177       12.13          485.31            162         7.0
## 87  11/08/2022  5179        3.88          155.37             52         8.0
## 88  03/04/2022 17215       12.91          516.45            172         6.5
## 89  25/03/2022 15893       11.92          476.79            159         8.0
## 90  29/06/2022  8761        6.57          262.83             88         4.1
## 91  09/08/2022 14137       10.60          424.11            141         5.5
## 92  19/02/2022 19389       14.54          581.67            194         8.0
## 93  30/07/2022 12523        9.39          375.69            125         4.0
## 94  23/12/2022  2005        1.50           60.15             20         4.6
## 95  14/09/2022 18641       13.98          559.23            186         8.0
## 96  12/06/2022 15534       11.65          466.02            155         3.1
## 97  12/12/2022 11182        8.39          335.46            112         9.0
## 98  14/03/2022  5966        4.47          178.98             60         6.0
## 99  28/11/2022 16126       12.09          483.78            161         6.0
## 100 16/12/2022  7321        5.49          219.63             73         8.4
##     water_intake_liters      mood
## 1                  3.77  stressed
## 2                  1.90       sad
## 3                  4.48       sad
## 4                  1.08     tired
## 5                  1.00     tired
## 6                  3.33     happy
## 7                  0.88     happy
## 8                  4.08 energetic
## 9                  2.49     happy
## 10                 3.61  stressed
## 11                 2.35     tired
## 12                 4.03     happy
## 13                 0.43  stressed
## 14                 2.87     happy
## 15                 0.94     happy
## 16                 1.17  stressed
## 17                 4.83 energetic
## 18                 1.35       sad
## 19                 2.79  stressed
## 20                 2.09       sad
## 21                 2.53     happy
## 22                 1.18 energetic
## 23                 2.92     tired
## 24                 0.74  stressed
## 25                 4.65       sad
## 26                 1.02 energetic
## 27                 0.84       sad
## 28                 3.44  stressed
## 29                 2.47       sad
## 30                 2.06     happy
## 31                 3.45  stressed
## 32                 1.08  stressed
## 33                 4.12 energetic
## 34                 3.77  stressed
## 35                 0.39     tired
## 36                 2.83     tired
## 37                 4.35       sad
## 38                 1.46     tired
## 39                 0.80     tired
## 40                 3.32  stressed
## 41                 2.70  stressed
## 42                 2.78 energetic
## 43                 0.84 energetic
## 44                 0.99     tired
## 45                 2.01     happy
## 46                 0.24     tired
## 47                 1.45 energetic
## 48                 0.47  stressed
## 49                 3.36  stressed
## 50                 0.30     happy
## 51                 2.41  stressed
## 52                 2.04     tired
## 53                 1.96     happy
## 54                 4.43       sad
## 55                 2.19     happy
## 56                 0.68     happy
## 57                 1.83     tired
## 58                 4.42 energetic
## 59                 1.15 energetic
## 60                 2.44     tired
## 61                 2.18     tired
## 62                 1.68       sad
## 63                 2.59       sad
## 64                 2.19     tired
## 65                 4.30     happy
## 66                 4.88     tired
## 67                 3.33       sad
## 68                 3.95  stressed
## 69                 4.90     happy
## 70                 4.58     tired
## 71                 2.09 energetic
## 72                 4.38     happy
## 73                 4.42  stressed
## 74                 4.31     tired
## 75                 2.44       sad
## 76                 1.44     happy
## 77                 1.30  stressed
## 78                 3.63     happy
## 79                 4.44  stressed
## 80                 2.84  stressed
## 81                 4.71 energetic
## 82                 4.54     happy
## 83                 0.65     tired
## 84                 4.03  stressed
## 85                 1.77     tired
## 86                 3.22     tired
## 87                 1.92     tired
## 88                 2.89  stressed
## 89                 2.45     tired
## 90                 1.82       sad
## 91                 2.73       sad
## 92                 3.44       sad
## 93                 4.66 energetic
## 94                 3.13  stressed
## 95                 1.58     tired
## 96                 4.50     happy
## 97                 4.20     happy
## 98                 0.28     tired
## 99                 4.19     happy
## 100                0.79  stressed

Hypothesis

Research Hypothesis More sleep allows more energy to heighten step perfomance.

Null Hypothesis sleep does not contribute to step performance.

Distribution in steps

## `stat_bin()` using `bins = 30`. Pick better value with `binwidth`.

Steps According to Mood

Energetic shows that there are most steps, and tired indicated the least amount of steps.

Mood vs. Sleep

##      [,1]
## [1,]  0.7
## [2,]  1.9
## [3,]  3.1
## [4,]  4.3
## [5,]  5.5

An average of more sleep lead to being more tired.

pie chart of steps and mood

Steps to Hours of Sleep

this plot shows that there are no significant truth in regards to how sleep affect number of steps.

Results

using the Z statistics formula \(z=(\chi-\mu)/\sigma\)

result = (10238.48-10238.57)/5829.268
result
## [1] -1.543933e-05

From the results based on the statistical graphs more sleep does not indicate more steps performed