I want a movsum 4 but I don't want that first couple of observations that are computed with 1, 2, 3 observations. I only want observations that are computed with 4 observations. I have several by groups so it is not that easy to just delete them. Is there a way to tell proc expand not to include them or an easy way to delete when you have many by groups. Thanks.
Hi,
You can add the TRIMLEFT 3 operand after the MOVSUM 4 specification in your CONVERT statement to set the first 3 moving sum values within each BY group to missing. For example:
convert x=movsum_x / transform=(movsum 4 trimleft 3);
I hope this helps!
DW
Hi,
You can add the TRIMLEFT 3 operand after the MOVSUM 4 specification in your CONVERT statement to set the first 3 moving sum values within each BY group to missing. For example:
convert x=movsum_x / transform=(movsum 4 trimleft 3);
I hope this helps!
DW
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.