- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi everyone,
I'm currently working on fitting 21 years of data into Group-Based Trajectory Modeling (GBTM) using PROC TRAJ in SAS. Here's the code snippet I'm using:
sas 9.4
Copy code
PROC TRAJ DATA=OPPOSITN OUTPLOT=OP OUTSTAT=OS OUT=OF OUTEST=OE ITDETAIL CI95M;
ID ID;
VAR O13-O264;
INDEP T1-T252; /* Year – 1992 - 2012 (21 Years) */
MODEL CNORM;
MAX 30;
NGROUPS 3;
ORDER 1 1 2 ;
RUN;
%TRAJPLOT(OP, OS, 'Trajectory Of Year 1991 - 2012', 'Cnorm Model', 'Temp Diff.', 'Time (Months)');
%TRAJPLOTNEW (OP,OS,'Trajectory Of Year 1991 to 2012', 'CNorm Model', 'Temp Diff.', 'Scaled Time');
This code generates a graph, as shown in the attached image. However, I'm facing an issue with the X-axis; it's displaying 300 units, including 48 blank points. Is there a way to modify the TRAJPLOT to plot only the required 252 units on the X-axis, corresponding to the 21-year timeline from 1992 to 2012?
I'm seeking guidance on how to adjust the X-axis in the TRAJPLOT to ensure it only displays the necessary 252 units and eliminates the extra blank points.
Thank you for your help and suggestions!
Best regards,
MD. Sihab Sarar
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
PROC TRAJ is a user-written procedure.
%TRAJPLOT and %TRAJPLOTNEW are user-written macro's.
All 3 things above are NOT SAS-supplied.
You can contact the author of PROC TRAJ
or you can extract the code generated by the macro (use mprint option and copy/paste from the LOG).
Then submit the proc gplot or the proc sgplot again with your own x-axis scaling.
Here are some examples that might inspire you:
https://support.sas.com/en/knowledge-base/graph-samples-gallery.html
PROC GPLOT : https://support.sas.com/sassamples/graphgallery/PROC_GPLOT.html
PROC SGPLOT : https://support.sas.com/sassamples/graphgallery/PROC_SGPLOT.html
Good luck,
Koen