Hello
I have a data set with 35000 rows.
In this data set there are following columns:
"Customer ID"
"predicted" with value between 0 and 1 (probability of failure)
"Failure" with value 1 or 0 (1 if customer fail in 12 months follow up and 0 if not)
I want to create a new data set with calculation of percentiles 1 until 100 ( 1,2,3,4,5,6,7,8,.......and so on till 100)
The problem:
In the new column "Percentile_" there is jumping in the values and I get only the following percentiles
0
1
2
3
4
5
6
7
8
9
11
13
14
15
16
27
38
40
42
43
44
45
46
48
51
52
53
54
55
57
59
60
66
73
74
75
76
78
80
84
88
89
90
91
93
94
95
97
98
99
proc rank data=Have groups=100 descending out=b;
var predicted;
ranks Percentile_;
run;
proc summary data=b nway;
var Failure ;
class Percentile_;
output out=d(drop=_type_ rename=(_freq_=n_Percentile))
sum=Bad_Percentile ;
run;
I assume you've got these "jumps" because of ties. There are different options for Proc Rank how to treat ties.
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n0y7jshlj1odi6n1atnqzerl3uw5.htm
Sorry,I didnt see solution to my problem in this link
I want to create a new data set with calculation of percentiles 1 until 100 ( 1,2,3,4,5,6,7,8,.......and so on till 100)
Percentiles of what?
Do you understand that percentiles of 0/1 variables is a meaningless thing to compute?
Thanks,
Percentiles of column "predicted" (Column predicted get values between 0 and 1 and it is the probability of failure by model)
Percentile of PD (probability of default)
TIES=DENSE is not working well.
It classified to groups in wrong way.
May you please show the code of using PROC UNIVARIATE + PCTLPTS + PCTLPRE?
@Ronein wrote:
TIES=DENSE is not working well.
Show us what is wrong. Don't say something is wrong and provide no explanation.
It classified to groups in wrong way.
I think it classified the group in the correct way (it did what it was supposed to do), but that may not be what you want. And you need to explain what you want.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.