BookmarkSubscribeRSS Feed
Josephine
Calcite | Level 5

Dear SAS Statistical Procedures Community,

I am Josephine Sabbagh, and I have alreay read the "SAS/STAT® 9.2 User’s Guide The LOESS Procedure (Book Excerpt)" in order to apply the Loess procedure to get a fitted curve for a specific model that I am working on.

 

The guide is very clear and easy to understand, but I still have to ask only one question about how to display the elements of the smoothing matrix denoted by "L" and described in page 3218.

 

Please note that displaying the trace of L works very easily, but I only need your help to know more about "L".

 

So if you may please tell me if "L" can be also called "Hat Matrix" or "Projection Matrix" and how to display its elements.

 

Your help will be much appreciated.

Thank you in advance!

4 REPLIES 4
Rick_SAS
SAS Super FREQ

You ask an interesting question, but I don't think you can output the L matrix from PROC LOESS. The L matrix is primarily a theoretical construct. It isn't explicitly formed by most PROC LOESS calls.

 

LOESS (which you can think of as LOcal EStimation) uses weighted nearest neighbor computations to obtain the predicted values. At a point (x_i, y_0 you can obtain yHat_i as a weighted sum of the k observations whose X value is closest to x_i.  When the x_i values are evenly spaced and the local polynomial is a constant (DEGREE=0), you might be able to write down the L matrix by hand.

 

What do you want to do with the L matrix? Perhaps there are other ways to accomplish your goals.

Josephine
Calcite | Level 5

I need to understand well how to display the elements of this matrix because it is very important for the computation of AICC, degree of freedom etc... So when I have to present my statistical study done by SAS using Proc Loess procedure, I might present it very detailed. That's why I need to output "L".

Kindly note that the my Data is attached. Can you explain to me "L" using my example?

 

Rick_SAS
SAS Super FREQ

I won't argue with you about whether you need to output L or not.  However, I do not know a way to get it automatically from PROC LOESS.  I suggest you talk to your supervisor or academic advisor to clarify whether he or she expects that kind of detail.

 

Yes, certain elements of the matrix L are used to compute statistics such as AICC and DOF. However, as shown in various papers by Cleveland (references in the doc), you do not need all of L, just the trace of certain matrices that depend on L.  For efficiency, PROC LOESS does not usually form L directly for these computations, but uses approximations.

 

Since you and I have different opinions about the importance of L, I'll let others comment and help. Good luck on your problem.

Josephine
Calcite | Level 5
@rick_SAS Thank you so much Mr Rick for your advice.Maybe I wasn't very clear by sending you my help request.I don't know wether you can help me find my solution by telling me maybe the formula that is used by SAS to find the elements of the diagonal of the smoothing matrix. This will at least help me know how does it work to find the trace, not even to calculate the elements.
Thank you in advance.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2022 views
  • 0 likes
  • 2 in conversation