Phd Program in Transportation Transport Demand Modeling · Phd Program in Transportation Transport...

61
Phd in Transportation / Transport Demand Modelling 1/60 Phd Program in Transportation Transport Demand Modeling João de Abreu e Silva Session 10 Binary and Ordered Choice Models

Transcript of Phd Program in Transportation Transport Demand Modeling · Phd Program in Transportation Transport...

Phd in Transportation / Transport Demand Modelling 3/60

Discrete choice and Utility theory

It is useful to link the statistical model to an underlying theoretical

construct.

Discrete outcome models have been tied to utility theory.

Traditional approaches from microeconomic theory have decision

makers choosing among a set of alternatives such that their utility

(satisfaction) is maximized subject to the prices of the alternatives

and an income constraint.

Problem – any purchase affects other purchases (they are not

independent)

It is possible to assume that the consumption among different groups

of products is independent - Separability. E.g. choice of cereal brand

and car purchase.

Phd in Transportation / Transport Demand Modelling 16/60

Likelihood ratio test

The likelihood ratio test is used to test if the model is a statistical

improvement over a base model (null or restricted model).

The statistic has a limiting chi squared distribution with degrees of

freedom equal to the number of restrictions being tested.

The likelihood ratio test that all the slope coefficients in the probit or

logit model are zero. “Similar” to the F test.

Where P1 is the proportion of the observations that have dependent variable equal to 1.

Phd in Transportation / Transport Demand Modelling 19/60

Binary model - example

Data from Tomar 2003/2004, 250 observations.

Evaluate Car use in home based trips as a function of socioeconomic and land use

patterns

TI – dependent variable (1 if car was used, 0 otherwise)

IDADE – age of the respondent

SEXO – gender (1 if man)

FDIM – Household dimension

DENS – population density in the residence zone

DEFEST – parking deficit (1 if yes)

NADUL – number of adults in the household

AIDM – average age of the adults

EMP – employed (1 if respondent was employed)

Phd in Transportation / Transport Demand Modelling 20/60

Binary model - example

Binary Probit Probit

;Lhs = dependent variable

;Rhs = One,independent variables (separated by commas)$ +---------------------------------------------+

| Binomial Probit Model |

| Maximum Likelihood Estimates |

| Model estimated: Oct 26, 2010 at 00:48:18PM.|

| Dependent variable TI |

| Weighting variable None |

| Number of observations 250 |

| Iterations completed 5 |

| Log likelihood function -142.0311 |

| Number of parameters 9 |

| Info. Criterion: AIC = 1.20825 |

| Finite Sample: AIC = 1.21125 |

| Info. Criterion: BIC = 1.33502 |

| Info. Criterion:HQIC = 1.25927 |

| Restricted log likelihood -160.9133 |

| McFadden Pseudo R-squared .1173439 |

| Chi squared 37.76438 |

| Degrees of freedom 8 |

| Prob[ChiSqd > value] = .8320901E-05 |

| Hosmer-Lemeshow chi-squared = 16.78439 |

| P-value= .03243 with deg.fr. = 8 |

+---------------------------------------------+

Phd in Transportation / Transport Demand Modelling 21/60

Binary model - example

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|

+--------+--------------+----------------+--------+--------+----------+

---------+Index function for probability

Constant| 2.17768691 .66808320 3.260 .0011

IDADE | .00812010 .00947338 .857 .3914 43.0720000

SEXO | .40306615 .17845407 2.259 .0239 .45200000

FDIM | .27558566 .12660998 2.177 .0295 2.97200000

DENS | -.60699476 .23250165 -2.611 .0090 .45024000

DEFEST | -.42731158 .20151556 -2.120 .0340 .22400000

NADUL | -.62465667 .15963162 -3.913 .0001 2.39600000

AIDM | -.02408234 .01251624 -1.924 .0543 43.0200000

EMP | -.26631548 .22087316 -1.206 .2279 .65200000

Phd in Transportation / Transport Demand Modelling 22/60

Binary model - example

+----------------------------------------+

| Fit Measures for Binomial Choice Model |

| Probit model for variable TI |

+----------------------------------------+

| Proportions P0= .344000 P1= .656000 |

| N = 250 N0= 86 N1= 164 |

| LogL= -142.031 LogL0= -160.913 |

| Estrella = 1-(L/L0)^(-2L0/n) = .14844 |

+----------------------------------------+

| Efron | McFadden | Ben./Lerman |

| .13421 | .11734 | .61239 |

| Cramer | Veall/Zim. | Rsqrd_ML |

| .14114 | .23318 | .14020 |

+----------------------------------------+

| Information Akaike I.C. Schwarz I.C. |

| Criteria 1.20825 1.33502 |

+----------------------------------------+

+---------------------------------------------------------+

|Predictions for Binary Choice Model. Predicted value is |

|1 when probability is greater than .500000, 0 otherwise.|

|Note, column or row total percentages may not sum to |

|100% because of rounding. Percentages are of full sample.|

+------+---------------------------------+----------------+

|Actual| Predicted Value | |

|Value | 0 1 | Total Actual |

+------+----------------+----------------+----------------+

| 0 | 32 ( 12.8%)| 54 ( 21.6%)| 86 ( 34.4%)|

| 1 | 20 ( 8.0%)| 144 ( 57.6%)| 164 ( 65.6%)|

+------+----------------+----------------+----------------+

|Total | 52 ( 20.8%)| 198 ( 79.2%)| 250 (100.0%)|

+------+----------------+----------------+----------------+

=======================================================================

Analysis of Binary Choice Model Predictions Based on Threshold = .5000

-----------------------------------------------------------------------

Prediction Success

-----------------------------------------------------------------------

Sensitivity = actual 1s correctly predicted 87.805%

Specificity = actual 0s correctly predicted 37.209%

Positive predictive value = predicted 1s that were actual 1s 72.727%

Negative predictive value = predicted 0s that were actual 0s 61.538%

Correct prediction = actual 1s and 0s correctly predicted 70.400%

-----------------------------------------------------------------------

Prediction Failure

-----------------------------------------------------------------------

False pos. for true neg. = actual 0s predicted as 1s 62.791%

False neg. for true pos. = actual 1s predicted as 0s 12.195%

False pos. for predicted pos. = predicted 1s actual 0s 27.273%

False neg. for predicted neg. = predicted 0s actual 1s 38.462%

False predictions = actual 1s and 0s incorrectly predicted 29.600%

=======================================================================

Phd in Transportation / Transport Demand Modelling 23/60

Binary model - example

+----------------------------------------+

| Fit Measures for Binomial Choice Model |

| Probit model for variable TI |

+----------------------------------------+

| Proportions P0= .344000 P1= .656000 |

| N = 250 N0= 86 N1= 164 |

| LogL= -142.031 LogL0= -160.913 |

| Estrella = 1-(L/L0)^(-2L0/n) = .14844 |

+----------------------------------------+

| Efron | McFadden | Ben./Lerman |

| .13421 | .11734 | .61239 |

| Cramer | Veall/Zim. | Rsqrd_ML |

| .14114 | .23318 | .14020 |

+----------------------------------------+

| Information Akaike I.C. Schwarz I.C. |

| Criteria 1.20825 1.33502 |

+----------------------------------------+

+---------------------------------------------------------+

|Predictions for Binary Choice Model. Predicted value is |

|1 when probability is greater than .500000, 0 otherwise.|

|Note, column or row total percentages may not sum to |

|100% because of rounding. Percentages are of full sample.|

+------+---------------------------------+----------------+

|Actual| Predicted Value | |

|Value | 0 1 | Total Actual |

+------+----------------+----------------+----------------+

| 0 | 32 ( 12.8%)| 54 ( 21.6%)| 86 ( 34.4%)|

| 1 | 20 ( 8.0%)| 144 ( 57.6%)| 164 ( 65.6%)|

+------+----------------+----------------+----------------+

|Total | 52 ( 20.8%)| 198 ( 79.2%)| 250 (100.0%)|

+------+----------------+----------------+----------------+

=======================================================================

Analysis of Binary Choice Model Predictions Based on Threshold = .5000

-----------------------------------------------------------------------

Prediction Success

-----------------------------------------------------------------------

Sensitivity = actual 1s correctly predicted 87.805%

Specificity = actual 0s correctly predicted 37.209%

Positive predictive value = predicted 1s that were actual 1s 72.727%

Negative predictive value = predicted 0s that were actual 0s 61.538%

Correct prediction = actual 1s and 0s correctly predicted 70.400%

-----------------------------------------------------------------------

Prediction Failure

-----------------------------------------------------------------------

False pos. for true neg. = actual 0s predicted as 1s 62.791%

False neg. for true pos. = actual 1s predicted as 0s 12.195%

False pos. for predicted pos. = predicted 1s actual 0s 27.273%

False neg. for predicted neg. = predicted 0s actual 1s 38.462%

False predictions = actual 1s and 0s incorrectly predicted 29.600%

=======================================================================

Phd in Transportation / Transport Demand Modelling 24/60

Binary model - example

Binary Logit Logit

;Lhs = dependent variable

;Rhs = One,independent variables (separated by commas)$

+---------------------------------------------+

| Binary Logit Model for Binary Choice |

| Maximum Likelihood Estimates |

| Model estimated: Oct 26, 2010 at 00:48:18PM.|

| Dependent variable TI |

| Weighting variable None |

| Number of observations 250 |

| Iterations completed 5 |

| Log likelihood function -142.3632 |

| Number of parameters 9 |

| Info. Criterion: AIC = 1.21091 |

| Finite Sample: AIC = 1.21391 |

| Info. Criterion: BIC = 1.33768 |

| Info. Criterion:HQIC = 1.26193 |

| Restricted log likelihood -160.9133 |

| McFadden Pseudo R-squared .1152801 |

| Chi squared 37.10019 |

| Degrees of freedom 8 |

| Prob[ChiSqd > value] = .1103005E-04 |

| Hosmer-Lemeshow chi-squared = 15.75682 |

| P-value= .04600 with deg.fr. = 8 |

+---------------------------------------------+

Phd in Transportation / Transport Demand Modelling 25/60

Binary model - example

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|

+--------+--------------+----------------+--------+--------+----------+

---------+Characteristics in numerator of Prob[Y = 1]

Constant| 3.59537669 1.13332753 3.172 .0015

IDADE | .01325360 .01562042 .848 .3962 43.0720000

SEXO | .66921981 .29950572 2.234 .0255 .45200000

FDIM | .43930887 .21328635 2.060 .0394 2.97200000

DENS | -.98707555 .38885378 -2.538 .0111 .45024000

DEFEST | -.69848440 .33199452 -2.104 .0354 .22400000

NADUL | -1.00721380 .26843054 -3.752 .0002 2.39600000

AIDM | -.03992124 .02069419 -1.929 .0537 43.0200000

EMP | -.45643740 .37192597 -1.227 .2197 .65200000

+--------------------------------------------------------------------+

| Information Statistics for Discrete Choice Model. |

| M=Model MC=Constants Only M0=No Model |

| Criterion F (log L) -142.36317 -160.91327 -173.28680 |

| LR Statistic vs. MC 37.10019 .00000 .00000 |

| Degrees of Freedom 8.00000 .00000 .00000 |

| Prob. Value for LR .00001 .00000 .00000 |

| Entropy for probs. 142.36317 160.91327 173.28680 |

| Normalized Entropy .82155 .92860 1.00000 |

| Entropy Ratio Stat. 61.84724 24.74705 .00000 |

| Bayes Info Criterion 1.31559 1.46399 1.56298 |

| BIC(no model) - BIC .24739 .09899 .00000 |

| Pseudo R-squared .11528 .00000 .00000 |

| Pct. Correct Pred. 70.40000 .00000 50.00000 |

| Means: y=0 y=1 y=2 y=3 y=4 y=5 y=6 y>=7 |

| Outcome .3440 .6560 .0000 .0000 .0000 .0000 .0000 .0000 |

| Pred.Pr .3440 .6560 .0000 .0000 .0000 .0000 .0000 .0000 |

| Notes: Entropy computed as Sum(i)Sum(j)Pfit(i,j)*logPfit(i,j). |

| Normalized entropy is computed against M0. |

| Entropy ratio statistic is computed against M0. |

| BIC = 2*criterion - log(N)*degrees of freedom. |

| If the model has only constants or if it has no constants, |

| the statistics reported here are not useable. |

+--------------------------------------------------------------------+

Phd in Transportation / Transport Demand Modelling 26/60

Binary model - example

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|

+--------+--------------+----------------+--------+--------+----------+

---------+Characteristics in numerator of Prob[Y = 1]

Constant| 3.59537669 1.13332753 3.172 .0015

IDADE | .01325360 .01562042 .848 .3962 43.0720000

SEXO | .66921981 .29950572 2.234 .0255 .45200000

FDIM | .43930887 .21328635 2.060 .0394 2.97200000

DENS | -.98707555 .38885378 -2.538 .0111 .45024000

DEFEST | -.69848440 .33199452 -2.104 .0354 .22400000

NADUL | -1.00721380 .26843054 -3.752 .0002 2.39600000

AIDM | -.03992124 .02069419 -1.929 .0537 43.0200000

EMP | -.45643740 .37192597 -1.227 .2197 .65200000

+--------------------------------------------------------------------+

| Information Statistics for Discrete Choice Model. |

| M=Model MC=Constants Only M0=No Model |

| Criterion F (log L) -142.36317 -160.91327 -173.28680 |

| LR Statistic vs. MC 37.10019 .00000 .00000 |

| Degrees of Freedom 8.00000 .00000 .00000 |

| Prob. Value for LR .00001 .00000 .00000 |

| Entropy for probs. 142.36317 160.91327 173.28680 |

| Normalized Entropy .82155 .92860 1.00000 |

| Entropy Ratio Stat. 61.84724 24.74705 .00000 |

| Bayes Info Criterion 1.31559 1.46399 1.56298 |

| BIC(no model) - BIC .24739 .09899 .00000 |

| Pseudo R-squared .11528 .00000 .00000 |

| Pct. Correct Pred. 70.40000 .00000 50.00000 |

| Means: y=0 y=1 y=2 y=3 y=4 y=5 y=6 y>=7 |

| Outcome .3440 .6560 .0000 .0000 .0000 .0000 .0000 .0000 |

| Pred.Pr .3440 .6560 .0000 .0000 .0000 .0000 .0000 .0000 |

| Notes: Entropy computed as Sum(i)Sum(j)Pfit(i,j)*logPfit(i,j). |

| Normalized entropy is computed against M0. |

| Entropy ratio statistic is computed against M0. |

| BIC = 2*criterion - log(N)*degrees of freedom. |

| If the model has only constants or if it has no constants, |

| the statistics reported here are not useable. |

+--------------------------------------------------------------------+

Phd in Transportation / Transport Demand Modelling 27/60

Binary model - example +----------------------------------------+

| Fit Measures for Binomial Choice Model |

| Logit model for variable TI |

+----------------------------------------+

| Proportions P0= .344000 P1= .656000 |

| N = 250 N0= 86 N1= 164 |

| LogL= -142.363 LogL0= -160.913 |

| Estrella = 1-(L/L0)^(-2L0/n) = .14587 |

+----------------------------------------+

| Efron | McFadden | Ben./Lerman |

| .13396 | .11528 | .61110 |

| Cramer | Veall/Zim. | Rsqrd_ML |

| .13831 | .22961 | .13791 |

+----------------------------------------+

| Information Akaike I.C. Schwarz I.C. |

| Criteria 1.21091 1.33768 |

+----------------------------------------+

+---------------------------------------------------------+

|Predictions for Binary Choice Model. Predicted value is |

|1 when probability is greater than .500000, 0 otherwise.|

|Note, column or row total percentages may not sum to |

|100% because of rounding. Percentages are of full sample.|

+------+---------------------------------+----------------+

|Actual| Predicted Value | |

|Value | 0 1 | Total Actual |

+------+----------------+----------------+----------------+

| 0 | 31 ( 12.4%)| 55 ( 22.0%)| 86 ( 34.4%)|

| 1 | 19 ( 7.6%)| 145 ( 58.0%)| 164 ( 65.6%)|

+------+----------------+----------------+----------------+

|Total | 50 ( 20.0%)| 200 ( 80.0%)| 250 (100.0%)|

+------+----------------+----------------+----------------+

Phd in Transportation / Transport Demand Modelling 28/60

Binary model - example

=======================================================================

Analysis of Binary Choice Model Predictions Based on Threshold = .5000

-----------------------------------------------------------------------

Prediction Success

-----------------------------------------------------------------------

Sensitivity = actual 1s correctly predicted 88.415%

Specificity = actual 0s correctly predicted 36.047%

Positive predictive value = predicted 1s that were actual 1s 72.500%

Negative predictive value = predicted 0s that were actual 0s 62.000%

Correct prediction = actual 1s and 0s correctly predicted 70.400%

-----------------------------------------------------------------------

Prediction Failure

-----------------------------------------------------------------------

False pos. for true neg. = actual 0s predicted as 1s 63.953%

False neg. for true pos. = actual 1s predicted as 0s 11.585%

False pos. for predicted pos. = predicted 1s actual 0s 27.500%

False neg. for predicted neg. = predicted 0s actual 1s 38.000%

False predictions = actual 1s and 0s incorrectly predicted 29.600%

=======================================================================

Phd in Transportation / Transport Demand Modelling 29/60

Binary model - example

Marginal effects - Probit Probit

;Lhs = dependent variable

;Rhs = One,independent variables (separated by commas)

;Marginal Effects$

+-------------------------------------------+

| Partial derivatives of E[y] = F[*] with |

| respect to the vector of characteristics. |

| They are computed at the means of the Xs. |

| Observations used for means are All Obs. |

+-------------------------------------------+

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]|Elasticity|

+--------+--------------+----------------+--------+--------+----------+

---------+Index function for probability

Constant| .78394066 .23700876 3.308 .0009

IDADE | .00292314 .00341333 .856 .3918 .18657108

---------+Marginal effect for dummy variable is P|1 - P|0.

SEXO | .14305236 .06199495 2.307 .0210 .09581501

FDIM | .09920747 .04529663 2.190 .0285 .43691129

DENS | -.21851069 .08370650 -2.610 .0090 -.14578635

---------+Marginal effect for dummy variable is P|1 - P|0.

DEFEST | -.16006850 .07732981 -2.070 .0385 -.05313173

NADUL | -.22486876 .05699234 -3.946 .0001 -.79839175

AIDM | -.00866935 .00451035 -1.922 .0546 -.55265870

---------+Marginal effect for dummy variable is P|1 - P|0.

EMP | -.09384027 .07591962 -1.236 .2164 -.09066443

Phd in Transportation / Transport Demand Modelling 30/60

Binary model - example

Marginal effects - Logit Logit

;Lhs = dependent variable

;Rhs = One,independent variables (separated by commas)

;Marginal Effects$

+-------------------------------------------+

| Partial derivatives of probabilities with |

| respect to the vector of characteristics. |

| They are computed at the means of the Xs. |

| Observations used are All Obs. |

+-------------------------------------------+

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]|Elasticity|

+--------+--------------+----------------+--------+--------+----------+

---------+Marginal effect for variable in probability

Constant| .78476651 .24198166 3.243 .0012

IDADE | .00289288 .00341363 .847 .3967 .18374445

---------+Marginal effect for dummy variable is P|1 - P|0.

SEXO | .14358532 .06248443 2.298 .0216 .09570572

FDIM | .09588839 .04613818 2.078 .0377 .42024662

DENS | -.21544998 .08474301 -2.542 .0110 -.14304739

---------+Marginal effect for dummy variable is P|1 - P|0.

DEFEST | -.16067168 .07877697 -2.040 .0414 -.05307338

NADUL | -.21984558 .05768361 -3.811 .0001 -.77677267

AIDM | -.00871365 .00451725 -1.929 .0537 -.55278958

---------+Marginal effect for dummy variable is P|1 - P|0.

EMP | -.09686083 .07636889 -1.268 .2047 -.09312906

Phd in Transportation / Transport Demand Modelling 42/60

Likelihood ratio test

The likelihood ratio test is used to test if the model is a statistical

improvement over a base model (null or restricted model).

The test statistic is simply twice the difference between the log

likelihoods for the null and alternative models.

Is usually simpler than the Wald test. Asymptotically, the two

statistics have the same characteristics when the assumptions of the

model are met. But the two tests could conflict for a particular

significance level (LR is the preferred one)

Phd in Transportation / Transport Demand Modelling 51/60

Example – Ordered Response Model

A survey made in Seattle tried to assess the opinion of drivers about

HOV lanes being opened to all users regardless of number of

occupants ( disagree strongly, disagree, neutral, agree, agree

strongly)

Build an ordered probit regressing this variable against the following:

Drive alone (1, 0 otherwise)

Flexible working time (1, 0 otherwise)

Commuter household income

Old age (1 is 50 years old or more, 0 otherwise)

Number of times in the past five commutes that changed route or

departure time

N= 322

Phd in Transportation / Transport Demand Modelling 53/60

Example – Ordered Response Model

+---------------------------------------------+

| Ordered Probability Model |

| Maximum Likelihood Estimates |

| Model estimated: Oct 26, 2010 at 11:24:32AM.|

| Dependent variable OPINION |

| Weighting variable None |

| Number of observations 322 |

| Iterations completed 14 |

| Log likelihood function -456.2479 |

| Number of parameters 9 |

| Info. Criterion: AIC = 2.88974 |

| Finite Sample: AIC = 2.89153 |

| Info. Criterion: BIC = 2.99524 |

| Info. Criterion:HQIC = 2.93186 |

| Restricted log likelihood -484.0105 |

| McFadden Pseudo R-squared .0573594 |

| Chi squared 55.52512 |

| Degrees of freedom 5 |

| Prob[ChiSqd > value] = .0000000 |

| Underlying probabilities based on Normal |

+---------------------------------------------+

Log Likelihood ratio

Pseudo Rho2

Phd in Transportation / Transport Demand Modelling 54/60

Example – Ordered Response Model

+---------------------------------------------+

| Ordered Probability Model |

| Cell frequencies for outcomes |

| Y Count Freq Y Count Freq Y Count Freq |

| 0 99 .307 1 85 .263 2 26 .080 |

| 3 36 .111 4 76 .236 |

+---------------------------------------------+

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|

+--------+--------------+----------------+--------+--------+----------+

---------+Index function for probability

Constant| -.64741849 .20409362 -3.172 .0015

DALONE | 1.07608334 .15683714 6.861 .0000 .77018634

FLEXIBLE| .20336728 .12544314 1.621 .1050 .54037267

INCOME | .198148D-05 .139144D-05 1.424 .1544 75900.4876

OAGE | .24365556 .15049386 1.619 .1054 .20807453

CHANGE | .06698714 .05038731 1.329 .1837 .73913043

---------+Threshold parameters for index

Mu(1) | .76959111 .06536482 11.774 .0000

Mu(2) | .99994690 .07005703 14.273 .0000

Mu(3) | 1.35038329 .08101695 16.668 .0000

Thresholds

Z test for the coefficients

P-values

Phd in Transportation / Transport Demand Modelling 55/60

Example – Ordered Response Model

+---------------------------------------------------------------------------+

| Cross tabulation of predictions. Row is actual, column is predicted. |

| Model = Probit . Prediction is number of the most probable cell. |

+-------+-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+

| Actual|Row Sum| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

+-------+-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+

| 0| 99| 47| 34| 0| 0| 18|

| 1| 85| 18| 34| 0| 0| 33|

| 2| 26| 4| 8| 0| 0| 14|

| 3| 36| 3| 12| 0| 0| 21|

| 4| 76| 13| 24| 0| 0| 39|

+-------+-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+

|Col Sum| 322| 85| 112| 0| 0| 125| 0| 0| 0| 0| 0|

+-------+-------+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+

Phd in Transportation / Transport Demand Modelling 56/60

Example – Ordered Response Model

Display marginal effects ORDERED

;Lhs= y label

;Rhs=one,xlabels(separated by commas)

;Marginal Effects$

For the dummy variables the marginal effects don´t make sense. Discrete change should

estimated instead using excel.

+-------------------------------------------------------------------------+

| Summary of Marginal Effects for Ordered Probability Model (probit) |

+-------------------------------------------------------------------------+

Variable| Y=00 Y=01 Y=02 Y=03 Y=04 Y=05 Y=06 Y=07 |

--------------------------------------------------------------------------+

*DALONE -.3979 .0355 .0450 .0809 .2365

*FLEXIBL -.0703 -.0085 .0061 .0146 .0581

INCOME .0000 .0000 .0000 .0000 .0000

*OAGE -.0804 -.0154 .0058 .0160 .0740

CHANGE -.0231 -.0030 .0020 .0048 .0193

Phd in Transportation / Transport Demand Modelling 57/60

Example – Ordered Response Model

Brant test ORDERED

;Lhs= y label

;Rhs=one,xlabels(separated by commas)

;Brant test$

+------------------------------------------------+

| Brant specification test for equal coefficient |

| vectors in the ordered probit model. The model |

| implies that normit[Prob(y>j|x)]=mj - beta(j)*x|

| for all j = 0,..., 3. The chi squared test is |

| H0:beta(0) = beta(1) = ... beta( 3) |

| Chi squared test statistic = 13.74008 |

| Degrees of freedom = 15 |

| P value = .54533 |

+------------------------------------------------+

===========================================================================

Specification Tests for Individual Coefficients in Ordered Logit Model

(Note, Coefficients for values beyond y = 5 are not reported.)

Degrees of freedom for each of these tests is 3

===========================================================================

| Brant Test | Coefficients in implied model Prob(y > j). |

Variable| Chi-sq P value | 0 | 1 | 2 | 3 | 4 | 5 |

DALONE | 2.17 .53843 | 1.1814| 1.0059| .9745| .8310|

FLEXIBLE| 2.28 .51544 | .2276| .1178| .2419| .2443|

INCOME | 1.13 .76890 | .0000| .0000| .0000| .0000|

OAGE | 4.00 .26188 | .4150| .2768| .2385| -.0196|

CHANGE | 3.10 .37591 | .0904| .0853| .0272| .0644|

What can we conclude?

Phd in Transportation / Transport Demand Modelling 58/60

Example – Ordered Response Model

Wald test ORDERED

;Lhs= y label

;Rhs=one,xlabels(separated by commas)$

Wald

;fn1=b_dalone;fn2=b_income$

+-----------------------------------------------+

| WALD procedure. Estimates and standard errors |

| for nonlinear functions and joint test of |

| nonlinear restrictions. |

| Wald Statistic = 49.74881 |

| Prob. from Chi-squared[ 2] = .00000 |

+-----------------------------------------------+

+--------+--------------+----------------+--------+--------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]|

+--------+--------------+----------------+--------+--------+

Fncn(1) | 1.07608334 .15683714 6.861 .0000

Fncn(2) | .198148D-05 .139144D-05 1.424 .1544

What can we conclude?

Phd in Transportation / Transport Demand Modelling 59/60

Example – Ordered Response Model

Ordered Logit ORDERED

;Logit

;Lhs= y label

;Rhs=one,xlabels(separated by commas)$

+---------------------------------------------+

| Ordered Probability Model |

| Maximum Likelihood Estimates |

| Model estimated: Oct 26, 2010 at 11:59:45AM.|

| Dependent variable OPINION |

| Weighting variable None |

| Number of observations 322 |

| Iterations completed 11 |

| Log likelihood function -458.6460 |

| Number of parameters 6 |

| Info. Criterion: AIC = 2.88600 |

| Finite Sample: AIC = 2.88683 |

| Info. Criterion: BIC = 2.95633 |

| Info. Criterion:HQIC = 2.91408 |

| Restricted log likelihood -484.0105 |

| McFadden Pseudo R-squared .0524047 |

| Chi squared 50.72882 |

| Degrees of freedom 2 |

| Prob[ChiSqd > value] = .0000000 |

| Underlying probabilities based on Logistic |

+---------------------------------------------+

+---------------------------------------------+

| Ordered Probability Model |

| Maximum Likelihood Estimates |

| Model estimated: Oct 26, 2010 at 11:59:45AM.|

| Dependent variable OPINION |

| Weighting variable None |

| Number of observations 322 |

| Iterations completed 10 |

| Log likelihood function -459.1389 |

| Number of parameters 6 |

| Info. Criterion: AIC = 2.88906 |

| Finite Sample: AIC = 2.88989 |

| Info. Criterion: BIC = 2.95940 |

| Info. Criterion:HQIC = 2.91714 |

| Restricted log likelihood -484.0105 |

| McFadden Pseudo R-squared .0513863 |

| Chi squared 49.74300 |

| Degrees of freedom 2 |

| Prob[ChiSqd > value] = .0000000 |

| Underlying probabilities based on Normal |

+---------------------------------------------+

Ordered Logit Ordered Probit

Phd in Transportation / Transport Demand Modelling 60/60

Example – Ordered Response Model

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|

+--------+--------------+----------------+--------+--------+----------+

---------+Index function for probability

Constant| -.68463225 .27072789 -2.529 .0114

DALONE | 1.83872892 .26601268 6.912 .0000 .77018634

FLEXIBLE| .27397570 .20566894 1.332 .1828 .54037267

---------+Threshold parameters for index

Mu(1) | 1.25747687 .10533638 11.938 .0000

Mu(2) | 1.62939558 .11316012 14.399 .0000

Mu(3) | 2.21141414 .13503295 16.377 .0000

+--------+--------------+----------------+--------+--------+----------+

|Variable| Coefficient | Standard Error |b/St.Er.|P[|Z|>z]| Mean of X|

+--------+--------------+----------------+--------+--------+----------+

---------+Index function for probability

Constant| -.38909587 .15856689 -2.454 .0141

DALONE | 1.08069300 .15572418 6.940 .0000 .77018634

FLEXIBLE| .17114231 .12347051 1.386 .1657 .54037267

---------+Threshold parameters for index

Mu(1) | .75749605 .06465232 11.716 .0000

Mu(2) | .98507310 .06944107 14.186 .0000

Mu(3) | 1.33379198 .08050137 16.569 .0000

Ordered Logit

Ordered Probit