SAS/STAT Nonparametric Regression Procedure – PROC GAM

FREE Online Courses: Click for Success, Learn for Free - Start Now!

In our journey of SAS/STAT Tutorials, we learned many types of analysis procedures, today we are going to discuss a SAS/STAT Nonparametric Regression. In this tutorial, we are going to explore the procedures of SAS/STAT Nonparametric Regression: PROC ADAPTIVEREG, PROC GAM, PROC GAMPL, PROC LOESS, and PROC TPSPLINE with examples & syntax.

So, let’s begin with SAS/STAT Nonparametric Regression.

What is SAS/STAT NonParametric Regression?

SAS/STAT Nonparametric Regression falls under a category of regression analysis where the variable that is to be predicted (predictor) does not take a form that is predetermined but, is constructed from information that is derived from the original data.

In SAS/STAT nonparametric regression, you do not specify the functional form of your choice. You specify the dependent variable, the outcome, and the covariates. Nonparametric Regression in SAS/STAT is basically used for prediction, but it is also reliable even if hypotheses of linear regression are not verified.

Procedures for Non-Parametric Regression in SAS/STAT

Following procedures are used to perform a SAS/STAT Nonparametric Regression of a sample data. Each procedure has a different syntax and is used with different type of data in different contexts. Let us explore each one of these.

a. PROC ADAPTIVEREG

The ADAPTIVEREG procedure is useful for building regression models when you have many variables to choose from and the response is either continuous or categorical. It specifically builds nonparametric regression models. It is useful in situations when we want an accurate prediction and the relationship between the predictors and response is unknown.
A Syntax of PROC ADAPTIVEREG-

PROC ADAPTIVEREG DATASET;
 Class variable;
 MODEL VARIABLE <options> ;

 
PROC ADAPTIVEREG Example-

proc adaptivereg data=sashelp.class;
class name;
model age= height weight / dist=normal;
run;

 

SAS/STAT Nonparametric Regression - PROC ADAPTIVEREG

SAS/STAT Nonparametric Regression – PROC ADAPTIVEREG

SAS PROC ADAPTIVEREG

SAS PROC ADAPTIVEREG

b. PROC GAM

GAM stands for generalized additive models. It builds models that come under the nonparametric class of regression. In this procedure, there is no assumption of linearity and it is used when the dependent variable is not distributed normally.

A Syntax of PROC GAM- 

PROC  GAM dataset <options>;
 Class < variable> ;
MODEL <dependent variable>;

PROC GAM Example-

proc gam data=sashelp.class;
model age =spline(height)
spline(weight) / dist=normal;
run;

The keyword spline suggests that there could be nonlinearity in the model and the PROC GAM and MODEL statements are required.      

SAS/STAT Nonparametric Regression - PROC GAM

SAS/STAT Nonparametric Regression – PROC GAM

SAS/STAT Nonparametric Regression - PROC GAM

SAS/STAT Nonparametric Regression – PROC GAM

c. PROC GAMPL

The GAMPL provides a model fitting for generalized additive models, which are highly versatile statistical models that find different applications in different industries. These models are basically used for unknown data which is complex and which exhibits non-linear relationships between the response and the predictors.

They can be used for almost all distributions. In SAS/STAT, it can be run in two ways- single machine mode and distributed mode.

A Syntax of PROC GAMPL-

PROC  GAMPL dataset <options>;
 Class < variable> ;
 Model  response <(response-options)> = <PARAM(effects)> <spline-effects> </ model-options>;

PROC GAMPL and MODEL statements are required.
PROC GAMPL Example-

ods graphics on;
proc gampl data=sashelp.class plots=all;
model age = param(height weight) spline(height)
spline(weight) / dist=poisson;
run;
SAS/STAT Nonparametric Modeling

SAS Nonparametric Regression – PROC GAMPL

SAS/STAT Nonparametric Modeling

SAS Nonparametric Regression – PROC GAMPL

SAS Nonparametric Regression - PROC GAMPL

SAS Nonparametric Regression – PROC GAMPL

d. PROC LOESS

The PROC LOESS in SAS/STAT performs nonparametric regression. It makes no assumption of parametric form of regression. This procedure is useful when you don’t know the parametric form of data and when there are too many outliers in the data.
A Syntax of PROC LOESS-

PROC  LOESS dataset <options>; 
 MODEL <options>;

PROC LOESS Example-

ods graphics on;
proc loess data=sashelp.class plots=all;
model age=height;         
run;
SAS PROC LOESS

SAS PROC LOESS

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

SAS/STAT Nonparametric Modeling

SAS PROC LOESS

 

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

Nonparametric Regression in SAS/STAT - PROC LOESS

Nonparametric Regression in SAS/STAT – PROC LOESS

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

 

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

SAS/STAT Nonparametric Modeling

Nonparametric Regression in SAS/STAT – PROC LOESS

e. PROC TPSPLINE

The TPSPLINE procedure is used to fit a nonparametric regression model by using the penalized least squares method. It provides options for handling large data sets, supports multiple dependent variables and enables you to choose a particular model by specifying the model degrees of freedom or smoothing parameter.

It fits the data with a flexible model in which the number of effective parameters can be as large as the number of unique design points.
A Syntax of PROC TPSPLINE-

PROC  TPSPLINE dataset <options>; 
MODEL dependents = <variables> (variables)</ options>;

The PROC TPSPLINE and MODEL statements are required statements.

PROC TPSPLINE Example-

ods graphics on;
proc tpspline data=sashelp.class plots=all;
model age=(height weight)  ;         
run;
SAS/STAT Nonparametric Modeling

SAS PROC TPSPLINE

SAS/STAT Nonparametric Regression - PROC TPSPLINE

SAS/STAT Nonparametric Regression – PROC TPSPLINE

AS Nonparametric Regression - PROC TPSPLINE

AS Nonparametric Regression – PROC TPSPLINE

 

Nonparametric Regression in SAS/STAT- PROC TPSPLINE

Nonparametric Regression in SAS/STAT- PROC TPSPLINE

SAS/STAT Nonparametric Modeling

SAS/STAT Nonparametric Regression – PROC TPSPLINE

SAS/STAT Nonparametric Modeling

SAS Nonparametric Regression – PROC TPSPLINE

Nonparametric Regression in SAS/STAT - PROC TPSPLINE

Nonparametric Regression in SAS/STAT – PROC TPSPLINE

 

SAS/STAT Nonparametric Regression - PROC TPSPLINE

SAS/STAT Nonparametric Regression – PROC TPSPLINE

SAS/STAT Nonparametric Modeling

SAS Nonparametric Regression – PROC TPSPLINE

SAS/STAT Nonparametric Modeling

SAS Nonparametric Regression – PROC TPSPLINE

This was all about SAS/STAT Nonparametric Regression Tutorial. Hope you like our explanation.

Conclusion

So, this was a complete description and a comprehensive understanding of all the procedures offered by SAS/STAT nonparametric regression. We looked: PROC ADAPTIVEREG, PROC GAM, PROC GAMPL, PROC LOESS, and PROC TPSPLINE with their example & syntax, and how they can be used. Hope you all enjoyed it.

Stay tuned for more interesting topics in SAS/STAT and, for queries, post your doubts in the comments section below.

We work very hard to provide you quality material
Could you take 15 seconds and share your happy experience on Google

follow dataflair on YouTube

Leave a Reply

Your email address will not be published. Required fields are marked *