BookmarkSubscribeRSS Feed
Monica_1134
Calcite | Level 5

hi,

 

I import a excel file in SAS.

The data I need to analyze is called "WD"

I can succeed to perform Weibull distribution for WD.

But I can't find Kolmogorov-Smirnov value on result page.

 

When I work with Normal and Gumbel Distribution, there is a KS value automatic show on result page.

But if I work with Weibull distribution, there isn't any KS result.

Does anyone know how can I perform this problem?

 

My programming is:

proc univariate data=a;
histogram WD / weibull;
run;


I also tried this:

proc univariate data=a;
histogram WD / weibull (mu=est sigma=est);
run;

 

Both of above programming cannot result KS value.

6 REPLIES 6
sbxkoenk
SAS Super FREQ

Hello,

 

The Kolmogorov-Smirnov (KS) goodness-of-fit for the Weibull distribution is NOT given by PROC UNIVARIATE.
Only Cramer-von Mises and Anderson-Darling.

The same is true for SAS/QC PROC CAPABILITY (which can also be used to fit Weibull distribution to observed data).

 

Maybe you can try SAS/ETS PROC SEVERITY (??).

 

Why do you absolutely want KS-test?

 

Thanks,

Koen

sbxkoenk
SAS Super FREQ

Use the inset statement, like :

  inset weibull(shape scale theta ksd ksdpval ad adpval cvm cvmpval)/pos=ne
      header="ABC XYZ";
KSD   Kolmogorov-Smirnov EDF test statistic
KSDPVAL   Kolmogorov-Smirnov EDF test p-value

 

See :
SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation | SAS 9.4 / Viya 3.5
Base SAS Procedures Guide: Statistical Procedures
The UNIVARIATE Procedure
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/procstat/procstat_univariate_syntax15.htm

 

Koen

Monica_1134
Calcite | Level 5
hi,

Thank you for your answer!
Actually, I didn't very understand about these statistic distribution methods.
So I don't know it can't apply on it.
The reason why I want to use KS is that I want to compare different distribution plots.

However, how about Chi-square Test?
I tried the same data with following programming:
proc freq data=a;
tables WD / chisq;
run;

The result of this programming is zero. And it also can't apply on assigned distribution method.

I also tried these:
proc capability data=a;
var WD;
histogram / weibull;
run;

proc capabiblity data=a;
var WD;
histogram / gumbel;
run;

There was a result of Chi-square, but the value of it was unreasonable.
The better distribution plot with a larger Chi-square, the worse distribution plot with a smaller Chi-square
.
sbxkoenk
SAS Super FREQ

Hello,

 

I would not use Chi-Square Goodness of Fit Test for Weibull , 

as the outcome depends on how the continuous values were binned (the midpoints of the histogram bars).

I always use Anderson–Darling test as it is always available !

 

Cheers,

Koen

Rick_SAS
SAS Super FREQ

As with all statistical tests, you need to know the null distribution of the test statistic in order to provide p-values. The UNIVARIATE documentation states that the procedure uses results from D’Agostino and Stephens (1986) to estimate the p-values for various combinations of known/unknown parameters. See the table "Availability of EDF Tests" in the doc.

You should use the THETA=, C=, and SIGMA= options to specify the threshold parameter (theta), the shape parameter (c), and the scale parameter (sigma). By default, THETA=0, which means that the default behavior is [theta known, C unknown, Sigma unknown], which is probably why you aren't getting a KS statistic.  Try using THETA=EST to get an MLE estimate.

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 753 views
  • 1 like
  • 4 in conversation