Backwards stepwise regression approach in Stata 13

782 views Asked by At
. stepwise, pr(.05) : logit y1 (x1-x7)
                      begin with full model
p < 0.0500            for all terms in model

Logistic regression                               Number of obs   =      28900
                                                  LR chi2(66)     =    1182.91
                                                  Prob > chi2     =     0.0000
Log likelihood = -28120.170                       Pseudo R2       =     0.0213

------------------------------------------------------------------------------
       churn |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          x1 |   .0019635   .0007981     2.46   0.014     .0003992    .0035278
          x2 |  -.0002809   .0000496    -5.66   0.000    -.0003782   -.0001836
          x3 |  -.0031225   .0008888    -3.51   0.000    -.0048645   -.0013806
          x4 |  -.0011958   .0059387    -0.20   0.840    -.0128354    .0104439
          x5 |   .0007603   .0002804     2.71   0.007     .0002106    .0013099
          x6 |   .0070912   .0020636     3.44   0.001     .0030467    .0111357
          x7 |  -.0004919   .0000535    -9.19   0.660    -.0005968   -.0003871
       _cons |   .1497005   .0952738     1.57   0.116    -.0370327    .3364336
------------------------------------------------------------------------------
Note: 0 failures and 1 success completely determined.

As you can see, in the above logistic regression output, x4 and x7 both have p-values that are >0.05... however, Stata is telling me that p < 0.0500 for all terms in model, thereby rendering my stepwise approach useless.

Can anyone please advise what I may be doing wrong?

1

There are 1 answers

0
Nick Cox On

You insisted with your syntax that all the variables be kept together, so Stata has nowhere to go from where it started in this case. Hence there can be nothing stepwise with your syntax: it's either all in or all out.

See the help: a varlist in parentheses indicates that this group of variables is to be included or excluded together. All the predictors are so bound by what you typed.

After reading the help, all you may need to do is to omit the parentheses.

(Lack of a Stata tag for a month cut down mightily on the Stata users reading this.)