Programming the statistical procedures from SAS

Plots to illustrate results of linear mixed effect model

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

Plots to illustrate results of linear mixed effect model

Dear All,

I've been trying to model the climate data (temperature) trend over time for combined sites using LMM Proc Mixed. I was just wondering if anyone experienced with mixed effect models could suggest which plots to use in illustrating the results of the model. I was thinking about plotting the fitted values from random coefficients model. I used the following code. However, I found the following error.

 

“NOTE: The data set WORK.PRED has 0 observations and 0 variables.

WARNING: Data set WORK.PRED was not replaced because new file is incomplete.

ERROR: Variable PRED not found.

 ERROR: Variable YEAR not found.

 ERROR: Variable PLOT not found”

 

Please suggest me what could be the proper code to visualise the output of LMM, Any suggestion is highly appreciated. Thanks. 

 

proc mixed data= import;
   class plot;
   model temp =  plot plot*year;
run;

proc mixed data=import;
         class plot;
         model temp = year /  ddfm=kr solution outp=pred;
         random int year / type=un subject=plot solution;
         run;

proc sort data=pred; 
         by year; 
         run;

proc sgplot data=pred;  
         series y=pred x=year / group=plot;
         run;


Accepted Solutions
Solution
‎01-16-2016 08:58 PM
Trusted Advisor
Posts: 1,115

Re: Plots to illustrate results of linear mixed effect model

Hello @sohelsayma,

 

As a first step, I think, you should make sure that your input data are correct. Did you notice that the four time series for PLOT=1, 2, 3, 4 in temp.xlsx are exactly identical (maybe due to a copy/paste error)? This should not be the case in your dataset IMPORT in order for model variable PLOT to make sense.

 

Possibly, with correct data the issue with the OUTP= dataset will disappear. If you'll still get the same note about an empty dataset WORK.PRED, it would be helpful if you included the (presumably) preceding warning message from PROC MIXED in your post. This could read, for example, "WARNING: Did not converge." or "WARNING: Stopped because of too many likelihood evaluations." Then, mixed models experts in the forum will be able to give you further advice, also regarding illustrative plots.

The conference paper Tips and Strategies for Mixed Modeling with SAS/STAT® Procedures contains a lot of information about those statistical/computational issues such as failed convergence.

 

The three error messages (from PROC SGPLOT, I assume) are just a consequence of the previous issue with dataset PRED.

View solution in original post


All Replies
Solution
‎01-16-2016 08:58 PM
Trusted Advisor
Posts: 1,115

Re: Plots to illustrate results of linear mixed effect model

Hello @sohelsayma,

 

As a first step, I think, you should make sure that your input data are correct. Did you notice that the four time series for PLOT=1, 2, 3, 4 in temp.xlsx are exactly identical (maybe due to a copy/paste error)? This should not be the case in your dataset IMPORT in order for model variable PLOT to make sense.

 

Possibly, with correct data the issue with the OUTP= dataset will disappear. If you'll still get the same note about an empty dataset WORK.PRED, it would be helpful if you included the (presumably) preceding warning message from PROC MIXED in your post. This could read, for example, "WARNING: Did not converge." or "WARNING: Stopped because of too many likelihood evaluations." Then, mixed models experts in the forum will be able to give you further advice, also regarding illustrative plots.

The conference paper Tips and Strategies for Mixed Modeling with SAS/STAT® Procedures contains a lot of information about those statistical/computational issues such as failed convergence.

 

The three error messages (from PROC SGPLOT, I assume) are just a consequence of the previous issue with dataset PRED.

Occasional Contributor
Posts: 19

Re: Plots to illustrate results of linear mixed effect model

Hello @FreelanceReinhard,

Trusted Advisor
Posts: 1,115

Re: Plots to illustrate results of linear mixed effect model

Hello @sohelsayma,

 

Glad to read I could help you with my few hints. Thanks for accepting them. The preview window says "Error displaying attachment content" when I try to view your PDF file, but I think that's not important. Regarding your plot, please have a look at the PROC SGPLOT graph gallery: http://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html. I think, you could either create an overlay plot (i.e. add another SERIES statement to your existing PROC SGPLOT step, see Sample 39137 in the gallery) or possibly use the annotate feature (see Sample 49302) to draw your mean line.

 

If you get stuck, please feel free to create a new, specific post in the SAS/GRAPH and ODS Graphics board, where the ODS Graphics experts will be happy to help you. I'm sure, you will have your desired plot very soon.

Occasional Contributor
Posts: 19

Re: Plots to illustrate results of linear mixed effect model

Thanks a lot dear

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 448 views
  • 1 like
  • 2 in conversation