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.
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
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
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
Calling @Rick_SAS
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.
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.