turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- Plots to illustrate results of linear mixed effect...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-16-2016 10:21 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-16-2016 05:02 PM

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.

All Replies

Solution

01-16-2016
08:58 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-16-2016 05:02 PM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-16-2016 08:57 PM

Hello @FreelanceReinhard,

Thanks a lot for your great help. It works perfectly with the original data. I am attaching you the model results and the plot. One more question, if I wnat to draw a mean line of temperature trend with and without all the plots than what will be my code? Thanks a lot. Best wishes. Regards....Sohel

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-17-2016 10:50 AM

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.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

01-17-2016 03:41 PM

Thanks a lot dear