BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
vt96
Calcite | Level 5

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!

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

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;

View solution in original post

5 REPLIES 5
Reeza
Super User

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.

vt96
Calcite | Level 5

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.

Reeza
Super User

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;

vt96
Calcite | Level 5

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

Reeza
Super User

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 ...

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 5 replies
  • 566 views
  • 6 likes
  • 2 in conversation