Help using Base SAS procedures

Proc EXPAND: MOVAVE and TRIM when variable starts in the mid of the period

Reply
Contributor
Posts: 65

Proc EXPAND: MOVAVE and TRIM when variable starts in the mid of the period

Hey guys,

I really appreciate the help you guys have given in the other posts. A quick question. Doing moving averages with Proc EXPAND and just realized that apparently it doesn't count MOVAVE n ( n window length) from the beginning of the nonmissing values of the series but from overall start of the period. So when the variables start unequally or at different times proc expand using "id time" will count the start as the global start and then TRIM will lose meaning because it will trim the first already missing values cause the variables hasn't even started yet. Consequently, MOVAVE with N say equal to 10 and TRIM to 9 but the first 9 values for the variable are missing, for the 10 observations will produce MOVAVE equal to that observation instead of waiting 10 more observations and produce MOVAVE counting from the first nonmissing observation. So your answer to that would be use NOMISS but....

I thought about using NOMISS, but the window is 240 days across several years with some days missing in between, if i use NOMISS it will produce missing values for MOVAVE results just based on that day missing from the series.


Any way to avoid this?

Thanks a lot!!

Arsenio
Ask a Question
Discussion stats
  • 0 replies
  • 252 views
  • 0 likes
  • 1 in conversation