BookmarkSubscribeRSS Feed
Calcite | Level 5

I am trying to use proc mixed to analyze correlated data. Specifically, I am trying to assess whether mean number of pills prescribed changed over a 5 year time period, by provider.


1. I get a p value for the model  but I am trying to contrast the different years and the contasts keep coming up with empty fields.

2. Additionally, I am getting a message that says 'Invalid or missing data' and I am unsure what this refers to.


I appreciate any assistance. Thanks!


proc mixed data=gs;

class surgeon year(ref=first);

model pillnum = year/ s;

repeated / subject=surgeon type=cs r rcorr;

contrast 'year 2 vs 3-5' year 2 -2;


Rhodochrosite | Level 12 sld
Rhodochrosite | Level 12

Your CONTRAST statement does not do what you want. See

CONTRAST and ESTIMATE Statements Made Easy: The LSMESTIMATE Statement


Examples of Writing CONTRAST and ESTIMATE Statements

Then follow up if you still have trouble.


We would have to see your data to know why you are getting "Invalid or missing data". Or speculate wildly. 


I recommend adding <repeated-effect> to the REPEATED statement. See the documentation for MIXED | REPEATED It might help resolve your error message, more or less.


I hope this helps.


Super User

@tbn1 wrote:

2. Additionally, I am getting a message that says 'Invalid or missing data' and I am unsure what this refers to.


When getting error or warning messages it is best to copy the code and messages from the log. Paste into a code box opened using the forum's {I} icon. Many messages have diagnostics but the message windows on this forum will reformat text making any of the diagnostic characters less useful. The code box does a much better job maintaining the log. Including the actually submitted code from the log clears up any potential questions about possible typos or options chosen.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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
  • 2 replies
  • 3 in conversation