Announcement

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

  • multivariable-adjusted rates

    Hi there
    I am using the streg command to calculate a multivariable-adjusted rate ratio for exposed versus unexposed. I simply want to view the multivariable-adjusted rates upon which the ratio is based? Is there an easy way to do this?
    With thanks
    Tim

  • #2
    You don't show us your command, and there are many potential variations on the theme. The simple case is that your predictor is a single categorical variable and your regression command looks something like -streg i.predictor, d(distribution)-. Whether you can get the underlying rates depends on which survival model you are using. If you are fitting an exponential model, then there is a well defined rate that applies over all time. In that case, you can use -margins predictor, expression(1/predict(mean time))- to get the corresponding adjusted incidence(mortality) rates. But if you are fitting, some other parametric survival model, then there is no constant rate that applies across time, so your question becomes ill-posed.

    Comment


    • #3
      Thanks Clyde and apologies for the lack of clarity.

      Yes, my command is similar to how you suggested. It is as follows:

      xi: streg i.exposure i.covar1 i.covar2 i.covar3, d(exp)

      exposure is a binary variable (exposed y/n) and I would like to know the (mortality) rates in the exposed group and unexposed group separately after adjusting for all three covariates simultaneously.

      Sorry if this is very basic, and I hope I have been clearer this time. Your advice is hugely appreciated!

      With thanks
      Tim

      Comment


      • #4
        First, you have to kill the -xi- prefix and re-run your estimation. In order to take advantage of -margins-, you have to use factor variables, and the obsolete -xi:- prefix overrides that. Nearly all Stata's official estimation commands support factor variables, and the few that don't are mostly obscure and archaic models that are little used by anyone.

        So:

        Code:
        streg i.exposure i.covar1 i.covar2 i.covar3, d(exp)
        margins exposure, expression(1/predict(mean time))
        will do it.

        At the risk of beating a dead horse: get out of the habit of using -xi-. In the unusual situation where you have to use an estimation command that doesn't support factor variables, you will quickly get an error message telling you as much when you try to run it. In that case, you can always quickly stick -xi:- in front of it and proceed the old-fashioned way. But you always should use factor variables when they are available (which is almost always) so that you can avail yourself of the amazing capabilities of the -margins- command afterwards.

        Do read the manual sections on the -margins- command and on factor variable notation.
        Last edited by Clyde Schechter; 19 Feb 2016, 09:38.

        Comment


        • #5
          Hi,

          Thanks for these. I am wondering if it is ok to use this margins-command as suggested also in piecewise exponential model using streg to obtain (overall) adjusted rates? I am currently running the following:
          streg ibn.fyear i.cov1 i.cov2, d(exp) nocons

          Any advice, or reference to other sources is appreciated!!

          Comment

          Working...
          X