BookmarkSubscribeRSS Feed
dsm
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. 

 

https://www.tqmp.org/RegularArticles/vol04-1/p035/p035.pdf

 

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. 

 

-David

5 REPLIES 5
Ksharp
Super User

PROC NLIN could do it.

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

Calling @Rick_SAS 

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

Rick_SAS
SAS Super FREQ

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

dsm
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? 

Rick_SAS
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 944 views
  • 1 like
  • 4 in conversation