Table of Contents
PROC REG is a SAS procedure that is used to perform regression analysis. It allows for the exploration and modeling of relationships between variables in a dataset. This procedure can be used to predict the values of a dependent variable based on the values of one or more independent variables. It also allows for the identification of influential outliers and the assessment of the overall fit of the regression model. An example of using PROC REG in SAS would be to analyze the relationship between a person’s income and their level of education. By using this procedure, one could determine if there is a significant correlation between these variables and use the results to make predictions or inform decision-making.
Use PROC REG in SAS (With Example)
You can use PROC REG in SAS to fit linear regression models.
You can use the following basic syntax to fit a :
proc regdata = my_data;
model y = x;
run;This will fit the following linear regression model:
y = b0 + b1x
You can use the following basic syntax to fit a :
proc regdata = my_data;
model y = x1 x2 x3;
run;This will fit the following linear regression model:
y = b0 + b1x1 + b2x2 + b3x3
The following example shows how to use PROC REG to fit a simple linear regression model in SAS along with how to interpret the output.
Example: How to Use PROC REG in SAS
Suppose we have the following dataset that contains information on hours studied and final exam score for 15 students in some class:
/*create dataset*/ data exam_data; input hours score; datalines; 1 64 2 66 4 76 5 73 5 74 6 81 6 83 7 82 8 80 10 88 11 84 11 82 12 91 12 93 14 89 ; run; /*view dataset*/ proc printdata=exam_data;

We can use PROC REG to fit a simple linear regression model to this dataset, using hours as the predictor variable and score as the :
/*fit simple linear regression model*/ proc regdata = exam_data; model score = hours; run;
The first table in the output shows a summary of the model fit:

The Parameter Estimates table contains the coefficient estimates for the model.
From this table we can see the fitted regression equation:
Score = 65.33 + 1.98*(hours)
The PROC REG procedure also produces residual plots that we can use to check if the are met:

Lastly, the PROC REG procedure produces a scatterplot of the raw data with the fitted regression line overlaid on top:

This plot allows us to visually see how well the regression line fits the data.
Note: You can find the complete documentation for PROC REG .
The following tutorials explain how to perform other common tasks in SAS:
Cite this article
stats writer (2024). How can PROC REG be used in SAS, and can you provide an example?. PSYCHOLOGICAL SCALES. Retrieved from https://scales.arabpsychology.com/stats/how-can-proc-reg-be-used-in-sas-and-can-you-provide-an-example/
stats writer. "How can PROC REG be used in SAS, and can you provide an example?." PSYCHOLOGICAL SCALES, 23 Jun. 2024, https://scales.arabpsychology.com/stats/how-can-proc-reg-be-used-in-sas-and-can-you-provide-an-example/.
stats writer. "How can PROC REG be used in SAS, and can you provide an example?." PSYCHOLOGICAL SCALES, 2024. https://scales.arabpsychology.com/stats/how-can-proc-reg-be-used-in-sas-and-can-you-provide-an-example/.
stats writer (2024) 'How can PROC REG be used in SAS, and can you provide an example?', PSYCHOLOGICAL SCALES. Available at: https://scales.arabpsychology.com/stats/how-can-proc-reg-be-used-in-sas-and-can-you-provide-an-example/.
[1] stats writer, "How can PROC REG be used in SAS, and can you provide an example?," PSYCHOLOGICAL SCALES, vol. X, no. Y, ص Z-Z, June, 2024.
stats writer. How can PROC REG be used in SAS, and can you provide an example?. PSYCHOLOGICAL SCALES. 2024;vol(issue):pages.
