Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to plot Schoenfeld residuals for independent variable in one graph?

    I run the following code:

    stset Time, failure(death==1)

    stcox i.region i.yearofdiagnosis i.agegrp i.ethnicity

    stphtest, detail

    estat phtest, plot(i.region)


    However, when running the last line, STATA returns:

    estat phtest, plot(i.region_1)
    1.region 2.region 3.region 4.region not found in model
    r ( 198) ;


    So I think to myself, let's add each separate sub-group individually, which gives the following result:

    estat phtest, plot(1.region 2.region)

    1.region 2.region not found in model
    r ( 198) ;


    However, when I only plot one sub-group this works.

    estat phtest, plot(2.region)

    How can I plot all all i.region sub-groups into one graph using STATA?
    Last edited by Stata Nut; 05 Aug 2024, 21:18.

  • #2
    Three points of protocol, one trivial but the others not quite so trivial.

    You cross-posted at https://www.reddit.com/r/stata/comme...r_independent/ Here it is a request and on Reddit it is a rule that you tell people about cross-posting elsewhere. Their rules are posted explicitly. https://www.statalist.org/forums/help#crossposting

    Here we ask that you use a real name. https://www.statalist.org/forums/help#realnames

    Stata is so spelled. https://www.statalist.org/forums/help#spelling

    You've a good chance of getting a reply otherwise and a better chance if you phrase your question in terms of a standard dataset. I don't do your kind of analysis, so won't try a direct reply.

    Comment

    Working...
    X