SAS Programming Tutorial: RESDAT221


RESDAT is a SAS dataset option that allows you to specify the name of the residual dataset to be created when using the PROC REG procedure. The residual dataset contains the residuals, which are the differences between the observed values of the dependent variable and the predicted values generated by the regression model.

To specify the name of the residual dataset, use the following syntax:PROC REG data=dataset_name options;
model dependent_variable = independent_variables;
output out=residual_dataset_name residuals=residual_variable_name;
run;

For example, the following code creates a residual dataset named residuals:PROC REG data=sales;
model sales = price advertising;
output out=residuals residuals=residual;
run;

The RESDAT option can be used to create a residual dataset for any type of regression model, including linear regression, logistic regression, and Poisson regression. The residual dataset can be used for a variety of purposes, such as:
Checking the model's assumptions. The residual dataset can be used to check the assumptions of the regression model, such as the normality of the residuals and the linearity of the relationship between the dependent variable and the independent variables.
Identifying outliers. The residual dataset can be used to identify outliers, which are observations that have unusually large residuals. Outliers can be caused by a variety of factors, such as data entry errors or unusual events.
Predicting future values. The residual dataset can be used to predict future values of the dependent variable. By adding the residuals to the predicted values, you can obtain an estimate of the actual values of the dependent variable.

The RESDAT option is a powerful tool that can be used to improve the accuracy and reliability of your regression models. By creating a residual dataset, you can check the model's assumptions, identify outliers, and predict future values.

Additional Information

The RESDAT option can be used with the following PROC REG statements:
MODEL
OUTPUT
PLOT
SCORE

The RESDAT option can also be used with the following PROC REG options:
DATA=
OUT=
RESIDUALS=

For more information about the RESDAT option, see the SAS documentation.

2024-12-31


Previous:AI Tutorial and CS5 Tutorial

Next:Data Rights: A Video Tutorial