|
|
|
||||
|
|
|||||
This page shows an example on logistic regression analysis with popup windows explaining the output. The analysis uses a data file about crime. In this example we first create a dichotomuos response variable called hicrime by the command: . generate hicrime = (crimerat >= 110). This model will predict hicrime from maleteen, south, educ and police59 using the following Stata commands (both logistic and logit are use to obtain output with odds ratios and regular coefficients).
. logistic hicrime maleteen south educ police59 logit lfit lfit, group(10)The output of this command is shown below, with explanation in popup windows.
Output
. logistic hicrime maleteen south educ police59
Logit estimates Number of obs = 47
LR chi2(4) = 13.93
Prob > chi2 = 0.0075
Log likelihood = -18.606959 Pseudo R2 = 0.2724
------------------------------------------------------------------------------
hicrime | Odds Ratio Std. Err. z P>|z| [95% Conf. Interval]
---------+--------------------------------------------------------------------
maleteen | 1.086959 .0478646 1.894 0.058 .9970804 1.184939
south | .3272305 .4449077 -0.822 0.411 .0227796 4.70068
educ | 1.023187 .5723757 0.041 0.967 .3418133 3.062818
police59 | 1.059909 .0222633 2.770 0.006 1.01716 1.104455
------------------------------------------------------------------------------
logit
Logit estimates Number of obs = 47
LR chi2(4) = 13.93
Prob > chi2 = 0.0075
Log likelihood = -18.606959 Pseudo R2 = 0.2724
------------------------------------------------------------------------------
hicrime | Coef. Std. Err. z P>|z| [95% Conf. Interval]
---------+--------------------------------------------------------------------
maleteen | .0833837 .0440353 1.894 0.058 -.0029239 .1696914
south | -1.117091 1.359616 -0.822 0.411 -3.781888 1.547707
educ | .0229224 .5594047 0.041 0.967 -1.073491 1.119335
police59 | .0581834 .0210049 2.770 0.006 .0170147 .0993522
_cons | -17.70177 9.495993 -1.864 0.062 -36.31357 .9100364
------------------------------------------------------------------------------
lfit
Logistic model for hicrime, goodness-of-fit test
number of observations = 47
number of covariate patterns = 47
Pearson chi2(42) = 38.72
Prob > chi2 = 0.6158
lfit, group(10)
Logistic model for hicrime, goodness-of-fit test
(Table collapsed on quantiles of estimated probabilities)
number of observations = 47
number of groups = 10
Hosmer-Lemeshow chi2(8) = 13.45
Prob > chi2 = 0.0972
Click here for the printable version of the entire footnote.
UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services