dear all,
i have the data of in the following format
company_name | year | type | percent_shares |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.07 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.77 |
20 Microns Ltd. | 2010 | Locked-In Shares | 2.5 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.57 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.35 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.95 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.85 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.1 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.5 |
20 Microns Ltd. | 2010 | Locked-In Shares | 10.76 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.37 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.01 |
20 Microns Ltd. | 2010 | Locked-In Shares | 9.26 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.61 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.13 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.14 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.08 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.12 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.03 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.65 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.21 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.03 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.04 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.03 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.95 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.1 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0 |
20 Microns Ltd. | 2010 | Locked-In Shares | 6.81 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.25 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.58 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.18 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.18 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.05 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.36 |
20 Microns Ltd. | 2010 | Locked-In Shares | 1.39 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.07 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.64 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.07 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.33 |
20 Microns Ltd. | 2010 | Locked-In Shares | 0.17 |
20 Microns Ltd. | 2010 | Non-Promoters | 18.67 |
20 Microns Ltd. | 2010 | Non-Promoters | 1.65 |
20 Microns Ltd. | 2010 | Promoters | 0.77 |
20 Microns Ltd. | 2010 | Promoters | 2.5 |
20 Microns Ltd. | 2010 | Promoters | 0.57 |
20 Microns Ltd. | 2010 | Promoters | 0.35 |
20 Microns Ltd. | 2010 | Promoters | 1.95 |
20 Microns Ltd. | 2010 | Promoters | 1.85 |
20 Microns Ltd. | 2010 | Promoters | 10.8 |
20 Microns Ltd. | 2010 | Promoters | 18.94 |
20 Microns Ltd. | 2010 | Promoters | 0.14 |
20 Microns Ltd. | 2010 | Promoters | 0.12 |
20 Microns Ltd. | 2010 | Promoters | 0.08 |
20 Microns Ltd. | 2010 | Promoters | 0.12 |
20 Microns Ltd. | 2010 | Promoters | 0.21 |
20 Microns Ltd. | 2010 | Promoters | 1.95 |
20 Microns Ltd. | 2010 | Promoters | 6.81 |
20 Microns Ltd. | 2010 | Promoters | 0.06 |
20 Microns Ltd. | 2010 | Promoters | 1.19 |
20 Microns Ltd. | 2010 | Promoters | 0.58 |
20 Microns Ltd. | 2010 | Promoters | 1.05 |
20 Microns Ltd. | 2010 | Promoters | 1.39 |
20 Microns Ltd. | 2010 | Promoters | 0.33 |
it represents the company name, year and shareholding percentage. it the panel data of nearly 5000 companies from 2010 to 2019.
i have to find out mean, standard deviation, skewness and kurtosis for each company for every year from 2010 to 2019.
my output should have the following information
company_name | year | type | percent_shares | mean | stand.dev | skewness | kurtosis |
please suggest the appropriate SAS CODE
thanks in advance
how about this.
data have;
length company_name $15 year 8 type $16 percent_shares 8;
input company_name $ 1-15 year type $ 22-37 percent_shares;
datalines;
20 Microns Ltd. 2010 Locked-In Shares 0.07
20 Microns Ltd. 2010 Locked-In Shares 0.77
20 Microns Ltd. 2010 Locked-In Shares 2.5
20 Microns Ltd. 2010 Locked-In Shares 0.57
20 Microns Ltd. 2010 Locked-In Shares 0.35
20 Microns Ltd. 2010 Locked-In Shares 1.95
20 Microns Ltd. 2010 Locked-In Shares 1.85
20 Microns Ltd. 2010 Locked-In Shares 0.1
20 Microns Ltd. 2010 Locked-In Shares 0.5
20 Microns Ltd. 2010 Locked-In Shares 10.76
20 Microns Ltd. 2010 Locked-In Shares 0.37
20 Microns Ltd. 2010 Locked-In Shares 0.01
20 Microns Ltd. 2010 Locked-In Shares 9.26
20 Microns Ltd. 2010 Locked-In Shares 0.61
20 Microns Ltd. 2010 Locked-In Shares 0.13
20 Microns Ltd. 2010 Locked-In Shares 0.14
20 Microns Ltd. 2010 Locked-In Shares 0.08
20 Microns Ltd. 2010 Locked-In Shares 0.12
20 Microns Ltd. 2010 Locked-In Shares 0.03
20 Microns Ltd. 2010 Locked-In Shares 1.65
20 Microns Ltd. 2010 Locked-In Shares 0.21
20 Microns Ltd. 2010 Locked-In Shares 0.03
20 Microns Ltd. 2010 Locked-In Shares 0.04
20 Microns Ltd. 2010 Locked-In Shares 0.03
20 Microns Ltd. 2010 Locked-In Shares 1.95
20 Microns Ltd. 2010 Locked-In Shares 0.1
20 Microns Ltd. 2010 Locked-In Shares 0
20 Microns Ltd. 2010 Locked-In Shares 6.81
20 Microns Ltd. 2010 Locked-In Shares 1.25
20 Microns Ltd. 2010 Locked-In Shares 0.58
20 Microns Ltd. 2010 Locked-In Shares 0.18
20 Microns Ltd. 2010 Locked-In Shares 0.18
20 Microns Ltd. 2010 Locked-In Shares 1.05
20 Microns Ltd. 2010 Locked-In Shares 0.36
20 Microns Ltd. 2010 Locked-In Shares 1.39
20 Microns Ltd. 2010 Locked-In Shares 0.07
20 Microns Ltd. 2010 Locked-In Shares 0.64
20 Microns Ltd. 2010 Locked-In Shares 0.07
20 Microns Ltd. 2010 Locked-In Shares 0.33
20 Microns Ltd. 2010 Locked-In Shares 0.17
20 Microns Ltd. 2010 Non-Promoters 18.67
20 Microns Ltd. 2010 Non-Promoters 1.65
20 Microns Ltd. 2010 Promoters 0.77
20 Microns Ltd. 2010 Promoters 2.5
20 Microns Ltd. 2010 Promoters 0.57
20 Microns Ltd. 2010 Promoters 0.35
20 Microns Ltd. 2010 Promoters 1.95
20 Microns Ltd. 2010 Promoters 1.85
20 Microns Ltd. 2010 Promoters 10.8
20 Microns Ltd. 2010 Promoters 18.94
20 Microns Ltd. 2010 Promoters 0.14
20 Microns Ltd. 2010 Promoters 0.12
20 Microns Ltd. 2010 Promoters 0.08
20 Microns Ltd. 2010 Promoters 0.12
20 Microns Ltd. 2010 Promoters 0.21
20 Microns Ltd. 2010 Promoters 1.95
20 Microns Ltd. 2010 Promoters 6.81
20 Microns Ltd. 2010 Promoters 0.06
20 Microns Ltd. 2010 Promoters 1.19
20 Microns Ltd. 2010 Promoters 0.58
20 Microns Ltd. 2010 Promoters 1.05
20 Microns Ltd. 2010 Promoters 1.39
20 Microns Ltd. 2010 Promoters 0.33
;
run;
proc univariate data=have noprint;
by company_name year type;
output out=want MEAN =mean
STDDEV =stddev
SKEWNESS =skewness
KURTOSIS =kurtosis;
run;
how about this.
data have;
length company_name $15 year 8 type $16 percent_shares 8;
input company_name $ 1-15 year type $ 22-37 percent_shares;
datalines;
20 Microns Ltd. 2010 Locked-In Shares 0.07
20 Microns Ltd. 2010 Locked-In Shares 0.77
20 Microns Ltd. 2010 Locked-In Shares 2.5
20 Microns Ltd. 2010 Locked-In Shares 0.57
20 Microns Ltd. 2010 Locked-In Shares 0.35
20 Microns Ltd. 2010 Locked-In Shares 1.95
20 Microns Ltd. 2010 Locked-In Shares 1.85
20 Microns Ltd. 2010 Locked-In Shares 0.1
20 Microns Ltd. 2010 Locked-In Shares 0.5
20 Microns Ltd. 2010 Locked-In Shares 10.76
20 Microns Ltd. 2010 Locked-In Shares 0.37
20 Microns Ltd. 2010 Locked-In Shares 0.01
20 Microns Ltd. 2010 Locked-In Shares 9.26
20 Microns Ltd. 2010 Locked-In Shares 0.61
20 Microns Ltd. 2010 Locked-In Shares 0.13
20 Microns Ltd. 2010 Locked-In Shares 0.14
20 Microns Ltd. 2010 Locked-In Shares 0.08
20 Microns Ltd. 2010 Locked-In Shares 0.12
20 Microns Ltd. 2010 Locked-In Shares 0.03
20 Microns Ltd. 2010 Locked-In Shares 1.65
20 Microns Ltd. 2010 Locked-In Shares 0.21
20 Microns Ltd. 2010 Locked-In Shares 0.03
20 Microns Ltd. 2010 Locked-In Shares 0.04
20 Microns Ltd. 2010 Locked-In Shares 0.03
20 Microns Ltd. 2010 Locked-In Shares 1.95
20 Microns Ltd. 2010 Locked-In Shares 0.1
20 Microns Ltd. 2010 Locked-In Shares 0
20 Microns Ltd. 2010 Locked-In Shares 6.81
20 Microns Ltd. 2010 Locked-In Shares 1.25
20 Microns Ltd. 2010 Locked-In Shares 0.58
20 Microns Ltd. 2010 Locked-In Shares 0.18
20 Microns Ltd. 2010 Locked-In Shares 0.18
20 Microns Ltd. 2010 Locked-In Shares 1.05
20 Microns Ltd. 2010 Locked-In Shares 0.36
20 Microns Ltd. 2010 Locked-In Shares 1.39
20 Microns Ltd. 2010 Locked-In Shares 0.07
20 Microns Ltd. 2010 Locked-In Shares 0.64
20 Microns Ltd. 2010 Locked-In Shares 0.07
20 Microns Ltd. 2010 Locked-In Shares 0.33
20 Microns Ltd. 2010 Locked-In Shares 0.17
20 Microns Ltd. 2010 Non-Promoters 18.67
20 Microns Ltd. 2010 Non-Promoters 1.65
20 Microns Ltd. 2010 Promoters 0.77
20 Microns Ltd. 2010 Promoters 2.5
20 Microns Ltd. 2010 Promoters 0.57
20 Microns Ltd. 2010 Promoters 0.35
20 Microns Ltd. 2010 Promoters 1.95
20 Microns Ltd. 2010 Promoters 1.85
20 Microns Ltd. 2010 Promoters 10.8
20 Microns Ltd. 2010 Promoters 18.94
20 Microns Ltd. 2010 Promoters 0.14
20 Microns Ltd. 2010 Promoters 0.12
20 Microns Ltd. 2010 Promoters 0.08
20 Microns Ltd. 2010 Promoters 0.12
20 Microns Ltd. 2010 Promoters 0.21
20 Microns Ltd. 2010 Promoters 1.95
20 Microns Ltd. 2010 Promoters 6.81
20 Microns Ltd. 2010 Promoters 0.06
20 Microns Ltd. 2010 Promoters 1.19
20 Microns Ltd. 2010 Promoters 0.58
20 Microns Ltd. 2010 Promoters 1.05
20 Microns Ltd. 2010 Promoters 1.39
20 Microns Ltd. 2010 Promoters 0.33
;
run;
proc univariate data=have noprint;
by company_name year type;
output out=want MEAN =mean
STDDEV =stddev
SKEWNESS =skewness
KURTOSIS =kurtosis;
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.