Difference between revisions of "Página de pruebas"

From Sinfronteras
Jump to: navigation, search
Line 3: Line 3:
  
  
*'''1''' Use '''Least-squqres''' to fit a line to the data
+
In general, there are 3 main stages in Linear regression:
  
*'''2''' Clculate <math>R^2</math>
+
: '''1'''. Use '''Least-squqres''' to fit a line to the data
  
*'''3''' Calculate a <math>p-value</math> for <math>R^2</math>
+
: '''2'''. Calculate <math>R^2</math>
  
 +
: '''3'''. Calculate a <math>p-value</math> for <math>R^2</math>
  
 +
 +
<br />
 +
: '''1. Use '''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 the 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
 +
:* ...
 +
:* ...
 +
:* Then, we find the rotation that has the least RSS.
  
  

Revision as of 20:01, 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. Use Least-squqres to fit a line to the data
2. Calculate
3. Calculate a for



1. Use 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 the 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
  • ...
  • ...
  • Then, we find the rotation that has the least RSS.





SimpleLinearRegression2.png


The regression equation:

  • Dependent variable: :
  • Independent variable: :
  • Slope:
The slope is the amount of change in units of for each unitchange in .
  • intercept: :