Announcement

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

  • Suppressing some variables in coefplot when using multiple regression models

    Hi!

    I want to create a coefplot which compares unadjusted and adjusted cox regression models for several outcome variables. However, I want to exclude some of the covariates included in the adjusted model from the coefficient plot - is this possible? In other words, i want the coefficient plot to display the change in HR from the unadjusted --> adjusted models only for the independent variable in my study. In my adjusted models I have adjusted for (amongst many other things) gender which is not necessary to include in the coefplot - could this be removed? I have tried using "keep", however it does not generate the desired outcome. I get the following message:

    (simple_model: no coefficients found, all dropped, or none kept)
    (adjusted_model: no coefficients found, all dropped, or none kept)

    So the output does not change by including the keep command into the code

    my code is:
    coefplot simple_model adjusted_model, keep(indepvar) bylabel(" Coefplot")||, xline(1) eform byopts(compact cols(2)) baselevels


    grateful for help! thank you

  • #2
    -keep()- or -drop()- should work, you need to show a reproducible example where it fails. Note that coefplot is from SSC (FAQ Advice #12).

    Comment

    Working...
    X