Date: Thu, 9 Dec 2010 17:54:40 -0500 Reply-To: Peter Flom Sender: "SAS(r) Discussion" From: Peter Flom Subject: Re: Statistics question, negative binomial regression residuals Comments: To: Dale McLerran Content-Type: text/plain; charset=UTF-8 Dale wrote (in part) > >Yes, I thought of the beta distribution when the probability >density function was stated to be U-shaped. Bi-modal at the >ends of the distribution might well be described through a >beta distribution. > >Bi-modality alone is not enough to suggest a beta distribution. >A U-shape does suggest a beta distribution. But if there are >two peaks with densities decaying on both sides of one or both >peaks, some sort of mixture distribution is indicated. > >Note that the standard beta distribution has the properties > > 0 x<=0 > P(X=x) = f(alpha,beta) 0 0 x>=1 > >That is, the density is only positive for x between 0 and 1, >exclusive of the 0 and 1 values. The parameters alpha and >beta are positive, and the expected value of X is > > E(X) = alpha / (alpha + beta) > > >There is a four parameter beta distribution for which > > 0 x<=theta > P(X=x) = f(alpha,beta,theta,sigma) theta 0 x>=theta+sigma > > >The GLIMMIX procedure allows regression estimates for the >two parameter beta distribution. The CAPABILITY procedure >allows estimates for the four parameter beta distribution. >Note, though, that the CAPABILITY procedure only allows a >univariate analysis. There is no capacity for producing >regression estimates when you use the CAPABILITY procedure. > snip This explains a lot! I had tried first fitting a beta distribution to the raw variable using PROC UNIVARIATE. This required a four parameter beta distribution, which fit quite well title 'Exploring the beta distribution'; ods html; ods graphics on; symbol v=plus height=3.5pct; title 'Beta Probability Plot for Dose'; proc univariate data=d1.alldata noprint; qqplot dose / beta(alpha = est beta=est theta = -1 sigma = 13) href = 95 lhref = 1 square; run; ods graphics off; ods html close; But the result fit quite well, given the fact that the data are counts. Then I tried fitting the beta with GLIMMIX, which needs a two parameter beta: ods html; ods graphics on; title 'Model 3: Dose; last time for each patient'; title2 'Beta distribution, identity link'; proc glimmix data=d1.lastdata plots = all; class site patid edu marr ; model dose= edu age marr white xRAN002b white|matching|mpgci/dist=beta link = id solution s; output out = dose3way pred = p3way; where dose ne .; run; ods graphics off; ods html close; This, for some reason gave an error of INVALID OR MISSING DATA, which SAS Tech support is working on. (But if someone has an idea ...) Next I will try the macro which Dale was nice enough to provide. Thanks, Dale, for such a great response! Peter Peter L. Flom, PhD Statistical Consultant Website: http://www DOT statisticalanalysisconsulting DOT com/ Writing; http://www.associatedcontent.com/user/582880/peter_flom.html Twitter: @peterflom

Back to: Top of message | Previous page | Main SAS-L page