Announcement

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

  • Power analysis with Categorical Independent variable and Binary Outcomes help

    I am using stata and I think the right command is "powercal." It takes 4 variables and calculates a 5th. they are the sample size, power, alpha (0.8), delta (meaningful difference), and standard deviation. I am trying to caluclate power of my study with n=40 surgical patients and 5 categories (surgical site) in my independent variable. But since my outcomes (complications) are just "yes" or "no" how do I define delta? background: this is a surgical study, independent variable is where we did the surgery (arm, leg, ect). dependent is y/n presence of wound healing complications. I am using logistic regression (logistic) and would like to do a power analysis to make sure our findings of no difference in complications depending on surgical site is true or just due to small sample size. Do I use the odds ratios from my logistic regression for delta or something?

  • #2
    This is what I have been playing with:

    locationgroup is the surgical site. whc is wound healing complications.



    summarize ageatoperation bmikgm2

    Variable | Obs Mean Std. Dev. Min Max
    -------------+--------------------------------------------------------
    ageatopera~n | 40 54.4 15.68243 26 94
    bmikgm2 | 40 30.2415 6.444009 20.8 53.5

    . tab locationgroup

    Location |
    Group | Freq. Percent Cum.
    ------------+-----------------------------------
    1 | 8 20.00 20.00
    2 | 11 27.50 47.50
    3 | 4 10.00 57.50
    4 | 17 42.50 100.00
    ------------+-----------------------------------
    Total | 40 100.00

    . tab whc

    WHC | Freq. Percent Cum.
    ------------+-----------------------------------
    0 | 27 67.50 67.50
    1 | 13 32.50 100.00
    ------------+-----------------------------------
    Total | 40 100.00

    . tab whc locationgroup

    | Location Group
    WHC | 1 2 3 4 | Total
    -----------+--------------------------------------------+----------
    0 | 5 10 3 9 | 27
    1 | 3 1 1 8 | 13
    -----------+--------------------------------------------+----------
    Total | 8 11 4 17 | 40


    . logit whc ageatoperation bmikgm2 i.locationgroup

    Iteration 0: log likelihood = -25.223241
    Iteration 1: log likelihood = -22.11904
    Iteration 2: log likelihood = -21.970601
    Iteration 3: log likelihood = -21.969743
    Iteration 4: log likelihood = -21.969743

    Logistic regression Number of obs = 40
    LR chi2(5) = 6.51
    Prob > chi2 = 0.2600
    Log likelihood = -21.969743 Pseudo R2 = 0.1290

    --------------------------------------------------------------------------------
    whc | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    ageatoperation | .0168503 .0236308 0.71 0.476 -.0294652 .0631658
    bmikgm2 | .057588 .0622451 0.93 0.355 -.0644101 .179586
    |
    locationgroup |
    2 | -2.119003 1.366914 -1.55 0.121 -4.798105 .5600992
    3 | -.2899529 1.415507 -0.20 0.838 -3.064296 2.48439
    4 | .3354671 .8925478 0.38 0.707 -1.413894 2.084829
    |
    _cons | -3.116928 2.42583 -1.28 0.199 -7.871467 1.637611
    --------------------------------------------------------------------------------

    . margins locationgroup

    Predictive margins Number of obs = 40
    Model VCE : OIM

    Expression : Pr(whc), predict()

    -------------------------------------------------------------------------------
    | Delta-method
    | Margin Std. Err. z P>|z| [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    locationgroup |
    1 | .391054 .1685024 2.32 0.020 .0607953 .7213127
    2 | .0769216 .0757145 1.02 0.310 -.0714761 .2253192
    3 | .3275266 .2560628 1.28 0.201 -.1743472 .8294004
    4 | .4692803 .1199323 3.91 0.000 .2342174 .7043432
    -------------------------------------------------------------------------------

    . graph display Graph

    . graph drop Graph

    . margins locationgroup, at( ageatoperation=generate(26(1)94))
    unknown function 26()
    r(133);

    . margins locationgroup

    Predictive margins Number of obs = 40
    Model VCE : OIM

    Expression : Pr(whc), predict()

    -------------------------------------------------------------------------------
    | Delta-method
    | Margin Std. Err. z P>|z| [95% Conf. Interval]
    --------------+----------------------------------------------------------------
    locationgroup |
    1 | .391054 .1685024 2.32 0.020 .0607953 .7213127
    2 | .0769216 .0757145 1.02 0.310 -.0714761 .2253192
    3 | .3275266 .2560628 1.28 0.201 -.1743472 .8294004
    4 | .4692803 .1199323 3.91 0.000 .2342174 .7043432
    -------------------------------------------------------------------------------

    marginsplot

    Variables that uniquely identify margins: locationgroup

    logistic whc ageatoperation

    Logistic regression Number of obs = 40
    LR chi2(1) = 0.79
    Prob > chi2 = 0.3746
    Log likelihood = -24.829132 Pseudo R2 = 0.0156

    --------------------------------------------------------------------------------
    whc | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
    ageatoperation | 1.01957 .022442 0.88 0.379 .97652 1.064518
    _cons | .165272 .2109791 -1.41 0.158 .0135392 2.017468
    --------------------------------------------------------------------------------


    . powercal powerage, n(40) a(0.05) d(0.008417) s(15.68)
    Result to be calculated is power in variable: powerage


    and my power is 0.02519908

    Comment


    • #3
      Please read FAQ 12 and present code and results between CODE delimiters. And you are also asked to give the author and source of unofficial commands. powercal, by Roger Newson, is available at SSC.


      The test of category differences after logistic or any other single outcome regression command is:
      Code:
      mtest i.locationgroup.1 = i.locationgroup.2 = i.locationgroup.3 = i.locationgroup.4, mtest(sidak)
      (See example below. The mtest() option is needed to correct for multiple tests of pairwise differences)

      The overall test is the "all" test Example, which will have 3 degrees of freedom for the null hypothesis of no difference between the four groups. . This is analogous to the F test in a four-group ANOVA. You have done the calculation for a one parameter test of the effect of a different variable. Power calculations for the overall 3 d.f. test require 1) that you guess response proportions in each category: and 2) that you form what is known as the non-centrality parameter. However this second calculation requires expert knowledge. I suggest that you do the power calculations for each of the pairs of categories (1 vs 2, 1 vs 3, 1 vs 4, 2 vs 3, 2 vs 4, 3 vs 4. It's probably easier to use Stata's power twoprop than it is use powercal. If you have continuous covariates, then estimate proportions at the covariate means


      However, since you've already done this analysis, then a post-hoc calculation can be misleading. Just to state one paradox: if you find that one of the pairwise calculations (say \(p_1\) and \(p_4)\) is significant at p=0.05 (with or without correction for multiple tests), it will turn out that the pre-study power of detecting the observed difference was about 50%. Instead of such a post-hoc test, I recommend that you examine confidence intervals.



      Code:
      sysuse auto, clear
      recode rep78 1/2=5
      logistic foreign i.rep78 turn
      test 3.rep78 =4.rep78=5.rep78, mtest(sidak)
      with results
      Code:
      . logistic foreign i.rep78 turn
      
      Logistic regression                             Number of obs     =         69
                                                      LR chi2(3)        =      47.27
                                                      Prob > chi2       =     0.0000
      Log likelihood = -18.767412                     Pseudo R2         =     0.5574
      
      ------------------------------------------------------------------------------
           foreign | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
      -------------+----------------------------------------------------------------
             rep78 |
                4  |    9.93192   11.37761     2.00   0.045     1.051794    93.78554
                5  |   8.681175   9.171395     2.05   0.041     1.094738    68.84094
                   |
              turn |   .5438822    .085999    -3.85   0.000     .3989444    .7414764
             _cons |   1.07e+09   6.09e+09     3.64   0.000     14683.46    7.75e+13
      ------------------------------------------------------------------------------
      
      . test 3.rep78 =4.rep78=5.rep78, mtest(sidak)
      
       ( 1)  [foreign]3b.rep78 - [foreign]4.rep78 = 0
       ( 2)  [foreign]3b.rep78 - [foreign]5.rep78 = 0
      
      ---------------------------------------
             |        chi2     df       p
      -------+-------------------------------
        (1)  |        4.02      1     0.0881 #
        (2)  |        4.18      1     0.0799 #
      -------+-------------------------------
        all  |        5.13      2     0.0770
      ---------------------------------------
                    # Sidak-adjusted p-values
      Steve Samuels
      Statistical Consulting
      [email protected]

      Stata 14.2

      Comment


      • #4
        Hey there,

        Sorry for my breech of etiquette, I have since read the FAQ's. As a new guy, I appreciate the guidance and am trying to correct format here for the first time (I hope it works).

        I really appreciate your help. I have been struggling with this for over a week now. I will use the confidence intervals as shown in the example picture. Here is how I got it:

        Input Code:
        Code:
        logistic whc i.locationgrouplogistic whc i.locationgroup
        test 1.locationgroup = 2.locationgroup = 3.locationgroup = 4.locationgroup, mtest(sidak)
        margins locationgroup
        marginsplot, xdimension(locationgroup)
        Results Code:
        Code:
        Logistic regression            Number of obs   =    40
                    LR chi2(3)      =    5.15
                    Prob > chi2     =    0.1610
        Log likelihood = -22.646917            Pseudo R2       =    0.1021
        
                        
        whc  Odds Ratio    Std. Err.    z    P>z     [95% Conf.    Interval]
                        
        locationgroup 
        2     .1666667    .2130032    -1.40    0.161     .0136143    2.040332
        3     .5555556    .7590334    -0.43    0.667     .0381737    8.085189
        4     1.481481    1.299526    0.45    0.654     .2654846    8.267097
                      
        _cons          .6    .438178    -0.70    0.484     .1433909    2.51062
                        
        
        ( 1)    [whc]1b.locationgroup -    [whc]2.locationgroup    =    0
        ( 2)    [whc]1b.locationgroup -    [whc]3.locationgroup    =    0
        ( 3)    [whc]1b.locationgroup -    [whc]4.locationgroup    =    0
        
                
            chi2     df    p
                
        (1)    1.97      1    0.4092 #
        (2)    0.19      1    0.9631 #
        (3)    0.20      1    0.9586 #
                
        all    3.81      3    0.2826
                
            # Sidak-adjusted    p-values
        
        Adjusted predictions        Number    of obs   =    40
        Model VCE    : OIM
        
        Expression   : Pr(whc), predict()
        
                        
        Delta-method
        Margin   Std. Err.    z    P>z    [95% Conf.    Interval]
                        
        locationgroup 
        1         .375   .1711633    2.19    0.028    .0395261    .7104739
        2     .0909091   .0866784    1.05    0.294    -.0789775    .2607957
        3          .25   .2165064    1.15    0.248    -.1743447    .6743447
        4     .4705882   .1210578    3.89    0.000    .2333193    .7078572
                        
         Variables that uniquely identify margins: locationgroup
        On another note, I am a student in Albany. What are the odds? No wait, no need to answer that, it is just an expression. No more stats questions from me for a while. Thanks again.

        Comment


        • #5
          Glad it helped. Unfortunately there' s no evidence of a difference in proportions. Since you have no other covariates, the marginal proportions should be the same as the crude proportions, which I don't think you've shown:

          Code:
          proportion wbc, over(locationgroup)
          Note that the confidence interval endpoints for margins extend beyond the [0,1] bounds for a proportion. You can get CIs without this problem as follows: Download transform_margins by Jeff PItblado ("findit transform_margins") and install. Then run:

          Code:
          logit wbc i.locationgroup, vce(robust)
          margins locationgroup, predict(xb)
          transform_margins invlogit(xb)
          Steve Samuels
          Statistical Consulting
          [email protected]

          Stata 14.2

          Comment


          • #6
            Correction: the transform_margins command is:
            Code:
            transform_margins invlogit(@)
            Steve Samuels
            Statistical Consulting
            [email protected]

            Stata 14.2

            Comment


            • #7
              Hello again,

              At the risk of looking like a toddler, I included all the tests I ran after reading your first message. I had to break the results up into multiple posts due to the character limit. No evidence of a difference in proportions is not unfortunate. We are trying to show that this flap can be used anywhere on the body without increased risk for WHC or SSI, so I was hoping for no difference. We do have other covariates of interest, but I was trying to keep my question simple. We are looking at patient Age, BMI, Surgical Site, and Flap size (Flap size as a categorical variable; 1-50 cm^2 = small, 51-100 cm^2=medium, etc.) I also have data for comorbidities (like Smoker/nonsmoker) that I was going to just test for relationship with WHC.SSI using Chi^2. Graphs are linked (the website only lets me post 5). For the SSI (Surgical Site Infection), they are divided up into Major(1 event) and minor (3 events). I think I got an error here due to lack of events so switched to Fischer's Exact or Chi^2. Major and Minor wound healing complications (WHC) are still being defined and I will have to do the stats after we finish the chart review. So I still need to go back and do the transform_margins invlogit@ command by Jeff PItblado.

              Input:
              Code:
              logistic whc ageatoperation
              test ageatoperation , mtest(sidak)
              margins, at( ageatoperation=(20(10)90))
              marginsplot, xdimension(at(ageatoperation))
              logistic ssi ageatoperation
              margins, at( ageatoperation=(20(10)90))
              marginsplot, xdimension(at(ageatoperation))
              logistic ssimn ageatoperation
              test ageatoperation , mtest(sidak)
              margins, at( ageatoperation=(20(10)90))
              marginsplot, xdimension(at(ageatoperation))
              logistic ssimj ageatoperation
               test ageatoperation , mtest(sidak)
              margins, at( ageatoperation=(20(10)90))
              marginsplot, xdimension(at(ageatoperation))
              logistic whc bmikgm2
              test bmikgm2 , mtest(sidak)
              margins, at( bmikgm2 =(20(5)50))
              marginsplot, xdimension(bmikgm2 )
              logistic ssi bmikgm2
              test bmikgm2 , mtest(sidak)
              margins, at( bmikgm2 =(20(5)55))
              marginsplot, xdimension(bmikgm2 )
              logistic ssimn bmikgm2
              test bmikgm2 , mtest(sidak)
              margins, at( bmikgm2 =(20(5)55))
              marginsplot, xdimension(bmikgm2 )
              logistic ssimj bmikgm2
              test bmikgm2 , mtest(sidak)
              margins, at( bmikgm2 =(20(5)55))
              logistic whc i.locationgroup
              *To Be Continued
              test 1.locationgroup = 2.locationgroup = 3.locationgroup = 4.locationgroup, mtest(sidak)
              margins locationgroup
              marginsplot, xdimension(locationgroup)
              logistic ssi i.locationgroup
              tabulate locationgroup ssi, exact
              margins locationgroup
              tabulate locationgroup ssimn, exact
              logistic ssimn i.locationgroup
              margins locationgroup
              marginsplot, xdimension(locationgroup)
              *I know there is only one variable. I did this graph for completeness I guess.
              logistic ssimj i.locationgroup
              margins locationgroup
              marginsplot, xdimension(locationgroup)
              logistic whc i.flapsizegroup
              tabulate flapsizegroup whc, exact
              tabulate flapsizegroup whc, chi2
              margins flapsizegroup
              marginsplot, xdimension(flapsizegroup)
              logistic ssi i.flapsizegroup
              tabulate flapsizegroup ssi, exact
              margins flapsizegroup
              marginsplot, xdimension(flapsizegroup)
              logistic ssimn i.flapsizegroup
              tabulate flapsizegroup ssimn, exact
              margins flapsizegroup
              marginsplot, xdimension(flapsizegroup)
              logistic ssimj i.flapsizegroup
              tabulate flapsizegroup ssimj, exact
              margins flapsizegroup
              marginsplot, xdimension(flapsizegroup)
              I repeat this


              Output:
              Code:
              . logistic whc ageatoperation
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.79
                                                                Prob > chi2     =     0.3746
              Log likelihood = -24.829132                       Pseudo R2       =     0.0156
              
              --------------------------------------------------------------------------------
                         whc | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
              ageatoperation |    1.01957    .022442     0.88   0.379       .97652    1.064518
                       _cons |    .165272   .2109791    -1.41   0.158     .0135392    2.017468
              --------------------------------------------------------------------------------
              
              . test ageatoperation , mtest(sidak)
              
               ( 1)  [whc]ageatoperation = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.78      1     0.3786 #
              -------+-------------------------------
                all  |        0.78      1     0.3786
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( ageatoperation=(20(10)90))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(whc), predict()
              
              1._at        : ageatopera~n    =          20
              
              2._at        : ageatopera~n    =          30
              
              3._at        : ageatopera~n    =          40
              
              4._at        : ageatopera~n    =          50
              
              5._at        : ageatopera~n    =          60
              
              6._at        : ageatopera~n    =          70
              
              7._at        : ageatopera~n    =          80
              
              8._at        : ageatopera~n    =          90
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |   .1958334   .1354984     1.45   0.148    -.0697385    .4614053
                        2  |   .2281598   .1169441     1.95   0.051    -.0010465     .457366
                        3  |   .2640699   .0949227     2.78   0.005     .0780248     .450115
                        4  |   .3034103   .0770983     3.94   0.000     .1523003    .4545202
                        5  |   .3458571   .0798143     4.33   0.000     .1894239    .5022902
                        6  |   .3909097   .1098219     3.56   0.000     .1756627    .6061567
                        7  |   .4379024   .1552722     2.82   0.005     .1335744    .7422304
                        8  |   .4860364   .2059972     2.36   0.018     .0822893    .8897834
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(at(ageatoperation))
              
                Variables that uniquely identify margins: ageatoperation
              
              . logistic ssi ageatoperation
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.00
                                                                Prob > chi2     =     0.9565
              Log likelihood = -13.001832                       Pseudo R2       =     0.0001
              
              --------------------------------------------------------------------------------
                         ssi | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
              ageatoperation |   .9981398   .0341298    -0.05   0.957     .9334388    1.067325
                       _cons |   .1229147   .2361982    -1.09   0.275     .0028438    5.312637
              --------------------------------------------------------------------------------
              
              . margins, at( ageatoperation=(20(10)90))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(ssi), predict()
              
              1._at        : ageatopera~n    =          20
              
              2._at        : ageatopera~n    =          30
              
              3._at        : ageatopera~n    =          40
              
              4._at        : ageatopera~n    =          50
              
              5._at        : ageatopera~n    =          60
              
              6._at        : ageatopera~n    =          70
              
              7._at        : ageatopera~n    =          80
              
              8._at        : ageatopera~n    =          90
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |   .1058828   .1209755     0.88   0.381    -.1312248    .3429903
                        2  |   .1041329   .0911052     1.14   0.253    -.0744299    .2826957
                        3  |   .1024086   .0655419     1.56   0.118    -.0260512    .2308685
                        4  |   .1007097   .0493504     2.04   0.041     .0039847    .1974347
                        5  |   .0990359   .0504175     1.96   0.049     .0002193    .1978524
                        6  |   .0973868   .0666825     1.46   0.144    -.0333085    .2280821
                        7  |   .0957623   .0893827     1.07   0.284    -.0794245    .2709492
                        8  |   .0941621   .1140975     0.83   0.409    -.1294649    .3177891
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(at(ageatoperation))
              
                Variables that uniquely identify margins: ageatoperation
              
              . logistic ssimn ageatoperation
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.32
                                                                Prob > chi2     =     0.5737
              Log likelihood = -10.497152                       Pseudo R2       =     0.0148
              
              --------------------------------------------------------------------------------
                       ssimn | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
              ageatoperation |   .9774102   .0407941    -0.55   0.584     .9006381    1.060726
                       _cons |   .2670126    .580296    -0.61   0.543     .0037725    18.89905
              --------------------------------------------------------------------------------
              
              . test ageatoperation , mtest(sidak)
              
               ( 1)  [ssimn]ageatoperation = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.30      1     0.5841 #
              -------+-------------------------------
                all  |        0.30      1     0.5841
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( ageatoperation=(20(10)90))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(ssimn), predict()
              
              1._at        : ageatopera~n    =          20
              
              2._at        : ageatopera~n    =          30
              
              3._at        : ageatopera~n    =          40
              
              4._at        : ageatopera~n    =          50
              
              5._at        : ageatopera~n    =          60
              
              6._at        : ageatopera~n    =          70
              
              7._at        : ageatopera~n    =          80
              
              8._at        : ageatopera~n    =          90
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |   .1446199   .1720353     0.84   0.401     -.192563    .4818028
                        2  |   .1185822    .107713     1.10   0.271    -.0925314    .3296958
                        3  |   .0967023   .0640958     1.51   0.131    -.0289231    .2223277
                        4  |   .0785001   .0435961     1.80   0.072    -.0069468    .1639469
                        5  |   .0634832   .0435432     1.46   0.145      -.02186    .1488264
                        6  |   .0511795   .0499483     1.02   0.306    -.0467173    .1490763
                        7  |   .0411556   .0547932     0.75   0.453    -.0662371    .1485482
                        8  |   .0330266   .0566475     0.58   0.560    -.0780005    .1440536
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(at(ageatoperation))
              
                Variables that uniquely identify margins: ageatoperation
              
              . logistic ssimj ageatoperation
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.63
                                                                Prob > chi2     =     0.4262
              Log likelihood = -4.3597458                       Pseudo R2       =     0.0677
              
              --------------------------------------------------------------------------------
                       ssimj | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
              ageatoperation |   1.050554   .0650702     0.80   0.426     .9304559    1.186153
                       _cons |   .0013069   .0055416    -1.57   0.117     3.21e-07    5.316385
              --------------------------------------------------------------------------------
              
              . test ageatoperation , mtest(sidak)
              
               ( 1)  [ssimj]ageatoperation = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.63      1     0.4259 #
              -------+-------------------------------
                all  |        0.63      1     0.4259
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( ageatoperation=(20(10)90))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(ssimj), predict()
              
              1._at        : ageatopera~n    =          20
              
              2._at        : ageatopera~n    =          30
              
              3._at        : ageatopera~n    =          40
              
              4._at        : ageatopera~n    =          50
              
              5._at        : ageatopera~n    =          60
              
              6._at        : ageatopera~n    =          70
              
              7._at        : ageatopera~n    =          80
              
              8._at        : ageatopera~n    =          90
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |    .003492   .0106235     0.33   0.742    -.0173296    .0243137
                        2  |   .0057055   .0140579     0.41   0.685    -.0218474    .0332584
                        3  |   .0093089   .0178081     0.52   0.601    -.0255942    .0442121
                        4  |   .0151535    .021544     0.70   0.482     -.027072     .057379
                        5  |   .0245766   .0263317     0.93   0.351    -.0270327    .0761858
                        6  |   .0396234   .0398444     0.99   0.320    -.0384701     .117717
                        7  |    .063285   .0784977     0.81   0.420    -.0905677    .2171377
                        8  |   .0996108    .159884     0.62   0.533    -.2137561    .4129777
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(at(ageatoperation))
              
                Variables that uniquely identify margins: ageatoperation
              
              . logistic whc bmikgm2
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.09
                                                                Prob > chi2     =     0.7645
              Log likelihood = -25.178368                       Pseudo R2       =     0.0018
              
              ------------------------------------------------------------------------------
                       whc | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                   bmikgm2 |   1.015739   .0525884     0.30   0.763     .9177246    1.124221
                     _cons |   .2997612   .4831833    -0.75   0.455     .0127271    7.060282
              ------------------------------------------------------------------------------
              
              . test bmikgm2 , mtest(sidak)
              
               ( 1)  [whc]bmikgm2 = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.09      1     0.7629 #
              -------+-------------------------------
                all  |        0.09      1     0.7629
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( bmikgm2 =(20(5)50))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(whc), predict()
              
              1._at        : bmikgm2         =          20
              
              2._at        : bmikgm2         =          25
              
              3._at        : bmikgm2         =          30
              
              4._at        : bmikgm2         =          35
              
              5._at        : bmikgm2         =          40
              
              6._at        : bmikgm2         =          45
              
              7._at        : bmikgm2         =          50
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |    .290606   .1314325     2.21   0.027      .033003    .5482089
                        2  |   .3069619   .0936018     3.28   0.001     .1235057    .4904181
                        3  |   .3238182   .0741702     4.37   0.000     .1784472    .4691892
                        4  |   .3411445   .0926516     3.68   0.000     .1595506    .5227384
                        5  |   .3589058   .1378875     2.60   0.009     .0886512    .6291603
                        6  |   .3770626    .194027     1.94   0.052    -.0032234    .7573485
                        7  |   .3955711    .255239     1.55   0.121    -.1046881    .8958303
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(bmikgm2 )
              
                Variables that uniquely identify margins: bmikgm2
              
              . logistic ssi bmikgm2
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.27
                                                                Prob > chi2     =     0.6051
              Log likelihood = -12.869658                       Pseudo R2       =     0.0103
              
              ------------------------------------------------------------------------------
                       ssi | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                   bmikgm2 |   .9510494   .1004031    -0.48   0.634     .7732874    1.169675
                     _cons |   .4889687   1.514016    -0.23   0.817     .0011315    211.2979
              ------------------------------------------------------------------------------
              
              . test bmikgm2 , mtest(sidak)
              
               ( 1)  [ssi]bmikgm2 = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.23      1     0.6345 #
              -------+-------------------------------
                all  |        0.23      1     0.6345
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( bmikgm2 =(20(5)55))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(ssi), predict()
              
              1._at        : bmikgm2         =          20
              
              2._at        : bmikgm2         =          25
              
              3._at        : bmikgm2         =          30
              
              4._at        : bmikgm2         =          35
              
              5._at        : bmikgm2         =          40
              
              6._at        : bmikgm2         =          45
              
              7._at        : bmikgm2         =          50
              
              8._at        : bmikgm2         =          55
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |   .1519687   .1389244     1.09   0.274    -.1203182    .4242556
                        2  |   .1223685   .0719525     1.70   0.089    -.0186557    .2633928
                        3  |   .0978684   .0477881     2.05   0.041     .0042055    .1915313
                        4  |   .0778386   .0598107     1.30   0.193    -.0393882    .1950654
                        5  |    .061628   .0743497     0.83   0.407    -.0840947    .2073507
                        6  |   .0486155   .0823336     0.59   0.555    -.1127555    .2099864
                        7  |   .0382385   .0842003     0.45   0.650     -.126791    .2032681
                        8  |   .0300067   .0816653     0.37   0.713    -.1300544    .1900677
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(bmikgm2 )
              
                Variables that uniquely identify margins: bmikgm2
              
              . logistic ssimn bmikgm2
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.04
                                                                Prob > chi2     =     0.8350
              Log likelihood = -10.633672                       Pseudo R2       =     0.0020
              
              ------------------------------------------------------------------------------
                     ssimn | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                   bmikgm2 |   .9791328   .1027661    -0.20   0.841     .7970813    1.202764
                     _cons |   .1523166   .4816012    -0.60   0.552       .00031    74.83646
              ------------------------------------------------------------------------------
              
              . test bmikgm2 , mtest(sidak)
              
               ( 1)  [ssimn]bmikgm2 = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.04      1     0.8408 #
              -------+-------------------------------
                all  |        0.04      1     0.8408
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( bmikgm2 =(20(5)55))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(ssimn), predict()
              
              1._at        : bmikgm2         =          20
              
              2._at        : bmikgm2         =          25
              
              3._at        : bmikgm2         =          30
              
              4._at        : bmikgm2         =          35
              
              5._at        : bmikgm2         =          40
              
              6._at        : bmikgm2         =          45
              
              7._at        : bmikgm2         =          50
              
              8._at        : bmikgm2         =          55
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |    .090829   .0966936     0.94   0.348    -.0986869     .280345
                        2  |   .0824894   .0582077     1.42   0.156    -.0315955    .1965744
                        3  |   .0748525   .0417054     1.79   0.073    -.0068885    .1565935
                        4  |   .0678703   .0523492     1.30   0.195    -.0347322    .1704727
                        5  |   .0614961   .0720276     0.85   0.393    -.0796755    .2026676
                        6  |   .0556847   .0907908     0.61   0.540     -.122262    .2336314
                        7  |   .0503931   .1065266     0.47   0.636    -.1583952    .2591814
                        8  |     .04558   .1189828     0.38   0.702     -.187622    .2787821
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(bmikgm2 )
              
                Variables that uniquely identify margins: bmikgm2
              
              . logistic ssimj bmikgm2
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(1)      =       0.56
                                                                Prob > chi2     =     0.4544
              Log likelihood = -4.3964785                       Pseudo R2       =     0.0598
              
              ------------------------------------------------------------------------------
                     ssimj | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                   bmikgm2 |   .8167698   .2668607    -0.62   0.536     .4305159    1.549566
                     _cons |   7.413841   64.98746     0.23   0.819     2.56e-07    2.14e+08
              ------------------------------------------------------------------------------
              
              . test bmikgm2 , mtest(sidak)
              
               ( 1)  [ssimj]bmikgm2 = 0
              
              ---------------------------------------
                     |        chi2     df       p
              -------+-------------------------------
                (1)  |        0.38      1     0.5356 #
              -------+-------------------------------
                all  |        0.38      1     0.5356
              ---------------------------------------
                            # Sidak-adjusted p-values
              
              . margins, at( bmikgm2 =(20(5)55))
              
              Adjusted predictions                              Number of obs   =         40
              Model VCE    : OIM
              
              Expression   : Pr(ssimj), predict()
              
              1._at        : bmikgm2         =          20
              
              2._at        : bmikgm2         =          25
              
              3._at        : bmikgm2         =          30
              
              4._at        : bmikgm2         =          35
              
              5._at        : bmikgm2         =          40
              
              6._at        : bmikgm2         =          45
              
              7._at        : bmikgm2         =          50
              
              8._at        : bmikgm2         =          55
              
              ------------------------------------------------------------------------------
                           |            Delta-method
                           |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
              -------------+----------------------------------------------------------------
                       _at |
                        1  |   .1145981    .243437     0.47   0.638    -.3625297     .591726
                        2  |   .0449334   .0494864     0.91   0.364    -.0520582    .1419249
                        3  |   .0168139    .024746     0.68   0.497    -.0316873    .0653152
                        4  |   .0061779    .017889     0.35   0.730    -.0288839    .0412398
                        5  |   .0022545   .0100787     0.22   0.823    -.0174993    .0220083
                        6  |   .0008207   .0049878     0.16   0.869    -.0089553    .0105966
                        7  |   .0002985   .0022969     0.13   0.897    -.0042035    .0048004
                        8  |   .0001085   .0010112     0.11   0.915    -.0018734    .0020904
              ------------------------------------------------------------------------------
              
              . marginsplot, xdimension(bmikgm2 )
              
                Variables that uniquely identify margins: bmikgm2
              
              . logistic whc i.locationgroup
              
              Logistic regression                               Number of obs   =         40
                                                                LR chi2(3)      =       5.15
                                                                Prob > chi2     =     0.1610
              Log likelihood = -22.646917                       Pseudo R2       =     0.1021
              
              -------------------------------------------------------------------------------
                        whc | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
              --------------+----------------------------------------------------------------
              locationgroup |
                         2  |   .1666667   .2130032    -1.40   0.161     .0136143    2.040332
                         3  |   .5555556   .7590334    -0.43   0.667     .0381737    8.085189
                         4  |   1.481481   1.299526     0.45   0.654     .2654846    8.267097
                            |
                      _cons |         .6    .438178    -0.70   0.484     .1433909     2.51062
              -------------------------------------------------------------------------------
              
              *To Be Continued
              I hope my attempts at statistics didn't make you too upset. I'm still a beginner.

              Comment


              • #8
                Output Part 2:
                Code:
                 test 1.locationgroup = 2.locationgroup = 3.locationgroup = 4.locationgroup, mtest(sidak)
                
                 ( 1)  [whc]1b.locationgroup - [whc]2.locationgroup = 0
                 ( 2)  [whc]1b.locationgroup - [whc]3.locationgroup = 0
                 ( 3)  [whc]1b.locationgroup - [whc]4.locationgroup = 0
                
                ---------------------------------------
                       |        chi2     df       p
                -------+-------------------------------
                  (1)  |        1.97      1     0.4092 #
                  (2)  |        0.19      1     0.9631 #
                  (3)  |        0.20      1     0.9586 #
                -------+-------------------------------
                  all  |        3.81      3     0.2826
                ---------------------------------------
                              # Sidak-adjusted p-values
                
                . 
                . margins locationgroup
                
                Adjusted predictions                              Number of obs   =         40
                Model VCE    : OIM
                
                Expression   : Pr(whc), predict()
                
                -------------------------------------------------------------------------------
                              |            Delta-method
                              |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                locationgroup |
                           1  |       .375   .1711633     2.19   0.028     .0395261    .7104739
                           2  |   .0909091   .0866784     1.05   0.294    -.0789775    .2607957
                           3  |        .25   .2165064     1.15   0.248    -.1743447    .6743447
                           4  |   .4705882   .1210578     3.89   0.000     .2333193    .7078572
                -------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(locationgroup)
                
                  Variables that uniquely identify margins: locationgroup
                
                . 
                . logistic ssi i.locationgroup
                note: 1.locationgroup != 0 predicts failure perfectly
                      1.locationgroup dropped and 8 obs not used
                
                note: 2.locationgroup != 0 predicts failure perfectly
                      2.locationgroup dropped and 11 obs not used
                
                note: 3.locationgroup != 0 predicts failure perfectly
                      3.locationgroup dropped and 4 obs not used
                
                note: 4.locationgroup omitted because of collinearity
                
                Logistic regression                               Number of obs   =         17
                                                                  LR chi2(0)      =       0.00
                                                                  Prob > chi2     =          .
                Log likelihood = -9.2751078                       Pseudo R2       =     0.0000
                
                -------------------------------------------------------------------------------
                          ssi | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                locationgroup |
                           1  |          1  (empty)
                           2  |          1  (empty)
                           3  |          1  (empty)
                           4  |          1  (omitted)
                              |
                        _cons |   .3076923   .1759298    -2.06   0.039     .1003283    .9436474
                -------------------------------------------------------------------------------
                
                . 
                . tabulate locationgroup ssi, exact
                
                Enumerating sample-space combinations:
                stage 4:  enumerations = 1
                stage 3:  enumerations = 2
                stage 2:  enumerations = 5
                stage 1:  enumerations = 0
                
                  Location |          SSI
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         8          0 |         8 
                         2 |        11          0 |        11 
                         3 |         4          0 |         4 
                         4 |        13          4 |        17 
                -----------+----------------------+----------
                     Total |        36          4 |        40 
                
                           Fisher's exact =                 0.185
                
                . 
                . margins locationgroup
                Warning: prediction constant over observations.
                
                Adjusted predictions                              Number of obs   =         17
                Model VCE    : OIM
                
                Expression   : Pr(ssi), predict()
                
                ---------------------------------------------------------------------------------
                                |            Delta-method
                                |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                ----------------+----------------------------------------------------------------
                4.locationgroup |   .2352941   .1028794     2.29   0.022     .0336543     .436934
                ---------------------------------------------------------------------------------
                
                . 
                . tabulate locationgroup ssimn, exact
                
                Enumerating sample-space combinations:
                stage 4:  enumerations = 1
                stage 3:  enumerations = 2
                stage 2:  enumerations = 3
                stage 1:  enumerations = 0
                
                  Location |       SSI Minor
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         8          0 |         8 
                         2 |        11          0 |        11 
                         3 |         4          0 |         4 
                         4 |        14          3 |        17 
                -----------+----------------------+----------
                     Total |        37          3 |        40 
                
                           Fisher's exact =                 0.417
                
                . 
                . logistic ssimn i.locationgroup
                note: 1.locationgroup != 0 predicts failure perfectly
                      1.locationgroup dropped and 8 obs not used
                
                note: 2.locationgroup != 0 predicts failure perfectly
                      2.locationgroup dropped and 11 obs not used
                
                note: 3.locationgroup != 0 predicts failure perfectly
                      3.locationgroup dropped and 4 obs not used
                
                note: 4.locationgroup omitted because of collinearity
                
                Logistic regression                               Number of obs   =         17
                                                                  LR chi2(0)      =       0.00
                                                                  Prob > chi2     =          .
                Log likelihood = -7.9219874                       Pseudo R2       =     0.0000
                
                -------------------------------------------------------------------------------
                        ssimn | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                locationgroup |
                           1  |          1  (empty)
                           2  |          1  (empty)
                           3  |          1  (empty)
                           4  |          1  (omitted)
                              |
                        _cons |   .2142857   .1363305    -2.42   0.015     .0615816    .7456505
                -------------------------------------------------------------------------------
                
                . 
                . margins locationgroup
                Warning: prediction constant over observations.
                
                Adjusted predictions                              Number of obs   =         17
                Model VCE    : OIM
                
                Expression   : Pr(ssimn), predict()
                
                ---------------------------------------------------------------------------------
                                |            Delta-method
                                |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                ----------------+----------------------------------------------------------------
                4.locationgroup |   .1764706   .0924594     1.91   0.056    -.0047466    .3576878
                ---------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(locationgroup)
                
                  Variables that uniquely identify margins:
                
                . 
                . *I know there is only one variable. I did this graph for completeness I guess.
                
                . 
                . logistic ssimj i.locationgroup
                note: 1.locationgroup != 0 predicts failure perfectly
                      1.locationgroup dropped and 8 obs not used
                
                note: 2.locationgroup != 0 predicts failure perfectly
                      2.locationgroup dropped and 11 obs not used
                
                note: 3.locationgroup != 0 predicts failure perfectly
                      3.locationgroup dropped and 4 obs not used
                
                note: 4.locationgroup omitted because of collinearity
                
                Logistic regression                               Number of obs   =         17
                                                                  LR chi2(0)      =       0.00
                                                                  Prob > chi2     =          .
                Log likelihood = -3.8032073                       Pseudo R2       =     0.0000
                
                -------------------------------------------------------------------------------
                        ssimj | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                locationgroup |
                           1  |          1  (empty)
                           2  |          1  (empty)
                           3  |          1  (empty)
                           4  |          1  (omitted)
                              |
                        _cons |      .0625   .0644235    -2.69   0.007     .0082886    .4712794
                -------------------------------------------------------------------------------
                
                . 
                . margins locationgroup
                Warning: prediction constant over observations.
                
                Adjusted predictions                              Number of obs   =         17
                Model VCE    : OIM
                
                Expression   : Pr(ssimj), predict()
                
                ---------------------------------------------------------------------------------
                                |            Delta-method
                                |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                ----------------+----------------------------------------------------------------
                4.locationgroup |   .0588235   .0570672     1.03   0.303    -.0530261    .1706732
                ---------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(locationgroup)
                
                  Variables that uniquely identify margins:
                
                . 
                . logistic whc i.flapsizegroup
                
                Logistic regression                               Number of obs   =         40
                                                                  LR chi2(4)      =       1.82
                                                                  Prob > chi2     =     0.7680
                Log likelihood = -24.310957                       Pseudo R2       =     0.0362
                
                -------------------------------------------------------------------------------
                          whc | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           2  |   .4285715   .5207083    -0.70   0.486     .0396119    4.636829
                           3  |      .5625   .6392898    -0.51   0.613     .0606344    5.218263
                           4  |        1.5   1.732051     0.35   0.725     .1560301    14.42029
                           5  |         .6    .742967    -0.41   0.680     .0529818    6.794785
                              |
                        _cons |   .6666667   .6085806    -0.44   0.657     .1113965    3.989752
                -------------------------------------------------------------------------------
                
                . 
                . tabulate flapsizegroup whc, exact
                
                Enumerating sample-space combinations:
                stage 5:  enumerations = 1
                stage 4:  enumerations = 2
                stage 3:  enumerations = 5
                stage 2:  enumerations = 8
                stage 1:  enumerations = 0
                
                 Flap Size |          WHC
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         3          2 |         5 
                         2 |         7          2 |         9 
                         3 |         8          3 |        11 
                         4 |         4          4 |         8 
                         5 |         5          2 |         7 
                -----------+----------------------+----------
                     Total |        27         13 |        40 
                
                           Fisher's exact =                 0.795
                
                . 
                . tabulate flapsizegroup whc, chi2
                
                 Flap Size |          WHC
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         3          2 |         5 
                         2 |         7          2 |         9 
                         3 |         8          3 |        11 
                         4 |         4          4 |         8 
                         5 |         5          2 |         7 
                -----------+----------------------+----------
                     Total |        27         13 |        40 
                
                          Pearson chi2(4) =   1.8646   Pr = 0.761
                
                . 
                . margins flapsizegroup
                
                Adjusted predictions                              Number of obs   =         40
                Model VCE    : OIM
                
                Expression   : Pr(whc), predict()
                
                -------------------------------------------------------------------------------
                              |            Delta-method
                              |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           1  |         .4    .219089     1.83   0.068    -.0294066    .8294066
                           2  |   .2222223   .1385799     1.60   0.109    -.0493894    .4938339
                           3  |   .2727273   .1342816     2.03   0.042     .0095401    .5359144
                           4  |         .5   .1767767     2.83   0.005      .153524     .846476
                           5  |   .2857143   .1707469     1.67   0.094    -.0489436    .6203721
                -------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(flapsizegroup)
                
                  Variables that uniquely identify margins: flapsizegroup
                
                . 
                . logistic ssi i.flapsizegroup
                note: 1.flapsizegroup != 0 predicts failure perfectly
                      1.flapsizegroup dropped and 5 obs not used
                
                note: 2.flapsizegroup != 0 predicts failure perfectly
                      2.flapsizegroup dropped and 9 obs not used
                
                note: 5.flapsizegroup omitted because of collinearity
                
                Logistic regression                               Number of obs   =         26
                                                                  LR chi2(2)      =       1.22
                                                                  Prob > chi2     =     0.5437
                Log likelihood = -10.553045                       Pseudo R2       =     0.0546
                
                -------------------------------------------------------------------------------
                          ssi | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           1  |          1  (empty)
                           2  |          1  (empty)
                           3  |        .25   .3354102    -1.03   0.301     .0180274    3.466943
                           4  |   .3571429   .4848281    -0.76   0.448     .0249643    5.109331
                           5  |          1  (omitted)
                              |
                        _cons |         .4    .334664    -1.10   0.273     .0776057    2.061704
                -------------------------------------------------------------------------------
                
                . 
                . tabulate flapsizegroup ssi, exact
                
                Enumerating sample-space combinations:
                stage 5:  enumerations = 1
                stage 4:  enumerations = 2
                stage 3:  enumerations = 5
                stage 2:  enumerations = 9
                stage 1:  enumerations = 0
                
                 Flap Size |          SSI
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         5          0 |         5 
                         2 |         9          0 |         9 
                         3 |        10          1 |        11 
                         4 |         7          1 |         8 
                         5 |         5          2 |         7 
                -----------+----------------------+----------
                     Total |        36          4 |        40 
                
                           Fisher's exact =                 0.403
                
                . 
                . margins flapsizegroup
                
                Adjusted predictions                              Number of obs   =         26
                Model VCE    : OIM
                
                Expression   : Pr(ssi), predict()
                
                -------------------------------------------------------------------------------
                              |            Delta-method
                              |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           3  |   .0909091   .0866784     1.05   0.294    -.0789775    .2607957
                           4  |       .125   .1169268     1.07   0.285    -.1041723    .3541723
                           5  |   .2857143   .1707469     1.67   0.094    -.0489436    .6203721
                -------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(flapsizegroup)
                
                  Variables that uniquely identify margins: flapsizegroup
                
                . 
                . logistic ssimn i.flapsizegroup
                note: 1.flapsizegroup != 0 predicts failure perfectly
                      1.flapsizegroup dropped and 5 obs not used
                
                note: 2.flapsizegroup != 0 predicts failure perfectly
                      2.flapsizegroup dropped and 9 obs not used
                
                note: 5.flapsizegroup omitted because of collinearity
                
                Logistic regression                               Number of obs   =         26
                                                                  LR chi2(2)      =       0.12
                                                                  Prob > chi2     =     0.9396
                Log likelihood = -9.2359726                       Pseudo R2       =     0.0067
                
                -------------------------------------------------------------------------------
                        ssimn | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           1  |          1  (empty)
                           2  |          1  (empty)
                           3  |         .6   .9033272    -0.34   0.734     .0313783    11.47291
                           4  |   .8571428    1.30261    -0.10   0.919     .0435986    16.85133
                           5  |          1  (omitted)
                              |
                        _cons |   .1666667   .1800206    -1.66   0.097     .0200653    1.384368
                -------------------------------------------------------------------------------
                
                . 
                . tabulate flapsizegroup ssimn, exact
                
                Enumerating sample-space combinations:
                stage 5:  enumerations = 1
                stage 4:  enumerations = 1
                stage 3:  enumerations = 2
                stage 2:  enumerations = 2
                stage 1:  enumerations = 0
                
                 Flap Size |       SSI Minor
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         5          0 |         5 
                         2 |         9          0 |         9 
                         3 |        10          1 |        11 
                         4 |         7          1 |         8 
                         5 |         6          1 |         7 
                -----------+----------------------+----------
                     Total |        37          3 |        40 
                
                           Fisher's exact =                 0.850
                
                . 
                . margins flapsizegroup
                
                Adjusted predictions                              Number of obs   =         26
                Model VCE    : OIM
                
                Expression   : Pr(ssimn), predict()
                
                -------------------------------------------------------------------------------
                              |            Delta-method
                              |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           3  |   .0909091   .0866784     1.05   0.294    -.0789775    .2607957
                           4  |       .125   .1169268     1.07   0.285    -.1041723    .3541723
                           5  |   .1428571     .13226     1.08   0.280    -.1163677     .402082
                -------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(flapsizegroup)
                
                  Variables that uniquely identify margins: flapsizegroup
                
                . 
                . logistic ssimj i.flapsizegroup
                note: 1.flapsizegroup != 0 predicts failure perfectly
                      1.flapsizegroup dropped and 5 obs not used
                
                note: 2.flapsizegroup != 0 predicts failure perfectly
                      2.flapsizegroup dropped and 9 obs not used
                
                note: 3.flapsizegroup != 0 predicts failure perfectly
                      3.flapsizegroup dropped and 11 obs not used
                
                note: 4.flapsizegroup != 0 predicts failure perfectly
                      4.flapsizegroup dropped and 8 obs not used
                
                note: 5.flapsizegroup omitted because of collinearity
                
                Logistic regression                               Number of obs   =          7
                                                                  LR chi2(0)      =       0.00
                                                                  Prob > chi2     =          .
                Log likelihood = -2.8708142                       Pseudo R2       =     0.0000
                
                -------------------------------------------------------------------------------
                        ssimj | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
                --------------+----------------------------------------------------------------
                flapsizegroup |
                           1  |          1  (empty)
                           2  |          1  (empty)
                           3  |          1  (empty)
                           4  |          1  (empty)
                           5  |          1  (omitted)
                              |
                        _cons |   .1666667   .1800206    -1.66   0.097     .0200653    1.384368
                -------------------------------------------------------------------------------
                
                . 
                . tabulate flapsizegroup ssimj, exact
                
                Enumerating sample-space combinations:
                stage 5:  enumerations = 1
                stage 4:  enumerations = 1
                stage 3:  enumerations = 0
                stage 2:  enumerations = 0
                stage 1:  enumerations = 0
                
                 Flap Size |       SSI Major
                     Group |         0          1 |     Total
                -----------+----------------------+----------
                         1 |         5          0 |         5 
                         2 |         9          0 |         9 
                         3 |        11          0 |        11 
                         4 |         8          0 |         8 
                         5 |         6          1 |         7 
                -----------+----------------------+----------
                     Total |        39          1 |        40 
                
                           Fisher's exact =                 0.300
                
                . 
                . margins flapsizegroup
                Warning: prediction constant over observations.
                
                Adjusted predictions                              Number of obs   =          7
                Model VCE    : OIM
                
                Expression   : Pr(ssimj), predict()
                
                ---------------------------------------------------------------------------------
                                |            Delta-method
                                |     Margin   Std. Err.      z    P>|z|     [95% Conf. Interval]
                ----------------+----------------------------------------------------------------
                5.flapsizegroup |   .1428571     .13226     1.08   0.280    -.1163677     .402082
                ---------------------------------------------------------------------------------
                
                . 
                . marginsplot, xdimension(flapsizegroup)
                
                  Variables that uniquely identify margins:

                Comment


                • #9
                  Now that I re-looked at your results, I wouldn't confidently declare that there are no differences: CIs are very wide, with ORs as high as 8 inside.
                  Thus the power to declare differences was quite low. For the rest of your posts, I'm not sure what your question is.
                  Steve Samuels
                  Statistical Consulting
                  [email protected]

                  Stata 14.2

                  Comment


                  • #10
                    Ok. So i think our questions are:

                    1) Effect of age on Total/Major/Minor WHC/SSI.
                    2) Effect of BMI on Total/Major/Minor WHC/SSI.
                    3) Effect of surgical site on Total/Major/Minor WHC/SSI.
                    and possibly
                    4) Effect of Flap size (petite, small, medium, large, extra large) on Total/Major/Minor WHC/SSI.

                    And I was trying to use the 95% CI's to show if our results of no difference were true or due to small sample size, which seems to be the case, huh. Maybe I just have to report it like that? "Although we found no statistical difference between groups, we realize our results are limited by sample size as demonstrated in the wide 95% CI's."

                    What do you think?

                    And BTW, I realize you are a professor and a consulting statistician. Can I send you a thank-you gift or something because I realize you don't have to be helping me out and I greatly appreciate it?
                    Last edited by Michael Lanni; 07 Sep 2015, 09:28.

                    Comment


                    • #11
                      Although we found no statistical difference between groups, we realize our results are limited by sample size as demonstrated in the wide 95% CI's.
                      That sounds okay.

                      I'm glad I was able to help you; the gratitude that you have already expressed is more than sufficient return. Good luck in the future.
                      Steve Samuels
                      Statistical Consulting
                      [email protected]

                      Stata 14.2

                      Comment

                      Working...
                      X