Solution to: [Day 8: Pearson Correlation Coefficient II](https://www.hackerrank.com/challenges/s10-mcq-7/problem)

<h1 id="tocheading">Table of Contents</h1>
<div id="toc"></div>

- Table of Contents
- Solution
    - Write into regression form
    - Pearon's Coefficient Formula
    - Multiply equations
    - Direction


```javascript
%%javascript
$.getScript('https://kmahelona.github.io/ipython_notebook_goodies/ipython_notebook_toc.js')
```


    <IPython.core.display.Javascript object>


# Solution

## Write into regression form

\begin{equation}
\large
y = -2 + -\frac{3}{4} x
\end{equation}

and

\begin{equation}
\large
x = -\frac{7}{4} + - \frac{3}{4} y
\end{equation}


Thus:
- b1 = $-\frac{3}{4}$
- b2 = $-\frac{3}{4}$

## Pearon's Coefficient Formula

- p = pearson coefficient
- x_sd = standard deviation of x
- y_sd = standard deviation of y

\begin{equation}
\large
p = b1 \frac {x\_sd}{y\_sd}
\end{equation}

and

\begin{equation}
\large
p = b2 \frac {x\_sd}{y\_sd}
\end{equation}


## Multiply equations

\begin{equation}
\large
p^{2} = 
-\frac{3}{4} * 
-\frac{3}{4}
\end{equation}

\begin{equation}
\large
p^{2} = 
\frac{9}{16}
\end{equation}

\begin{equation}
\large
p = 
\frac{3}{4}
\end{equation}

## Direction

As both original lines are negative, they are negatively correlated by definition.

Answer:

\begin{equation}
\large
p = 
- \frac{3}{4}
\end{equation}

f1d3471dd8ee1433414173d5152ca8d2dfde9100
ipynb
Jupyter Notebook
statistics/10_days/26_day8pearsoncorrelationcoefficientii.ipynb
jaimiles23/hacker_rank
0580eac82e5d0989afabb5c2e66faf09713f891b
Apache-2.0
statistics/10_days/26_day8pearsoncorrelationcoefficientii.ipynb
jaimiles23/hacker_rank
0580eac82e5d0989afabb5c2e66faf09713f891b
Apache-2.0
statistics/10_days/26_day8pearsoncorrelationcoefficientii.ipynb
jaimiles23/hacker_rank
0580eac82e5d0989afabb5c2e66faf09713f891b
Apache-2.0
2021-09-22T11:06:58.000Z
2022-01-25T09:29:24.000Z
Qwen/Qwen-72B
1. YES
2. YES