BookmarkSubscribeRSS Feed
Calcite | Level 5 dsm
Calcite | Level 5

Hello all,


I am analyzing some reaction time data, and I am attempting to do a more sophisticated analysis than simply transforming the data to reduce skew. A lot of current work recommends using the ex-Gaussian distribution as it more accurately captures the shape of the data. The ex-Gaussian is a convolution of the Gaussian and an exponential distributions. so essentially normal with a long positive skew.


The distribution is described by three parameters, mu, sigma, and tau, which are the mean and SD of the Gaussian portion, and the third parameter describes the mean of the exponential component. The below paper describes a toolbox for MATLAB that estimates these parameters based on inputted data, as well as some other fun things.


My question is, is there any way to do this in SAS? I can't find any literature on implementing ex-Gaussian distributions in SAS, or on how to estimate these parameters. I'm wondering if anyone here has some insight. 



Super User

PROC NLIN could do it.

And I have feeling SAS/IML also could get it . 

Calling @Rick_SAS 

SAS Employee

Yes, NLIN would be a good way to do this. I implemented this distribution in JMP for a customer and was done with a nonlinear model.


The PROC IML syntax is very similar to MATLAB, so you could use the existing paper to write the log-likelihood and then use SAS/IML 

See "Maximum likelihood estimation in SAS/IML"


If you don't have a license for SAS/IML, you can use PROC NLMIXED to set up and maximize the log-likelihood function.

See also "Two simple ways to construct a log-likelihood function in SAS."

Calcite | Level 5 dsm
Calcite | Level 5

Thanks, @Rick_SAS .I'm actually having the most trouble deciphering the Phi symbol in the formula, or how to implement it in SAS. Do you have advice on this one? It states that is is the cumulative distribution of the Gaussian function. Does SAS have a built in for this mathematical computation? 


Capital Phi is a standard symbol that indicates the cumulative nornal distribution function. You can use the CDF function in SAS

to evaluate the cumulative normal distribution. The syntax is 

c = CDF("Normal", x, mu, sigma);

Then c represents the probability that a random draw from the N(mu, sigma) distribution is less than x.


For more information about the CDF in SAS, see "Four essential functions for statistical programmers."


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!

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
  • 5 replies
  • 1 like
  • 4 in conversation