Hi Statalist,
I cannot figure out how to do this... the attached graph is exactly what we want, but not the linear fit line; we want the predicted probabilities instead of the lfit. Here is the syntax that I used to get the attached graph. The spline regression is what we want (before 2002 and after 2002), but not the linear fit line. Is there a way to make this graph BUT with the predicted probabilities line and splined?
(note: num_inadeq is a 0-6 count var and the IV of interest is ostomyyears (which is a surgery year) and that ranges from 1953 to 2017)
Syntax:
** Piecewise scatter plot with predicted probabilities
nbreg num_inadeq ostomyyears ib5.educ_revised white female AGE
predict inadeq
twoway (scatter inadeq OSTOMY_DATE_YR) (lfit inadeq OSTOMY_DATE_YR if ostomyyears <=2002) ///
(lfit inadeq OSTOMY_DATE_YR if ostomyyears >=2002)
Any suggestions?
Related Posts with Tried several variations...need help with graphing a predicted probabilities plot with twoway scatter plot and splined
Coefplot subgraphs - how to tailor the axis scale of each subgraph?Dear Statalisters, I have graphed a coefplot with 4 subgraphs, each containing a different model. I…
How to identify dummy changes over period?Hello Statalists, So the dataset is a panel year month HS Codes subject to NTM (Non-tariff Measure)…
Help Using CountIf Function?Dear all, I am using Stata 16, on mac. I have taken a snapshot on the panel dataset I am working wi…
Export table of estat icc to Latex from multilple estimationI want to export my estat icc after mixed model regression into a single table as LaTeX format. Co…
Multiple Correspondence Analysis in StataDear Stata users, Good morning. I have created a perception index using multiple correspondence an…
Subscribe to:
Post Comments (Atom)
0 Response to Tried several variations...need help with graphing a predicted probabilities plot with twoway scatter plot and splined
Post a Comment