BookmarkSubscribeRSS Feed
mei
Calcite | Level 5 mei
Calcite | Level 5

Dear Sir,

I wish to split my sample to 3 groups based on total assets (variable:at), ie to small firm, medium firm and big firm. this means i need to calculate the 1/3 quantile, 2/3 quantile for the variable.

How do i write that in the program?

also: if i wish to split to 4 parts, i suppose Q1, median, Q3 that is generated from the normal univariate procedure would be fine right?

Thanks a lot!!

3 REPLIES 3
MikeZdeb
Rhodochrosite | Level 12

hi ... quantiles and the median are based on counts, not magnitude of numbers so that approach will not categorize small/ medium/large

for example, if I looked at this data, I might say that 1 is small, 100 is medium, 1000 is large ... but the quantiles and median don't say that

data test;

input assets @@;

datalines;

1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 10 10 1000

;

proc univariate data=test;

ods select quantiles;

run;


Variable:  assets

Quantiles (Definition 5)

Quantile      Estimate

100% Max          1000

99%               1000

95%                100

90%                100

75% Q3               1

50% Median           1

25% Q1               1

10%                  1

5%                   1

1%                   1

0% Min               1

mei
Calcite | Level 5 mei
Calcite | Level 5

it is okay, i just want the count as my data size is very big, up to 20,000 observations. i just need to split them to 3 groups.

can you guide me in writing the codes to 3 parts?

MikeZdeb
Rhodochrosite | Level 12

hi ... specify the number of groups in GROUPS= ... the lowest group is always 0

with three groups, the value of ASSET_GROUP  will be 0, 1, 2

proc rank data=test out=test_group groups=3 ties=low;

var assets;

ranks asset_group;

run;


(you can look at online help for an explanation of TIES=)

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 3 replies
  • 1476 views
  • 0 likes
  • 2 in conversation