- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi all,
Figure 1 is for a study period Jan 2018 - Dec 2019.
(note: figure removed by request of author)
Figure 2 is for study period Jan 2017 - Mar 2020.
(note: figure removed by request of author)
The values from Jan 2018 to Dec 2019 are the same for both figures, figure 2 is just an expanded version and includes more months.
My question is - why does the band for predicted series values changes when we expand the period? Shouldnt the bands be the same given that same datapoints where used? THANK YOU!
CODE FOR BOTH FIGS:
PROC SGPLOT DATA=outputdata;
title 'Cephalosporins (non-targeted population)';
SCATTER X=month Y=rate / MARKERATTRS = (COLOR=BLACK)
LEGENDLABEL = "Observed values";
/* SERIES X=month Y=yhat / LINEATTRS =(COLOR=DABGR PATTERN=SHORTDASH) */
/* */
/* LEGENDLABEL = "Predicted series values"; */
/* */
BAND X=month UPPER=ucl LOWER=lcl / FILLATTRS=(COLOR=LTGREY TRANSPARENCY=.7)
/* */
LEGENDLABEL = "Band for predicted series values";
SERIES X=month Y=trendhat / LINEATTRS =(COLOR= BLACK PATTERN=SOLID)
LEGENDLABEL = "Predicted mean (trend)";
/* BAND X=month UPPER=uclm LOWER=lclm / */
/* */
/* FILLATTRS= (COLOR= MEGR TRANSPARENCY=.5) */
/* */
/* LEGENDLABEL = "Band for predicted trend"; */
LABEL Rate = "Prescription rate per 1,000 beneficiaries"
month ="Month";
REFLINE '1dec2018'd / AXIS = X LINEATTRS =(PATTERN=SHORTDASH COLOR=BLACK);
REFLINE '1dec2018'd / AXIS = X LINEATTRS =(PATTERN=SHORTDASH COLOR=BLACK);
refline '1dec2018'd / axis= X
lineattrs=(thickness=10 color=grey) transparency=0.6 ;
RUN;
ODS GRAPHICS OFF;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
It's not PROC SGPLOT that is responsible for the difference in the predicted values, it is your regression model. The second model has an addition 12 observations before (and 3 after) the original observations. These observations cause the regression to choose a different model for the second set of observations. (Compare the parameter estimates for both models!) The graph is simply showing you the model in both cases, and they are different models.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This is very helpful! Thank you. I used PROC AUTOREG and I agree with you that the parameter estimates changes - this is probably because PROC AUTOREG makes adjustments based on autocorrelations (the second dataset expands 12 mo and 3 mo pre and post, respectively). Is it OK to present both figures in a manuscript or is it methodologically incorrect? Will it raise questions/concerns of why the confidence intervals are different?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ultimately, the editor and reviewers will help you decide if it is "okay" to show both graphs. Be sure to explain the model that each graph visualizes. Since they are different models, it shouldn't be surprising that the graphs are different.