BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ngui
Calcite | Level 5

I am using natural log transformation for my data. After finishing the Tukey test, how can I do a back transformation?

 

data box;

      set box;

      TRL_new = TRL + 1;

      TRL_sq = sqrt(TRL_new);

      TRL_log = log(TRL_new);

run;

Proc sort data=box;

      By block accession irrigation;

Run;

 

ods graphics on;

Proc mixed data=box cl plots=residualpanel (conditional) plot=boxplot (conditional); /* Residue test*/

      Class block accession irrigation;

      Model TRL_log= accession irrigation accession*irrigation;

      Random block;

      lsmeans accession irrigation accession*irrigation/ adjust=tukey;

Run;

ods graphics off;

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Hello @ngui ,

 

On the topic of: solving convergence issues with a GLMM (MIXED | GLIMMIX | NLMIXED | LMIXED)

 

I am focusing on GLIMMIX here (because I think that's your best choice!)

 

There is no golden rules in terms of specifying starting values for the parameters for PARMS statement in MIXED, GLIMMIX, NLMIXED .   I start with using the default starting values.

In some cases, adding PARMS/OLS ; might help or INITGLM in PROC GLIMMIX statement.  Yes, using a grid search or specifying a guess based upon subject matter knowledge or previous studies might be help.   You might try alternative METHODS of ESTIMATION to see if model converges or provides estimates for covariance parameters and then try those as starting values.

 

In my experience, convergence issue(s) – tend to be data and model dependent often related to either scaling issue with variables ,  over specified or incorrectly specified model.

 

Unfortunately ... and to be honest ... it is often trial and error to find what works and doesn’t. 

I always tend remind customers non-convergence isn’t always a bad .

 

Few papers to help customers with MIXED, GLIMMIX, NLMIXED with various issues:

 

 

Here is an outline that I commonly use in presentations that I hope will be helpful.

 

sbxkoenk_0-1695205679398.png

Koen

View solution in original post

11 REPLIES 11
sbxkoenk
SAS Super FREQ

I have moved this post to "Statistical Procedures" - board !

Koen

sbxkoenk
SAS Super FREQ

Use ilink after the forward slash on LSMEANS statement :

 

ILINK --> requests that means (and confidence limits) be displayed on the inverse linked scale.

 

SAS/STAT 15.3 User's Guide
LSMEANS Statement
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/statug/statug_glm_syntax10.htm

 

[EDIT] Sorry, this is NOT what you need. I will come back to you with proper solution.

 

Koen

ngui
Calcite | Level 5
ilink does not work do you have any suggestion
PaigeMiller
Diamond | Level 26

I think PROC GLIMMIX is useful here. Instead of performing the log transform in the data step, do it in PROC GLIMMIX.

 

Something like this:

 

Proc glimmix data=box; 
      Class block accession irrigation;
      Model TRL_new= accession irrigation accession*irrigation/link=log;
      Random block;
      lsmeans accession irrigation accession*irrigation/ adjust=tukey ilink;
Run;

 

--
Paige Miller
ngui
Calcite | Level 5
Thank you Paige! I not really want to use proc glimmix because of my data set and objective.
PaigeMiller
Diamond | Level 26

@ngui wrote:
Thank you Paige! I not really want to use proc glimmix because of my data set and objective.

Please explain this further. What about GLIMMIX does not meet your data set and objective?

--
Paige Miller
sbxkoenk
SAS Super FREQ

Hello @ngui ,

 

I agree with @PaigeMiller .

Why not use PROC GLIMMIX to fit your mixed model?

(you don't need a preliminary data step and you don't need post-processing for back-transforming)

 

Proc Glimmix vs Proc Mixed
https://communities.sas.com/t5/Statistical-Procedures/Proc-Glimmix-vs-Proc-Mixed/td-p/290525

 

SAS/STAT 14.3 User's Guide
The GLIMMIX Procedure
Comparing the GLIMMIX and MIXED Procedures
https://go.documentation.sas.com/doc/en/statcdc/14.3/statug/statug_glimmix_details64.htm

 

PROC GLIMMIX and PROC MCMC and PROC CALIS are extremely versatile SAS/STAT procedures.
With these 3 procedures you cover almost all of the functionalities / models / algorithms offered by other SAS/STAT procedures (I am exaggerating a bit , ... but just to claim they are very flexible, very versatile and very "all-encompassing").

 

Koen

ngui
Calcite | Level 5
Thank you for asking. I did run your code you provided but my data did not converge.
sbxkoenk
SAS Super FREQ

Hello @ngui ,

 

On the topic of: solving convergence issues with a GLMM (MIXED | GLIMMIX | NLMIXED | LMIXED)

 

I am focusing on GLIMMIX here (because I think that's your best choice!)

 

There is no golden rules in terms of specifying starting values for the parameters for PARMS statement in MIXED, GLIMMIX, NLMIXED .   I start with using the default starting values.

In some cases, adding PARMS/OLS ; might help or INITGLM in PROC GLIMMIX statement.  Yes, using a grid search or specifying a guess based upon subject matter knowledge or previous studies might be help.   You might try alternative METHODS of ESTIMATION to see if model converges or provides estimates for covariance parameters and then try those as starting values.

 

In my experience, convergence issue(s) – tend to be data and model dependent often related to either scaling issue with variables ,  over specified or incorrectly specified model.

 

Unfortunately ... and to be honest ... it is often trial and error to find what works and doesn’t. 

I always tend remind customers non-convergence isn’t always a bad .

 

Few papers to help customers with MIXED, GLIMMIX, NLMIXED with various issues:

 

 

Here is an outline that I commonly use in presentations that I hope will be helpful.

 

sbxkoenk_0-1695205679398.png

Koen

SteveDenham
Jade | Level 19

One thing I didn't see in @sbxkoenk 's response deals with the default number of iterations (20) that GLIMMIX uses when fitting.

Add an NLOPTIONS statement setting the number of iterations at some value greater than 20, which is the default for GLIMMIX. A good value, in my opinion, is at least 500; if that doesn't solve the issue, there are many other adjustments to the algorithm that may help, almost all of which are listed in @sbxkoenk 's post..

 

Oh yeah, the statement to add is 

NLOPTIONS maxiter=550;

SteveDenham

 

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 3113 views
  • 3 likes
  • 4 in conversation