lectures.alex.balgavy.eu

Lecture notes from university.
git clone git://git.alex.balgavy.eu/lectures.alex.balgavy.eu.git
Log | Files | Refs | Submodules

Relationships between variables.html (6773B)


      1 <?xml version="1.0" encoding="UTF-8"?>
      2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      3 <html><head><link rel="stylesheet" href="sitewide.css"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/><meta name="exporter-version" content="Evernote Mac 7.6 (457297)"/><meta name="altitude" content="-4.208069801330566"/><meta name="author" content="Alex Balgavy"/><meta name="created" content="2018-12-16 00:43:31 +0000"/><meta name="latitude" content="52.30035400390625"/><meta name="longitude" content="4.988170682800604"/><meta name="source" content="desktop.mac"/><meta name="updated" content="2018-12-16 01:28:13 +0000"/><title>Relationships between variables</title></head><body><h1>Relationships between variables</h1><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">relationship can be investigated, causality can’t.</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">graphically, you can use scatterplots:</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><img src="Relationships%20between%20variables.resources/F12DF64D-BE0B-4F8A-8C6E-7D70FE8156EB.png" height="562" width="578"/><br/></div><h2>Correlation</h2><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">correlation: if values of two variables are somehow associated with each other</div><ul><li><div>positive: higher values of variable 1 are usually associated with higher values of variable 2</div></li><li><div>negative: higher values of variable 1 are usually associated with lower values of variable 2</div></li></ul><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">linear if the plotted points are basically a straight line.</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">population linear correlation coefficient is ρ.</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">sample linear correlation coefficient (estimator for ρ\rhoρ) is:</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="font-size: 16px;">
      4 <img src="Relationships%20between%20variables.resources/8E22EE8D-B71D-416D-8415-4ECBBC119876.png" height="40" width="251"/></span><br/></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">interpreting r:</div><ul><li><div>r = 1: perfect positive linear relationship</div></li><li><div>r &gt;0: positive linear relationship</div></li><li><div>r ≈ 0: no linear relationship (doesn’t mean no relationship!!)</div></li><li><div>r &lt; 0: negative linear relationship</div></li><li><div>r = −1: perfect negative linear relationship</div></li></ul><h3>Testing ρ = 0</h3><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">test statistic:</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="font-size: 16px;">
      5 <img src="Relationships%20between%20variables.resources/1D4C0EE4-B01F-40B8-B032-F153ABFDB821.png" height="51" width="93"/></span><br/></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">has under H0: ρ = 0 a t-distribution with n−2 degrees of freedom.</div><h2>Regression</h2><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">if there’s a correlation, points can be described by line 
      6 <img src="Relationships%20between%20variables.resources/86406A4F-1BB7-48E5-B1DF-0F3E45144091.png" height="14" width="142"/></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">regression equation is 
      7 <img src="Relationships%20between%20variables.resources/E70E7CBD-825E-4743-9AAB-CF98B110B48B.png" height="14" width="75"/></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">where b<sub>0</sub> and b<sub>1</sub> are least-squares estimates of β<sub>0</sub> and β<sub>1</sub></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">you want values that satisfy least-squares property (i.e. minimise
      8 <img src="Relationships%20between%20variables.resources/18E0D7AC-18DF-4AB8-B3F5-384049971D0A.png" height="32" width="144"/>)</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="font-size: 16px;">
      9 <img src="Relationships%20between%20variables.resources/351CFA24-FF67-4EB2-9251-87FFDEE4120E.png" height="56" width="216"/></span><br/></div><h3>Testing linearity</h3><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">Test:</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">H0: β<sub>1</sub> = 0</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">HA: β<sub>1</sub> ≠ 0</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">The score is:</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="font-size: 16px;">
     10 <img src="Relationships%20between%20variables.resources/710FB15A-F331-4DC1-97D6-28F8F343C01D.png" height="39" width="58"/></span><br/></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">(realisation of test statistic T<sub>β</sub> that has t-distribution with n−2 degrees of freedom under H0)</div><h3>Coefficient of determination</h3><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">Coefficient of determination is proportion of variation in y variable that regression equation can explain:</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="font-size: 16px;">
     11 <img src="Relationships%20between%20variables.resources/B57D5FB5-3C42-4448-9176-CED13640FC5B.png" height="35" width="171"/></span><br/></div><h3>Residuals</h3><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><div>To check for a fixed standard deviation, make a residual plot.</div><div>
     12 Residuals are estimates for the errors.</div><div>
     13 residual: difference between observed y<sub>i</sub> and predicted value 
     14 <img src="Relationships%20between%20variables.resources/D34A4C4D-E461-45E7-AEFB-37860E5126A6.png" height="14" width="83"/></div></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><span style="font-size: 16px;">
     15 <img src="Relationships%20between%20variables.resources/1E0FEC5E-6CCD-43CF-9C55-94EE42D1B04B.png" height="18" width="258"/></span><br/></div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;">A residual plot is scatterplot of residuals against x values. Should be no obvious pattern in residuals.</div><div style="margin-top: 1em; margin-bottom: 1em;-en-paragraph:true;"><img src="Relationships%20between%20variables.resources/3A61D08D-CDAF-400A-A557-A3F3F1F65F68.png" height="422" width="847"/><br/></div><div><br/></div></body></html>