# 5 Min Tutorial – SAS Linear Regression with PROC REG Procedure

Keeping you updated with latest technology trends, Join DataFlair on Telegram

## 1. Objective

In last SAS tutorial, we discuss SAS Scatter Plot. Today we will look at a statistical procedure called SAS linear regression and how Linear Regression is used in SAS to indicate a relationship between a dependent and an independent variable. Moreover, we will also discuss Proc Reg procedure and SAS Linear regression between two variables with some examples of Linear regression in SAS Programming language.

So, let’s start Linear Regression in SAS Programming Language.

## 2. SAS Linear Regression

Linear regression in SAS is a basic and commonly use type of predictive analysis. Linear regression estimates to explain the relationship between one dependent variable and one or more independent variables.
The variable we are predicting is called the criterion variable and is referred to as Y. The variable we are basing our predictions on is called the predictor variable and is referred to as X.

Let’s see SAS Correlation Analysis in detail

SAS linear regression plot looks like the one shown below.

## 3. SAS PROC REG Procedure

The SAS PROC REG procedure is use to find the linear regression model between two variables.

Syntax-

```PROC REG DATA = dataset;
MODEL variable1 = variable2;```

Here variable1 and variable2 are dependent and independent variables respectively.

## 4. SAS Linear Regression Between Two Variables

Below we will use a class dataset from the SAS help library. We now fit a linear regression model, with weight Y (dependent or outcome) variable and height as the X (independent or predictor) variable, using Proc Reg.

Let’s revise SAS Proc Sort Data Sets in detail

Example-

```proc reg data=sashelp.class;
model weight= height ;
run;```

The above code also gives the graphical view of various estimates of the model as shown below.

This was all in SAS Linear Regression Tutorial. Hope you like our explanation.