BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
EJAA
Obsidian | Level 7

Thanks very much Ksharp. The covariance is solved. Really appreciate.

 

Please I have another question which i tried anwering. Now I want to find the average price (prc) for each fiscal year just like the covariance and tried this code but gives me error. Please what am I doing wrong in my codes.Any other suggestions for me. Thanks in advance Ksharp.  

 

proc expand data=lid.sas out=lid.ave from=day to=year;
convert prc / observed=average;
id fyear;
by gvkey conm;
run;

 

Rgds

ejaa.

Ksharp
Super User
proc import datafile='c:\temp\sass.csv' out=have dbms=csv replace;
run;


data have1;
 set have;
 year=year(intnx('year.7',DATADATE,0,'b'));
run;
proc sort data=have1;
 by  gvkey year;
run;

proc summary data=have1;
 by gvkey year;
 var prc;
 output out=want mean=mean_prc ;
run;
EJAA
Obsidian | Level 7

Thanks once again Ksharp. It worked perfectly. Cant thank you enough for this great asisstance. 

rgds

ejaa

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 17 replies
  • 4150 views
  • 2 likes
  • 3 in conversation