How to get the equation of density distribution in SAS?

I use the following procedure to get a chart of transaction density:

PROC SGPLOT DATA = Tran_Restaurant ;
  density Transaction_Count/ scale=density ;
  "Restaurant Transaction Count";
  XAXIS LABEL = 'Transaction_Count' GRID VALUES = (0 TO 100 BY 10);
RUN; 

Sample data:

Customer_ID   Transaction_Count
1213x         23
2131x         14

Customer_ID is different from the dataset. So, from the graph for each transaction_ combination, we can get the number of clients.

I wanted to get a density curve equation? Is it possible to do this in SAS?

+4
source share
3 answers

If you know that your data is normal, you can estimate the distribution using PROC UNIVARIATE

proc univariate data=Tran_Restaurant;
    var Transaction_Count;
    histogram Transaction_Count / normal;
run;

Scroll down to the section labeled Fitted Normal Distributionfor mu and theta ratings.

SAS/ETS, , PROC SEVERITY. , PROC HPSEVERITY ( ). proc . , .

, KS, .

ods graphics on;

proc severity data=Tran_Restaurant
              outest=myests
              criteria=KS
              ;
    dist _ALL_;
    loss transaction_count;
run;

. PROC SEVERITY :

  • Burr
  • Gamma
  • Pareto
  • Scaled Tweedie
+2

. 2 , . PROC MEANS.

proc means data=Tran_Restaurant mean std;
var Transaction_Count;
run;

. , .

- . , +/- 0,5.

P(x | V-0.5 <= x <= V+0.5)

SAS CDF:

P = CDF('normal',V+.5,mean,std) - CDF('normal',V-.5,mean,std)

, 100 ,

E_count = P*100;
+1

ODS OUTPUT, ; :

ods output sgplot=datapoints;
proc sgplot ... ;
run;
ods output close;

However, this will not give you an equation. The equation is given in the documentation ; you just need to calculate the parameters in PROC MEANSor somewhere else, I suppose. I do not know how to force SGPLOT to give you them directly.

0
source

Source: https://habr.com/ru/post/1690269/


All Articles