BookmarkSubscribeRSS Feed
cd2011
Calcite | Level 5

Hi,

I am trying qqplot/ppplot for inverse gaussian. SAS support website says to use :

proc univariate data=name;

           qqplot var/ igauss(mu= lambda= );

run;

But I am getting an error. Any idea why is it not working? I can make it work for gamma but not inv gaussian. I can't find any alternatives either.

Thanks for any help.

11 REPLIES 11
Reeza
Super User

For SAS 9.3 inverse gaussian isn't a valid parameter, the distributions options are:

Can you point to where the SAS support website provides that option?

Base SAS(R) 9.3 Procedures Guide: Statistical Procedures

Option

Description

BETA(beta-options)

specifies beta Q-Q plot for shape parameters and specified with mandatory ALPHA= and BETA= beta-options

EXPONENTIAL(exponential-options)

specifies exponential Q-Q plot

GAMMA(gamma-options)

specifies gamma Q-Q plot for shape parameter specified with mandatory ALPHA= gamma-option

GUMBEL(Gumbel-options)

specifies gumbel Q-Q plot

LOGNORMAL(lognormal-options)

specifies lognormal Q-Q plot for shape parameter specified with mandatory SIGMA= lognormal-option

NORMAL(normal-options)

specifies normal Q-Q plot

PARETO(Pareto-options)

specifies generalized Pareto Q-Q plot for shape parameter specified with mandatory ALPHA= Pareto-option

POWER(power-options)

specifies power function Q-Q plot for shape parameter specified with mandatory ALPHA= power-option

RAYLEIGH(Rayleigh-options)

specifies Rayleigh Q-Q plot

WEIBULL(Weibull-options)

specifies three-parameter Weibull Q-Q plot for shape parameter specified with mandatory C= Weibull-option

WEIBULL2(Weibull2-options)

specifies two-parameter Weibull Q-Q plot

cd2011
Calcite | Level 5

here is for ppplot:

Base SAS(R) 9.3 Procedures Guide: Statistical Procedures

got the igauss syntex from here:

Base SAS(R) 9.3 Procedures Guide: Statistical Procedures

Is there any way to get qqplot for inverse gaussian if proc univariate does not work.

Thanks

lvm
Rhodochrosite | Level 12 lvm
Rhodochrosite | Level 12

In 9.3, you can get a ppplot, but not a qqplot. If you check the documentation, igauss is only a valid option on ppplot. I just did this using:

proc univariate data=a;

var x;

ppplot x / igauss;

run;

cd2011
Calcite | Level 5

Hmmm! it is pretty strange. If I try the exact code with gamma option, it works, but iguass option does not work. SAS does not even recognize it as a valid option.

Thanks for the help.

Reeza
Super User

Its not a valid option for qqplot according to the SAS Docs.

The only way I could think of is pretty much brute force, generating the values and using proc gplot.

SteveDenham
Jade | Level 19

Since the inverse Gaussian is an exponential family, you might try:

proc univariate data=a;

var x;

qqplot x / exponential;

run;

A reference line can be inserted by noting that THETA=-lambda/(2*mu*mu) and SIGMA=-lambda/2 (I think.  Those might be reversed).  And no guarantees on this one--it's just a possibility.

Steve Denham

cd2011
Calcite | Level 5

Steve,

Your code does work. However, I need to draw a reference line at 45 degree for comparison. It might be a silly question, but I could not find any resources for help with that. Thanks!

SteveDenham
Jade | Level 19

Today's scary approach:

proc univariate data=a;

var x;

qqplot x / exponential(theta=est sigma=est);

run;

That should give you a 45 degree line, and estimates of theta and sigma.  From those values, you can calculate lambda and mu for the inverse gaussian.

Why is this scary?  It's untested, and right now, I don't have time to write a program that would generate 1000 inv-gaussian random variates with known lambda and mu values to check it.

Steve Denham

Rick_SAS
SAS Super FREQ

You can produce the quantiles for IGAUSS and use them to produce a Q-Q plot. See Modeling the distribution of data? Create a Q-Q plot - The DO Loop

You can use the LINEPARM statement in PROC SGPLOT to produce a diagonal line. See Add a diagonal line to a scatter plot: The SAS 9.3 way - The DO Loop

cd2011
Calcite | Level 5

Hi Rick,

Thanks for your reply. There are many useful information on the links you provided. I was able to get the qqplot as per your instruction. However, I was not able to draw the diagonal line because I am using SAS9.2 so lineparm will not work.

Thanks much,

-CD

Rick_SAS
SAS Super FREQ

The very first sentence of the blog post  "Add a diagonal line..." contains a link to an article that shows how to add a diagonal line at SAS 9.2.

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!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 11 replies
  • 2403 views
  • 0 likes
  • 5 in conversation