SPSS FAQ
How can I run a logistic regression with only a constant in the
model?
There may be times when you would like to run a logistic regression with no
predictor variables; in other words, just the constant (a.k.a. the
intercept). For example, one may do this when calculating deviance scores
between various models. If you try to run the logistic regression command
in SPSS without a method subcommand or a method = enter
subcommand with no variables after it, SPSS will give you an error message and
not run the logistic regression. There is a way to "trick" SPSS
into running this type of logistic regression model. First, you will need
to create a new variable that is a constant in the dataset. Next, when you
run the logistic regression, use this new (constant) variable as the independent
variable with the noconst subcommand. In effect, you are simply
substituting the constant that you create for the one that would normally be
included in the model. (Please note that this trick does not work with the
regression command. According to SPSS technical support, the
regression command cannot be run without predictors; in other words, you
cannot get an intercept only model. If you want an intercept only model,
you will need to use the glm command.)
For example, let's use the hsb2.sav
dataset. First, we will create the constant
variable. Next, we will run the logistic regression using female as the dependent
variable (we understand that this is an unusual choice for a dependent
variable, but we just needed a dichotomous variable for the example).
compute constant = 1.
execute.
logistic regression var = female
/method = enter constant
/noconst.
Case Processing Summary
| Unweighted Cases(a) |
N |
Percent |
| Selected Cases |
Included in Analysis |
200 |
100.0 |
| Missing Cases |
0 |
.0 |
| Total |
200 |
100.0 |
| Unselected Cases |
0 |
.0 |
| Total |
200 |
100.0 |
| a If weight is in effect, see classification table for the total number of cases.
|
Dependent Variable Encoding
| Original Value |
Internal Value |
| male |
0 |
| female |
1 |
Classification Table(a,b,c)
|
Predicted |
| FEMALE |
Percentage Correct |
|
Observed |
male |
female |
| Step 0 |
FEMALE |
male |
0 |
91 |
.0 |
| female |
0 |
109 |
100.0 |
| Overall Percentage |
|
|
54.5 |
| a No terms in the model.
|
| b Initial Log-likelihood Function: -2 Log Likelihood = 277.259
|
| c The cut value is .500
|
Variables not in the Equation
|
Score |
df |
Sig. |
| Step 0 |
Variables |
CONSTANT |
1.620 |
1 |
.203 |
| Overall Statistics |
1.620 |
1 |
.203 |
Omnibus Tests of Model Coefficients
|
Chi-square |
df |
Sig. |
| Step 1 |
Step |
1.622 |
1 |
.203 |
| Block |
1.622 |
1 |
.203 |
| Model |
1.622 |
1 |
.203 |
Model Summary
| Step |
-2 Log likelihood |
Cox & Snell R Square |
Nagelkerke R Square |
| 1 |
275.637 |
.008 |
.011 |
Classification Table(a)
|
Predicted |
| FEMALE |
Percentage Correct |
|
Observed |
male |
female |
| Step 1 |
FEMALE |
male |
0 |
91 |
.0 |
| female |
0 |
109 |
100.0 |
| Overall Percentage |
|
|
54.5 |
| a The cut value is .500
|
Variables in the Equation
|
B |
S.E. |
Wald |
df |
Sig. |
Exp(B) |
| Step 1(a) |
CONSTANT |
.180 |
.142 |
1.616 |
1 |
.204 |
1.198 |
| a Variable(s) entered on step 1: CONSTANT.
|
The content of this web site should not be construed as an endorsement
of any particular web site, book, or software product by the
University of California.