Announcement

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

  • Regression models with T-test scores

    Hi,

    Please, I need some help on how to obtain the T - test scores from the analysis below. Any commands that would enable me to conduct the following analysis is appreciated. My little understanding of the tables below is that the author conducted a multivariate logistic regression for two set of groups, i.e. Indp variable depvar1 depvar2 depvar3 ... if var == Aboriginal, and Indp variable depvar1 depvar2 depvar3 ... if var == Non-Aboriginal . I observe that all the independent and dependent variables for the two models are the same and the author was able to obtain T-test scores through which odds ratios across the regression models for both groups were compared.
    Click image for larger version

Name:	Logistic regression 1 (2).jpg
Views:	2
Size:	78.5 KB
ID:	1426774



    Please, any commands that would enable me to conduct this analysis is appreciated.

    Thank you.

    Emeka Dim.

  • #2
    Hello Emeka. Judging from that table, I'd guess that two (or more) separate logistic regression models were estimated, one for Aboriginal subjects (n=91) and the other for non-Aboriginal subjects (n=5699). I can't tell from that table whether one multivariable model was estimated for each sample (i.e., all explanatory variables in the same model), or whether a series of univariable (i.e., single explanatory variable) models were estimated for each sample. Do you have the full text, or just the table? If the former, what exactly does the surrounding text say? Finally, note that if a single multivariable model was estimated for the sample with n=91, it has been quite severely over-fitted (given a rule of thumb of 15 or so events-per-variable). (See this nice article by Mike Babyak for more info about over-fitting.)

    The tests on coefficients in logistic regression are typically shown as z- or Wald (Chi-square) tests, not as t-tests. Therefore, I would hazard a guess that the t-column in this table is showing the result of an ordinary (unparied) t-test comparing the two samples on the variable in that row. What does the surrounding text say? If this is what is being done, note that comparing the groups on individual indicator variables for a multiple-df categorical variable is not the usual way of comparing the groups on categorical variables--one would typically use a Chi-square test instead.

    HTH.
    --
    Bruce Weaver
    Email: [email protected]
    Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
    Version: Stata/MP 18.0 (Windows)

    Comment


    • #3
      Thank you for the feedback.

      This is how the author described the data analysis:
      The first involved direct logistic regressions with all of the predictor variables. These analyses allowed examination of the operation of each independent variable in the prediction of violent victimisation for Aboriginal and non-Aboriginal men holding constant the effects of all other variables in the model. The t-tests were used to compare odds ratios across these regressions.

      You can also check the analysis from the article, which is attached to this post (See Pages 228 and 229, also see table 5 on page 232). My intention is to replicate this study with a more recent data. The data used here was for 1999 and the one I intend to use is for 2014. I also intend to add more variables.

      I also need help for the commands used in conducting the sequential logistic regression analysis (see Table 6). I have searched online (including YouTube) on how this can be done and I could not find any help so far.

      Thank you and looking forward to your reply.

      Emeka.
      Attached Files

      Comment


      • #4
        Thanks for clarifying, Emeka. I don't know why the author is describing those tests as t-tests. The usual test for comparing two independent parameters in logistic regression is a z-test. But given the sample sizes, the critical t will be nearly the same as the critical z anyway. So if the actual test statistics were computed correctly, the results will be pretty good. But it's impossible to tell whether the tests were done properly, because the author has not reported the needed standard errors.

        IMO, a better way to compare the coefficients for Aboriginal & non-Aboriginal samples would be to include an indicator for Aboriginal stats in that model, and interact it with each of the other variables. The z-tests for those product terms would give the desired tests.

        To perform sequential regression (or hierarchical regression, as I would call it), see help nestreg.

        HTH.
        --
        Bruce Weaver
        Email: [email protected]
        Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
        Version: Stata/MP 18.0 (Windows)

        Comment


        • #5
          Thanks for the reply.

          For the model comparisons, I ran the following commands:
          . logistic PhyVio V024 V102 V012 Religion1 Witness FamVio1 Alcohol Perp [pweight = V005] if V501 == 1
          . estimates store a
          . logistic PhyVio V024 V102 V012 Religion1 Witness FamVio1 Alcohol Perp [pweight = V005] if V501 == 2
          . lrdrop1


          And the following output showed:
          (For the first group)
          Robust
          PhyVio Odds Ratio Std. Err. z P>z [95% Conf. Interval]
          V024 .9462769 .0178324 -2.93 0.003 .9119636 .9818812
          V102 1.039778 .058962 0.69 0.492 .9304047 1.162008
          V012 1.001802 .0030547 0.59 0.555 .9958332 1.007807
          Religion1 1.601105 .10403 7.24 0.000 1.409659 1.818552
          Witness 2.178277 .1707014 9.93 0.000 1.868135 2.539907
          FamVio1 2.681923 .1967103 13.45 0.000 2.322809 3.096558
          Alcohol 2.821958 .1975984 14.82 0.000 2.460073 3.237078
          Perp 15.38909 2.964672 14.19 0.000 10.54948 22.44889
          _cons .0784537 .0119665 -16.69 0.000 .0581808 .1057905
          (For the second group):
          Robust
          PhyVio Odds Ratio Std. Err. z P>z [95% Conf. Interval]
          V024 1.04979 .1167778 0.44 0.662 .8441416 1.305537
          V102 .8478312 .1835618 -0.76 0.446 .5546486 1.295988
          V012 .9424616 .0138781 -4.02 0.000 .9156499 .9700584
          Religion1 1.448851 .5849441 0.92 0.358 .6567019 3.196532
          Witness 1.201445 .311141 0.71 0.479 .7232131 1.995913
          FamVio1 1.371174 .3102887 1.39 0.163 .8799759 2.136558
          Alcohol 1.76137 .3898985 2.56 0.011 1.141374 2.71815
          Perp 6.626917 4.476362 2.80 0.005 1.763357 24.90478
          _cons 1.161785 1.035935 0.17 0.866 .2023626 6.669932
          . . lrdrop1
          Likelihood Ratio Tests: drop 1 term
          logistic regression
          number of obs = 652
          PhyVio Df Chi2 P>Chi2 -2*log ll Res. Df AIC
          Original Model 738.68 (-2logII) 643 ( Res df) 756.68 (AIC)
          -V024 1 2.34 0.1257 741.03 642 757.03
          -V102 1 0.01 0.9322 738.69 642 754.69
          -V012 1 14.90 0.0001 753.58 642 769.58
          -Religion1 1 0.47 0.4951 739.15 642 755.15
          -Witness 1 4.49 0.0341 743.17 642 759.17
          -FamVio1 1 4.11 0.0427 742.79 642 758.79
          -Alcohol 1 11.33 0.0008 750.01 642 766.01
          -Perp 1 13.15 0.0003 751.83 642 767.83
          Terms dropped one at a time in turn.

          I found out that the command used in generating the results does not accept factor variables, which would have enabled me see the relationships in similar independent variables (against the dependent variables) across the two groups.

          I also checked the "help nestreg" and I found out that it directed me to the nested logistic regression commands. I tried the following commands on another dataset I am working on:

          nestreg: logistic PhyVio (Emp V190 Earn V106) (V024 V102 V012 Religion1) (Witness FamVio1 Alcohol) (Perp) [weight = V005] if V501 == 1


          And I also got this table at the end of the output:
          +-----------------------------------+
          Block Wald chi2 df Pr > F
          -------+---------------------------
          1 9.91e+07 4 0.0000
          2 3.78e+08 4 0.0000
          3 6.87e+08 3 0.0000
          4 1.75e+08 1 0.0000
          +-----------------------------------+
          However, I am bothered that the " nestreg " commands usually do not allow for survey weights in cases were "lr" is added, which is very important for the dataset I am analyzing. For example:

          nestreg, lr: logistic PhyVio (Emp V190 Earn V106) (V024 V102 V012 Religion1) (Witness FamVio1 Alcohol) (Perp) if V501 == 1

          This command provided the following table at the end of the output:
          +----------------------------------------------------------------+
          Block LL LR df Pr > LR AIC BIC
          -------+--------------------------------------------------------
          1 -5095.851 48.35 4 0.0000 10201.7 10238.57
          2 -4922.469 346.76 4 0.0000 9862.938 9929.3
          3 -4558.832 727.27 3 0.0000 9141.663 9230.146
          4 -4428.001 261.66 1 0.0000 8882.001 8977.858
          +----------------------------------------------------------------+
          and

          . estatgof

          Logistic model for PhyVio, goodness-of-fit test

          number of observations = 11773
          number of covariate patterns = 6853
          Pearson chi2(6840) = 7810.21
          Prob > chi2 = 0.0000


          I can also show you the blocks that preceded these tables. Also, please are there differences between nested, hierarchical, and stepwise logistic regression analyses?

          Please, what do you suggest? From what I have so far, I am not so confident that I have been able to replicate the results of the Table 6 of the article I showed you, which is my main aim.

          Thanks.

          Emeka Dim.
          Last edited by Emeka Dim; 22 Jan 2018, 01:47.

          Comment


          • #6
            Hello Emeka. I was not familiar with ldrop1. I assume, based on what I read below, that it generates a table of likelihood ratio tests corresponding to the Wald tests one sees in the logistic regression output.

            Code:
            . net describe lrdrop1, from(http://fmwww.bc.edu/RePEc/bocode/l)
            
            --------------------------------------------------------------------------------------------------
            package lrdrop1 from http://fmwww.bc.edu/RePEc/bocode/l
            --------------------------------------------------------------------------------------------------
            
            TITLE
                  'LRDROP1': module to calculate likelihood-ratio test after dropping one term
            
            DESCRIPTION/AUTHOR(S)
                  
                  lrdrop1 performs likelihood-ratio tests by dropping a term for
                  maximum  likelihood models such as those estimated by stcox,
                  logit, logistic,  poisson and streg.
                  
                  Author:  Zhiqiang Wang, Menzies School of Health Research
                  Support: email [email protected]
                  
                  Distribution-Date: 19991210
            
            INSTALLATION FILES                              (type net install lrdrop1)
                  lrdrop1.ado
                  lrdrop1.hlp
            --------------------------------------------------------------------------------------------------
            You've asked a lot of questions in your last post--probably more than can be dealt with easily via this type of forum. If you are located at a university, I suggest that you try to find someone local to help you.

            One final comment: Based on the article you attached earlier, I believe the original author was using the svy: prefix (or its equivalent if using other software). Are you doing that too? I did not see it in the code you posted.

            HTH.

            --
            Bruce Weaver
            Email: [email protected]
            Web: http://sites.google.com/a/lakeheadu.ca/bweaver/
            Version: Stata/MP 18.0 (Windows)

            Comment


            • #7
              Thanks for the assistance so far.

              I has been very difficult for me to find any person knowledgeable about these analyses and you have been of great help to me so far.

              I did not use the svy code for the other dataset I am using. However, for the study I intend to replicate, I will be using the `svy' command. I was wondering if the lrdrop1 is able to compare the odds ratio of two seperate models, just like what the author did. In was trying to say in my last comment that the "nestreg" command you recommended looks like a nested logistic regression analysis which hardly incorporates weights if the "lr" command was added. Is the nested logistic regression the same as a hierarchical logistic regression?

              Comment

              Working...
              X