One-dollar linear regression analysis note

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.