Hi everyone
I have a question about the "Number of observations not used"-information when using proc mixed.
I'm investigation the the effect of a drug on Diabetes in a randomized clinical trial. I have five measurements pr patient - week 4, 8, 12, 16 and 1 year and blood sugar as my endpoint.
Whem I'm running the proc mixed, it says that 130 out of 400 observations are NOT used. And even though I have 103 patients in my study, it seems to only use data from 75 patiens.
I do have some missing variables in my dataset. For instance, I'm adjusting for how long each patient has had the diabetes diagnosis (in a covariate, I think), and when the patients dosn't know, I have entered ND. When I remove that covariate from the proc mixed, SAS seems to "notice" even more of my patients, as the 75 patients increase to 95.
What does this mean? Is SAS only analyzing the blood sugar-numbers from the 75 patients? Or is it informing me that 75 of 103 patients have a complete dataset? Can I count on/belive the statistics?
This is what I have typed in SAS (where "treatment" is treatment with other types of medication that might influence bloodsugar and "years" is number of years with the diabetes diagnosis):
proc mixed data=sasuser.data; where week>0;
class patient week group(ref='B') gender treatment years;
model bloodsugar= week group Group*week baseline_bloodsugar baseline_bloodsugar*week gender age baseline_bmi treatment years /solution cl ddfm=kr;
lsmeans group*week /cl;
repeated week / subject=patient type=un r rcorr;
run;
I really hope that you can help! Thank you in advance.
Any row that has a missing value in a variable included in a CLASS MODEL BY or similar statement is excluded.
One method to deal with this, if categorical, is to explicitly code the missing values.
A quick way to check is to run a missing report on your data.
@CamillaSvensson wrote:
Hi everyone
I have a question about the "Number of observations not used"-information when using proc mixed.
I'm investigation the the effect of a drug on Diabetes in a randomized clinical trial. I have five measurements pr patient - week 4, 8, 12, 16 and 1 year and blood sugar as my endpoint.
Whem I'm running the proc mixed, it says that 130 out of 400 observations are NOT used. And even though I have 103 patients in my study, it seems to only use data from 75 patiens.
I do have some missing variables in my dataset. For instance, I'm adjusting for how long each patient has had the diabetes diagnosis (in a covariate, I think), and when the patients dosn't know, I have entered ND. When I remove that covariate from the proc mixed, SAS seems to "notice" even more of my patients, as the 75 patients increase to 95.
What does this mean? Is SAS only analyzing the blood sugar-numbers from the 75 patients? Or is it informing me that 75 of 103 patients have a complete dataset? Can I count on/belive the statistics?
This is what I have typed in SAS (where "treatment" is treatment with other types of medication that might influence bloodsugar and "years" is number of years with the diabetes diagnosis):
proc mixed data=sasuser.data; where week>0;
class patient week group(ref='B') gender treatment years;
model bloodsugar= week group Group*week baseline_bloodsugar baseline_bloodsugar*week gender age baseline_bmi treatment years /solution cl ddfm=kr;
lsmeans group*week /cl;
repeated week / subject=patient type=un r rcorr;
run;
I really hope that you can help! Thank you in advance.
as @Reeza says, find out where the data are missing. Maybe you can agree a method for handling the missing data with your clinical colleagues or maybe the data can be retrieved: the patient ought to know when they were diagnosed with diabetes, but perhaps they know the year but not the month and day, check these patients aren't falling out of the analysis, maybe you want to impute this as 15june etc, duration will necessarily be affected by rounding etc
In situations like this, it really helps to actually LOOK AT your data set named sasuser.data. See what SAS is seeing. You can use VIEWTABLE (the preferred method) or PROC PRINT (less preferred).
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.