BookmarkSubscribeRSS Feed
Tips Semanales: Programación SAS: medias móviles
CaioFlorencio
SAS Employee

La pregunta más frecuente que recibimos es cómo calcular medias móviles en SAS.
Bueno, hay dos formas de calcular promedios móviles, si tienes licencia para usar SAS/ETS, es decir, el módulo SAS que se usa para econometría y series de tiempo, existe PROC EXPAND.
Detalles de PROC EXPAND:

How to Calculate a Moving Average in SAS - Statology

Overview: PROC EXPAND :: SAS/ETS(R) 14.1 User's Guide


Pero si no tienes licencia SAS/ETS y quieres trabajar usando sólo BASE SAS o codificación SAS, también es posible trabajar y crear tus medias móviles. El último artículo muestra el uso de la función LAG para crear medias móviles. (La función LAG se presentó en el último consejo).
Aquí dejo enlaces a artículos que muestran cómo hacerlos:

Solved: calculate average in data step - SAS Support Communities

Compute a moving average in SAS - The DO Loop

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Article Tags