# Decoding my Son’s Sleep Pattern via Linear Regression!

I know it is not a matter of National Security and many parents might not consider it to be a big deal too. But for me, my child retiring to bed early means meal prep, getting laundry and chores done, a long hot shower, a run to the salon/spa, date night, some leisure reading time and mostly not playing body guard to a toddler whose sole aim is to break stuff and in the process hurt himself. As a first time Mom, it was overwhelming at first but then I figured out a pattern. The time he spent in the park (running around and exhausting himself) determined the time he slept at. Logical, right?

This is what I found out –

· When he played for half an hour, he went to bed 11:00 pm

· When he played for 1 hour, he went to bed a at 10:30 pm

· When played for 1.5 hours, he went to bed at 09:30 pm

· When he played for 2 hours, he went to bed at 09:00 pm

· When he played for 2.5 hours, he went to bed at 08:00 pm

So, the more time he spent playing the earlier he slept.

Linear Regression provides a powerful statistical method to find a relationship between two variables.

Above mentioned graph denotes X (horizontal) & Y (vertical) axis. The X axis has independent variables and mentions the amount of time he spent playing. The Y axis has dependent variables and mentions the time at which he went to bed. It is safe to infer that the time he went to bed is dependent on the amount of time he played for and the two are inversely correlated. This correlation is denoted by the diagonal blue line in the graph. This line is called the line of best fit because it expresses the best relationship between a scattered data plot. In the above-mentioned example, the Intercept is obtained as 11.85 and the slope is obtained to be -1.5. So, the line of best fit can be defined as y = -1.5x + 11.85.

Although Linear equation is a vast subject of study, this concept remains its foundation. It is also extremely helpful for business owners and service providers in determining a relationship between sales/production/demand and supply. I hope it helps those struggling during this horrible pandemic to conduct their business and make profits effectively and efficiently.

******************