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
Collapse by a variable, while preserving others and creating new variablesHi, I have a dataset on property transactions (a sample below, for those of you from the UK, this i…
Creating an indicator variable from multiple, non-mutually exclusive, dummy variablesHi! I'm trying to create an indicator variable from several dummy variables (which are not mutually …
Help with Stata Coding (Urgent!)Nothing …
PSID - Generating a household IDI am using 10 waves of the PSID data with the aim of analysing trends in household charitable giving…
How to make it as a program?Hi All, I am trying to make this as a program. Any help? Below is my code. Thanks clear set seed 12…
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