Hi,
I've looked all over SAS website and the community forum for help on output std for weibull distribution, but I can't find any documentation.
I was able to output normal standard deviation like so
proc univeriate data=mydata noprint;
var myvar;
output out=myout std=std;
But how do I output the std from the following code? I don't know what to put in place of "???" in order to get the std dev of weibull;
proc univariate data=mydata noprint;
var myvar;
histogram / weibull;
output out=myout ???=weibull_std;
Would it help if I provide the data? Also, is there another procedure that has the ability to output the weibull std into a dataset?
many thanks!
Add in the ODS Table statement like below and that will capture the estimates into a dataset called pestimates for you.
title 'Distribution of Plate Gaps';
ods select ParameterEstimates GoodnessOfFit FitQuantiles MyHist;
ods table parameterestimates=pestimates;
proc univariate data=Plates;
var Gap;
histogram / midpoints=0.2 to 1.8 by 0.2
lognormal
weibull
gamma
vaxis = axis1
name = 'MyHist';
inset n mean(5.3) std='Std Dev'(5.3) skewness(5.3)
/ pos = ne header = 'Summary Statistics';
axis1 label=(a=90 r=0);
run;
What are you defining as the Weibull std?
The Weibull distribution has 3 parameters, shape, location and scale and the standard deviation is a function of the shape parameter.
Hi there,
Thank you for the quick response.
I wanted to capture the STD for the weibull fit which I found the example at the link pasted below.
Base SAS(R) 9.2 Procedures Guide: Statistical Procedures, Third Edition
I believe the example defined shape to be 1.961159 and I want to output the "Std Dev 0.339248" on that print out to a dataset. The value can be found in "Output 4.22.3 Summary of Fitted Weibull Distribution". Is it possible to output the value 0.339248 to a dataset? Or is there another proc that I should look at to output the std value?
I truly appreciate your response.
Add in the ODS Table statement like below and that will capture the estimates into a dataset called pestimates for you.
title 'Distribution of Plate Gaps';
ods select ParameterEstimates GoodnessOfFit FitQuantiles MyHist;
ods table parameterestimates=pestimates;
proc univariate data=Plates;
var Gap;
histogram / midpoints=0.2 to 1.8 by 0.2
lognormal
weibull
gamma
vaxis = axis1
name = 'MyHist';
inset n mean(5.3) std='Std Dev'(5.3) skewness(5.3)
/ pos = ne header = 'Summary Statistics';
axis1 label=(a=90 r=0);
run;
Hi Reeza,
That crucial line is exactly what I was looking for. One more thing, I will be putting this code into a loop (n=1000+) and I need to set NOPRINT option. I've put NOPRINT in the line
ods table parameterestimates=pestimates noprint;
but it does not seem to suppress the print out in the results window. Is there a way to suppress the print out?
many thanks,
Van
That's not where you put the noprint option.
that goes in proc univariate line, but then that table doesn't get created so you lose your output.
You then need to move the line of code inside your dataset and I think it changes from ods table to ods output ...
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.