BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.

dear all,

i have the data of in the following format

company_nameyeartype percent_shares
20 Microns Ltd.2010Locked-In Shares0.07
20 Microns Ltd.2010Locked-In Shares0.77
20 Microns Ltd.2010Locked-In Shares2.5
20 Microns Ltd.2010Locked-In Shares0.57
20 Microns Ltd.2010Locked-In Shares0.35
20 Microns Ltd.2010Locked-In Shares1.95
20 Microns Ltd.2010Locked-In Shares1.85
20 Microns Ltd.2010Locked-In Shares0.1
20 Microns Ltd.2010Locked-In Shares0.5
20 Microns Ltd.2010Locked-In Shares10.76
20 Microns Ltd.2010Locked-In Shares0.37
20 Microns Ltd.2010Locked-In Shares0.01
20 Microns Ltd.2010Locked-In Shares9.26
20 Microns Ltd.2010Locked-In Shares0.61
20 Microns Ltd.2010Locked-In Shares0.13
20 Microns Ltd.2010Locked-In Shares0.14
20 Microns Ltd.2010Locked-In Shares0.08
20 Microns Ltd.2010Locked-In Shares0.12
20 Microns Ltd.2010Locked-In Shares0.03
20 Microns Ltd.2010Locked-In Shares1.65
20 Microns Ltd.2010Locked-In Shares0.21
20 Microns Ltd.2010Locked-In Shares0.03
20 Microns Ltd.2010Locked-In Shares0.04
20 Microns Ltd.2010Locked-In Shares0.03
20 Microns Ltd.2010Locked-In Shares1.95
20 Microns Ltd.2010Locked-In Shares0.1
20 Microns Ltd.2010Locked-In Shares0
20 Microns Ltd.2010Locked-In Shares6.81
20 Microns Ltd.2010Locked-In Shares1.25
20 Microns Ltd.2010Locked-In Shares0.58
20 Microns Ltd.2010Locked-In Shares0.18
20 Microns Ltd.2010Locked-In Shares0.18
20 Microns Ltd.2010Locked-In Shares1.05
20 Microns Ltd.2010Locked-In Shares0.36
20 Microns Ltd.2010Locked-In Shares1.39
20 Microns Ltd.2010Locked-In Shares0.07
20 Microns Ltd.2010Locked-In Shares0.64
20 Microns Ltd.2010Locked-In Shares0.07
20 Microns Ltd.2010Locked-In Shares0.33
20 Microns Ltd.2010Locked-In Shares0.17
20 Microns Ltd.2010Non-Promoters18.67
20 Microns Ltd.2010Non-Promoters1.65
20 Microns Ltd.2010Promoters0.77
20 Microns Ltd.2010Promoters2.5
20 Microns Ltd.2010Promoters0.57
20 Microns Ltd.2010Promoters0.35
20 Microns Ltd.2010Promoters1.95
20 Microns Ltd.2010Promoters1.85
20 Microns Ltd.2010Promoters10.8
20 Microns Ltd.2010Promoters18.94
20 Microns Ltd.2010Promoters0.14
20 Microns Ltd.2010Promoters0.12
20 Microns Ltd.2010Promoters0.08
20 Microns Ltd.2010Promoters0.12
20 Microns Ltd.2010Promoters0.21
20 Microns Ltd.2010Promoters1.95
20 Microns Ltd.2010Promoters6.81
20 Microns Ltd.2010Promoters0.06
20 Microns Ltd.2010Promoters1.19
20 Microns Ltd.2010Promoters0.58
20 Microns Ltd.2010Promoters1.05
20 Microns Ltd.2010Promoters1.39
20 Microns Ltd.2010Promoters0.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_nameyeartype percent_sharesmean stand.devskewnesskurtosis
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        
        

please suggest the appropriate SAS CODE

 

thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
japelin
Rhodochrosite | Level 12

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;

View solution in original post

2 REPLIES 2
japelin
Rhodochrosite | Level 12

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;
srikanthyadav44
Quartz | Level 8
thanks a lot.
the code is working

SAS Innovate 2025: Register Now

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!

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
  • 2 replies
  • 643 views
  • 1 like
  • 2 in conversation