Announcement

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

  • homogeneity of regression slopes

    Dear Stata Users
    Hope you can help me.
    I am using the stata 13 and as part of my Ph.D I want to compare examine if the effects of the regression coefficients on recidivism varies between 4 treatment programs operated in prison.
    for example:
    to see if high level of education increase the chances to succeed in treatment #1, decrease the chances in treatment #2 and so on...4 treatments total.
    I have many variables (about 15), and I do not want it to be too complicated.
    Any suggestions are very welcome.
    Thank you very much in Advance
    Noam

  • #2
    Noam:
    positive replies usually follows reading what the poster has typed in Stata and what Stata gave her/him back (as per FAQ). Thanks.
    That said, you may factorize the 4 treatment programs via -fvvarlist- and end up with a code mimicking the following one (I assume that your -depvar- is binary):
    Code:
    logit recidivism i.programs controlvars
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you very much Carlo, I really appreciate your help.
      what if the Depvar is interval? should i only write this?
      will this code give me the answer if there are differences in the effects of same variables between the programs?
      Thanks a lot
      all the best
      Noam

      Comment


      • #4
        Noam.
        if -depvar- is an interval (continuous) variable, you should replace -logit- with -reg-.
        Like in the following example, the code will give you the effect of each programmes on the -depvar- vs reference category (the programme ruled out from the regression to avoid the dummy trap problem) when adjusted for the other control indepvars.
        Code:
        . sysuse auto.dta
        (1978 Automobile Data)
        
        . reg price i.foreign mpg
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(2, 71)        =     14.07
               Model |   180261702         2  90130850.8   Prob > F        =    0.0000
            Residual |   454803695        71  6405685.84   R-squared       =    0.2838
        -------------+----------------------------------   Adj R-squared   =    0.2637
               Total |   635065396        73  8699525.97   Root MSE        =    2530.9
        
        ------------------------------------------------------------------------------
               price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
             foreign |
            Foreign  |   1767.292    700.158     2.52   0.014     371.2169    3163.368
                 mpg |  -294.1955   55.69172    -5.28   0.000    -405.2417   -183.1494
               _cons |   11905.42   1158.634    10.28   0.000     9595.164    14215.67
        ------------------------------------------------------------------------------
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Are you basically just asking whether there are interaction effects? If so, do something like

          Code:
          webuse nhanes2f, clear
          reg weight age i.race i.race#c.age
          testparm i.race#c.age
          In the above, you are testing whether the effect of age differs by race.

          If you aren't that familiar with interaction effects, for a more detailed discussion see

          http://www3.nd.edu/~rwilliam/stats2/l51.pdf

          http://www3.nd.edu/~rwilliam/stats2/l53.pdf

          http://www3.nd.edu/~rwilliam/stats2/l55.pdf
          -------------------------------------------
          Richard Williams, Notre Dame Dept of Sociology
          StataNow Version: 19.5 MP (2 processor)

          EMAIL: [email protected]
          WWW: https://www3.nd.edu/~rwilliam

          Comment


          • #6
            Hi Noam

            With regards to #1, it seems the first part of the query (also taking into consideration the information in #3, stating that Yvar is continuous) would be, fundamentally, a linear regression model.

            On the other side, when it is lately remarked that Yvar shall be "the chances to succeed" under a given treatment, well, under this situation I gather we'd need to call for a logistic model.

            The FAQ recommendations apply perfectly to this scenario: in order to get further advice, I kindly suggest you to present a brief display of the data as well as a summary description of the variables to be included in the model.

            Best,

            Marcos
            Best regards,

            Marcos

            Comment


            • #7
              Hello All
              first, I want to thank you all for your efforts and kind help.
              I think I will need to explain myself better and also will upload soon some of the data and variables that I am using.
              basically, I have 4 treatment programs that have been found to be effective already when compared treatment and control (after I used psmatch2).
              The evaluated programs are: education, vocation, domestic violence and work release.
              now I want to focus only in the prisoners in the treatment groups and leave the control groups out.
              My purpose is to see how the effects of the variables (age, substance abuse, prior incarcerations, prior arrests, type of offense, years of education, number of children, family status etc.) on recidivism (Yvar is continuous) varries depending on the type of the program. for example: if you are an old prisoner you might succeed in the vocation program but will probably fail in the education program.
              I need to see if there are statistically significant difference between those effects.
              I agree with Richard that interaction effects might be considered in this case but the problem becomes that this is just a too complicated equation: 4 treatment programs and about 12 vars that I need to compre between each program to another.
              I am looking for an easy and elegant way to do that.

              Thank you very much
              I really appericiate your efforts.

              all the best
              Noam

              Comment


              • #8
                Noam.
                thanks for providing further details.
                The main issue here is the way you want to approach your research goal.
                I would go for a regression with factorized education programmes (i.e., -i.programme-; please see -help fvvarlist-) and control variables.
                What you're expected to get that way is the effect on -depvar- procduced by each programme when adjusted for the remaining predictor.
                As I do not see your data, I cannot say whether or not they already are in the proper format for such a regression (-long- vs -wide-; please, see -reshape- in case of need).
                As far as interactions (and, in general terms, the whole regression model) are concerned, it is usually wise to skim through the existing literature of your research field and see what Others did in the past when presented with the very same research topic.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #9
                  Carlo
                  Thank you very much
                  It helps alot
                  I will read about fvvarlist and also will check if I need to reshape the format of the vars
                  after I will read more I will ask more questions if needed
                  thank you a lot
                  Cheers
                  Noam

                  Comment


                  • #10
                    Hello again
                    After a long thinking, I found the command of suest that can check whether there are differences of the effects of vars on the depvar wen comparing between models. as you can see in the attached file.
                    My question now is - is there a way to run this command with Cox regression.

                    Thanks alot
                    Noam


                    Attached Files

                    Comment


                    • #11
                      Noam:
                      usually is -estat ic- the -stcox postestimation- tool used for what you'e after.
                      Kind regards,
                      Carlo
                      (Stata 19.0)

                      Comment


                      • #12
                        Thank you very much fot your quick answer and great help
                        I will try it
                        Noam

                        Comment


                        • #13
                          Do you think you can try and tell me what am i doing wrong here
                          attach my do file and results
                          Thank you again
                          Noam
                          Attached Files

                          Comment


                          • #14
                            So, I think I succeeded, but now I just do not understand the results.
                            How can I know if the effect of the vars on the depvar varies between the models?
                            Thank you
                            Attached Files

                            Comment


                            • #15
                              Noam:
                              with -estat ic- you can compare the whole models, not the predictors
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X