- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi! I am putting together a segmented regression with visualization. However, plotting the data, I can not seem to get the two periods to touch. Could anyone help provide assistance with this?
proc autoreg data=a1;
model rates = QTRs aft_cnt / method=ml nlag=12 backstep dwprob loglikl;;
output out=auto_reg predicted=pred;
by Patient_Age_Category; /*This line of code will treat each age_cat separately*/
quit;
proc sgplot data=glimmix_out noautolegend;
block x=QTRs block=period / transparency=.75;
scatter x=QTRs y=rates / markerattrs=(symbol=CircleFilled color=black);
series x=QTRs y=pred / group=period lineattrs=(thickness=3);
by Patient_Age_Category; /*This line of code will treat each age_cat separately*/
run;
Thank you!!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
But your blue line and your red line do not intersect each other at the boundary between blue and red. They would intersect to the left of the boundary, in the blue region.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I don't know what you mean by this: "I can not seem to get the two periods to touch" ?? What should the plot look like if the two periods touched? (It looks like they touch to me, separated by a vertical line)
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your reply. What I meant to say was the two regression lines.
EDIT: for example, when I run this same process in R, the two regression lines meet at the joint. (with the same results)
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
But your blue line and your red line do not intersect each other at the boundary between blue and red. They would intersect to the left of the boundary, in the blue region.
Paige Miller
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I see what you are saying, thanks. I just need to drop that boundary region.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content