Difference between revisions of "Página de pruebas"

From Sinfronteras
Jump to: navigation, search
Line 48: Line 48:
  
 
[[File:Linear_regression2.png|600px|thumb|center|Takinf from https://www.youtube.com/watch?v=nk2CQITm_eo&t=267s]]
 
[[File:Linear_regression2.png|600px|thumb|center|Takinf from https://www.youtube.com/watch?v=nk2CQITm_eo&t=267s]]
 +
 +
 +
[[File:Linear_regression3.png|600px|thumb|center|Takinf from https://www.youtube.com/watch?v=nk2CQITm_eo&t=267s]]
  
 
</blockquote>
 
</blockquote>
Line 53: Line 56:
  
 
<br />
 
<br />
<br />
+
: '''3. Calculating a <math>p-value</math> for <math>R^2</math>'''
 +
<blockquote>
 +
We need a way to determine if the <math>R^2</math> value is statistically significant. So, we need a <math>p-value</math>.
 +
 
 +
</blockquote>
  
  

Revision as of 21:45, 27 December 2020

Simple Linear Regression

https://www.youtube.com/watch?v=nk2CQITm_eo&t=267s


In general, there are 3 main stages in Linear regression:

1. Using Least-squares to fit a line to the data
2. Calculating
3. Calculating a for



1. Using Least-squares to fit a line to the data
  • First, draw a line through the data.
  • Second, calculate the Residual sum of squares: Measure the distance from the line to each data point (residual), square each distance, and then add them up.
The distance from a line to a data point is called a residual
  • Then, we rotate the line a little bit and calculate the RSS. We do this many times.
  • ...
  • Then, the line that represents the linear regression is the one corresponding to the rotation that has the least RSS. The regression equation:
Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle y = a + bx }
The equation is composed of 2 parameters:
  • Slope: Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle b }
The slope is the amount of change in units of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle y} for each unitchange in Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle x} .
  • The Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle y-axis} intercept: Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle a }



2. Calculating Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle R^2}

In the following example, they are using different terminology to the one that we saw in Section Data_Science#The_coefficient_of_determination_R.5E2

It is very important to note how the result of Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle R^2} . In our example There is a 60% reduction in variance when we take the mouse weight into account or Mouse weight "explains" 60% of the variation in mouse size.




3. Calculating a Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle p-value} for Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle R^2}

We need a way to determine if the Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle R^2} value is statistically significant. So, we need a Failed to parse (MathML with SVG or PNG fallback (recommended for modern browsers and accessibility tools): Invalid response ("Math extension cannot connect to Restbase.") from server "https://en.wikipedia.org/api/rest_v1/":): {\displaystyle p-value} .