May 27, 2021 SAS
Linear regression is used to identify the relationship between a cause variable and one or more independent variables. A model of the relationship is proposed and an estimated regression equation is formed using the estimate of the parameter values.
Various tests are then used to determine whether the model is satisfactory. I f so, you can use the estimated regression equation to predict the value of a given value of the argument's cause variable. I n SAS, the program PROC REG is used to find a linear regression model between two variables.
The basic syntax for applying PROC REG in SAS is:
PROC REG DATA = dataset; MODEL variable_1 = variable_2;
The following is a description of the parameters used:
The following example shows the process of using PROC REG to find the correlation between two variables of horsepower and weight in a car. I n the result, we see intercept values that can be used to form regression equations.
PROC SQL; create table CARS1 as SELECT invoice,horsepower,length,weight FROM SASHELP.CARS WHERE make in ('Audi','BMW') ; RUN; proc reg data=cars1; model horsepower= weight ; run;
When we execute the code above, we get the following results:
The above code also gives a graphical view of the various estimates of the model, as shown below. A s an advanced SAS program, it does not stop giving intercept values as output.