BookmarkSubscribeRSS Feed
Josie1
Obsidian | Level 7

Help! I have the attached quarterly employment data, I need a method that matches the results from someone else's eviews conversion. I need the middle observation month to equal the quarterly value and the average of all 3 months in the quarter to average to the middle value. I tried changing the months to 2,5,7 and 11 and that didn't work. where am I going wrong?

 

thanks

 

proc expand data=have out=temp1 from=qtr to=month;

id date; convert employmentqrtr / observed=middle; run;

proc expand data=have out=temp2 from=qtr to=month;

id date; convert employmentqrtr / observed=(mi,average); run;

proc expand data=have out=temp4 from=qtr to=month;

id date; convert employmentqrtr / observed=(middle) transformout=(movave 3); run;

proc expand data=have out=temp4 from=qtr to=month;

id date; convert employmentqrtr /TRANSFORMIN=( / 3 ) OBSERVED=average ; run;

1 REPLY 1
ballardw
Super User

Likely to have a better answer if you provide 1) example of your data and 2) example of the data to "match".

 

Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the </> icon or attached as text to show exactly what you have and that we can test code against.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Multiple Linear Regression in SAS

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.

Discussion stats
  • 1 reply
  • 588 views
  • 0 likes
  • 2 in conversation