Let X₁ represent the variable "Number of TV commercials" and X₂ represent the variable "car sales"
To calculate the Pearson correlation coefficient you have to apply the following formula:
[tex]r=\frac{\Sigma x_1x_x-\frac{(\Sigma x_1)(\Sigma x_2)}{n}}{\sqrt[]{\lbrack\Sigma x^2_1-\frac{(\Sigma x_1)^2}{n}\rbrack\lbrack\Sigma x^2_2-\frac{(\Sigma x_2)^2}{n}\rbrack}}[/tex]
First, you have to calculate the sums:
[tex]\begin{gathered} \Sigma x_1=3+7+12+16+18_{} \\ \Sigma x_1=56 \end{gathered}[/tex][tex]\begin{gathered} \Sigma x^2_1=3^2+7^2+12^2+16^2+18^2_{} \\ \Sigma x^2_1=9+49+144+256+324 \\ \Sigma x^2_1=782 \end{gathered}[/tex][tex]\begin{gathered} \Sigma x_2=2+3+9+8+9 \\ \Sigma x_2=31 \end{gathered}[/tex][tex]\begin{gathered} \Sigma x^2_2=2^2+3^2+9^2+8^2+9^2 \\ \Sigma x^2_2=4+9+81+64+81 \\ \Sigma x^2_2=239 \end{gathered}[/tex][tex]\begin{gathered} \Sigma x_1x_2=3\cdot2+7\cdot3+12\cdot9+16\cdot8+18\cdot9 \\ \Sigma x_1x_2=6+21+108+128+162 \\ \Sigma x_1x_2=425 \end{gathered}[/tex]
Now you can calculate the correlation coefficient:
[tex]\begin{gathered} r=\frac{425-\frac{56\cdot31}{5}}{\sqrt[]{\lbrack782-\frac{56^2}{5}\rbrack\lbrack239-\frac{31^2}{5}\rbrack}} \\ r=\frac{425-347.20}{\sqrt[]{\lbrack782-627.20\rbrack\lbrack239-192.20\rbrack}} \\ r=\frac{77.8}{\sqrt[]{154.80\cdot46.80}} \\ r=\frac{77.8}{\sqrt[]{7244.64}} \\ r=0.91405\approx0.914 \end{gathered}[/tex]
The correlation coefficient, rounded to three decimal places, is r=0.914