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.
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;
Thanks once again Ksharp. It worked perfectly. Cant thank you enough for this great asisstance.
rgds
ejaa
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!
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.
Ready to level-up your skills? Choose your own adventure.