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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.