
Wednesday
SteveDenham
Jade | Level 19
Member since
06-23-2011
- 3,963 Posts
- 2,198 Likes Given
- 253 Solutions
- 2,409 Likes Received
About
Linear models
-
Latest posts by SteveDenham
Subject Views Posted 1555 2 weeks ago 726 2 weeks ago 1584 2 weeks ago 532 3 weeks ago 586 3 weeks ago 366 3 weeks ago 440 03-10-2025 02:47 PM 221 03-10-2025 02:28 PM 352 03-06-2025 10:04 AM 706 03-06-2025 10:01 AM -
Activity Feed for SteveDenham
- Liked Re: Proc power for wilcoxon signed rank for FreelanceReinh. Wednesday
- Liked Re: Infuence diagnostics are not estiamted (Update failed) for jiltao. Wednesday
- Liked Re: Can we do the approximately unbiased estimator for the probability density function of cont. var for FreelanceReinh. Monday
- Liked Re: PROC GLM and the 'diff' option in LSMEANS for data_null__. Monday
- Got a Like for Re: What test should I use?. 2 weeks ago
- Got a Like for Re: Appropriate model for non-normal distribution. 2 weeks ago
- Posted Re: Appropriate model for non-normal distribution on Statistical Procedures. 2 weeks ago
- Got a Like for Re: Appropriate model for non-normal distribution. 2 weeks ago
- Got a Like for Re: What test should I use?. 2 weeks ago
- Liked Re: How to conduct Balancing test / joint F-statistic? for Ksharp. 2 weeks ago
- Liked Re: How to conduct Balancing test / joint F-statistic? for sbxkoenk. 2 weeks ago
- Liked Re: PROC FOREST- Unable to run code for eduardo_silva. 2 weeks ago
- Liked Re: PROC FOREST- Unable to run code for JackieJ_SAS. 2 weeks ago
- Posted Re: What test should I use? on Statistical Procedures. 2 weeks ago
- Liked Re: Data Analysis for PaigeMiller. 2 weeks ago
- Posted Re: Appropriate model for non-normal distribution on Statistical Procedures. 2 weeks ago
- Got a Like for Re: I have different results in PROC GLIMMIX with the same dataset and code. 2 weeks ago
- Liked Re: Joint mean and variance modeling in SAS: any suggestions on which PROCs should I use? for StatDave. 3 weeks ago
- Liked Re: Count data over years and repeated measures for StatDave. 3 weeks ago
- Liked Re: PROC PLS, Is W (Xweights) has different calculation than the standard versions (Ex. from R/Pytho for PaigeMiller. 3 weeks ago
-
-
My Liked Posts
Subject Likes Posted 1 2 weeks ago 1 2 weeks ago 3 2 weeks ago 1 3 weeks ago 2 3 weeks ago
2 weeks ago
1 Like
You need to add an NLOPTIONS statement to your code. The log likelihood is converging, but it is running into the default maximum number of iterations (=19).
Try adding:
nloptions maxiter=500;
to your GLIMMIX code. Alternatively, you might wish to set the ABSGCONV to 1e-6 (or something like that), as it looks like the max gradient in the iteration history is cycling around at values less than this.
Also, with a non-normal distribution, you may want to change from method=rspl to method=quad (or method=laplace if there are issues with the number of points for adaptive quadrature). However, if you do change to method=quad, you will need to change the RANDOM statement to:
random intercept/subject=block;
as the quadrature method requires that the data be processed by subject. I think you are right for the rest with the gamma.
Regarding plot size, does that put an upper bound on the dependent variable? If the areas being analyzed substantially less than that upper bound then there shouldn't be an issue, but it could possibly result in things like an lsmean being larger than any of the plots if you fit a gamma and a substantial portion of the dependent variables are greater than one-half of the maximum plot size..
In that case, consider fitting a four parameter logistic model, with a random effect, using PROC NLMIXED. There are examples out on the interwebs for that approach. Here is something really simple:
proc nlmixed data=mydata;
model response = a + (b-a)/(1+exp(c*(x-d))) / dist=normal;
parms a=0.0 b=1.0 c=1.0 d=0.0; /*replace b=1.0 with b=<max plot size> */
random intercept / subject=block;
run;
Just something to consider. If there are treatments applied like you have, the code gets a whole boatload more complicated, but there are examples out there on how to incorporate those.
SteveDenham
PS - the arcsine transformed data is an approximation of the logistic model, so that may be why it is looking appropriate.
... View more
2 weeks ago
3 Likes
I would make a couple minor changes to @Ksharp 's PROC MIXED code, in case there is a difference over time for the two sexes:
proc mixed data=have;
class sex semester;
model grade=sex semester sex*semester/ddfm=kr2 s;
repeated semester/ subject=id type=ar(1);
lsmeans sex semester/diff e;
lsmeans sex*semester/diff e; /* This should probably be modified to look at the simple effect of sex for each semester, and the simple effect of semester for each sex by using the SLICE option */
run;
There is at least one other thing to consider as well - should separate variance-covariance estimates be applied by sex, to handle any differences (non-homogeneity). If that is the case, you may need to change to PROC GLIMMIX to check on that.
SteveDenham
... View more
2 weeks ago
1 Like
I think you are doing well so far. Here are some points to consider, that I can't determine from the presentation:
Design-wise, are the plots identical in area? If not, then the binomial distribution referred to later on may not be appropriate. That may require something like a beta distribution.
Although the quantile plot you present doesn't seem too bad, your data may be zero-inflated or a hurdle model might be appropriate. Before you go down that path though, you need to think about what process could lead to excess zeroes. Stroup's text (Generalized Linear Mixed Models, 2013) has a section that uses NLMIXED to fit excess zeroes for count data, and the code could be modified to fit distributions other than Poisson or negative binomial.
Can you share your GLIMMIX code, and the iteration history? There may be some easy tweaks to enable the model to converge.
SteveDenham
... View more
3 weeks ago
1 Like
So given the definition of left censoring that PROC SEVERITY uses, your response value could potentially be negative. Zero and negative values aren't supported by several of the interesting distributions available to you in SEVERITY. Would those values be meaningful, or even observable? (I only ask as I don't know what the response variable is). If the variables are not observable, then consider that the left truncation approach has some appeal. You can set the truncation value at a small non-zero value, and all of the estimates are correctly determined. The issue becomes what is the small value to use. I think a good way to choose would be to see to how many decimal places the response is measured, and then set the truncation at half that value. For example, suppose you measure the response to the nearest thousandth (=Y.YYY). Under this scheme, the truncation value of 0.0005 would guarantee that it is greater than zero, and that all observed values are included.
Or am I still missing the point here?
SteveDenham
... View more
3 weeks ago
1 Like
Is your data left censored or left truncated? The way I read the documentation, left truncation means the result is observed only if Y > T where T is the truncation threshold. Then the documentation defines left censoring if it is known that the magnitude is Y<= C. That may have some effect on the CDF estimates. I suspect that the use of a small value for the cutpoint may then have a different effect, especially for the candidate distributions that are not defined for Y=0. I would be tempted to add a small value to all the observations, and then set the cutoff at that value, just to see what happens.
SteveDenham
... View more
3 weeks ago
2 Likes
I have seen some behavior such as this. Recall that the optimization method is non-linear and that the log likelihood values are defined as hexadecimal during calculations. That leads to truncation and semi-chaotic behavior if the program is run on a different machine or even on the same machine with a different operating system. Also, check to see if your version of SAS has changed since the original run. There were some substantive changes made to GLIMMIX going from previous versions to SAS v9.4TS1M8 that may be contributing to this. See this problem Note: https://support.sas.com/kb/70/094.html
SteveDenham
... View more
03-10-2025
02:47 PM
1 Like
Sorry @Ksharp and @TomHsiung, I don't know off hand how to get the estimates at the knots for each subject. I would start with the OUTEST= option in the PROC PHREG statement, and go from there.
SteveDenham
... View more
03-10-2025
02:28 PM
Two white bars are presented in the second column. That represents variables removed from the second model because they weren't "significant".
SteveDenham
... View more
03-06-2025
10:04 AM
Is there a question in here someplace that I missed?
SteveDenham
... View more
03-06-2025
10:01 AM
Here are links to couple threads in the community from some years ago:
https://communities.sas.com/t5/SAS-Procedures/GLIMMIX-with-two-repeated-measures-variables/td-p/232686
https://communities.sas.com/t5/Statistical-Procedures/repeated-measures-in-glimmix/td-p/128310
The first from @sld has several ways of modeling the doubly repeated measures and compares V matrices from MIXED and GLIMMIX.
The second is from me, and has a lot of untested code in the GLIMMIX call, but basically boils down to calling one effect as strictly G side, and the effect nested within that variable (say time) as an R-side (residual). Take care in identifying the subject for the R-side effect.
SteveDenham
... View more
03-05-2025
09:34 AM
And for prediction intervals there are two varieties - the first is an approximate interval containing all of k future observations, the second is an interval containing the mean of k future observations. Be sure to check the section for Methods for Computing Statistical Intervals to note the difference between the two methods.
SteveDenham
... View more
03-05-2025
08:57 AM
@sbxkoenk raises an important difference. When I want a prediction interval, I am lucky enough to have the SAS/QC module licensed so that I can use PROC CAPABILITY.
SteveDenham
... View more
02-21-2025
11:20 AM
3 Likes
Following up on Warren's statement, I always try to do some sensitivity analysis when a method depends on a random number - especially for Bayesian analyses. Running with 10 to 20 seeds and examining results and traces is pretty informative. Sometimes the data is so ill behaved that none of the results match within an acceptable range.
SteveDenham
... View more
02-05-2025
01:35 PM
A long post, and I fear I may have missed the question, but I will point out that one of your last statements " i.e. there is nothing to say that the true median does not lie above this value?" is critical. It is why the upper bound from LIFETEST is not defined, and seems to me to be a really good reason to use the LIFETEST CI's rather than the macro generated CI's.
But that is just me.
SteveDenham
... View more
02-05-2025
01:26 PM
2 Likes
Let's break this down into parts. The first is simple enough - an NLOPTIONS statement with the TECH=NONE option. The next part is determining which effects will go into the grid. For that, we need to have the code you are currently using, to identify which variables are going to be included in the grid search. This will likely differ based on the statistical PROC you want to use.
In most cases, this is going to involve the PARMS statement. I would recommend heading to the documentation for the PROC you want to use in your analysis and read through the PARMS statement for that PROC. I have used this several times with PROC GLIMMIX, so I find that my go-to.
SteveDenham
... View more