1. Definition:
The existing samples are used to produce self-fitted equations to predict (unknown data).
2. use:
To predict, to judge rationally.
3. Classification:
Linear regression analysis: Unary linear regression, multivariate linear regression, generalized linearity (transforming nonlinearity into linear regression,logic regression)
Nonlinear regression analysis
4. Difficulties:
Variable selection, multiple collinearity, observing fitting equations, avoiding overfitting
5. Relationship:
Functional relationships: Deterministic relationships,y=a*x+b
Related relationships: non-deterministic relationships
Correlation coefficient: positive correlation (with increasing the same length), negative correlation (with increase and decrease)
6. Unary linear regression model :
1) If there is a strong correlation between X and y , then we have y≈a+b X
2) If the value of a not B is known, then the corresponding X value, we can according to Y≈a+bX Get the predicted value of the corresponding Y
7. Parameters:
Y=a+bx+e,a is the Intercept,b is the slope, ande is the error term.
8. Determine parameters: Use squared error and measure the difference between the false value of the predicted value
Least squares:
RSS is actually a function of a and B:
9. Unary Linear regression analysis:
1) principle, least squares
2) Step: Establish the regression model, solve the parameters in the regression model, import the regression model to the line test
10.R Analysis:
1) input data
2) Build model:z=lm (y~x+1)/LM (y~x) indicates intercept,z=lm (y~x-1)/LM (y~x+0)/lm (y~x-0 ) Indicates that there is no intercept through the origin point.
3)plot (z) output scatter plot
4)summary (z), output results.
5)plot (z) outputs various graphs.
some other R functions:
Build Model:Z=LM (y~x+1)/LM (y~x) indicates intercept,z=lm (y~x-1)/LM (y~x+0)/LM (y~x-0) indicates that there is no intercept through the origin.
Plot (z) output scatter plot
Variance analysis,Anova ()
Make predictions,predict (a,z)
Printing model information Print (a)
Calculate residuals residuals (a)
Calculates residuals squared and deviance (a)
Extracting model Formula formula (a)
Model coefficient Coef (a)
One-dollar linear regression analysis note