* Adapted from Ordinal regression models by Williams & Quiroz * https://methods.sagepub.com/Foundations/ordinal-regression-models * Extended ologit using European Social Survey GB 2012 * Open the data, do descriptive stats, drop cases with missing use https://www3.nd.edu/~rwilliam/statafiles/ESSGB2012Extract.dta, clear fre *, tab(5) keep if !missing(hmsfree, lifeworse, hincfel, feelecon, agedecade, female) *** Problem 1 Ologit * Constrained model -- demographic vars only ologit hmsfree agedecade female, cformat(%9.3f) nolog est store constrained * Unconstrained model -- Attitudes + demographic vars ologit hmsfree lifeworse hincfel feelecon agedecade i.female, cformat(%9.3f) nolog est store unconstrained * Test to see if attitude vars improve the model lrtest constrained unconstrained, stats * Now get margins, adjusted predictions. margins & mtable * tell you pretty much the same thing but the output from mtable is * much easier to read. margins female mtable, at(female=(0 1)) dec(4) margins, dydx(female) mtable, dydx(female) dec(4) * Test model assumptions brant, detail *** Problem 2 Mlogit mlogit hmsfree lifeworse hincfel feelecon agedecade i.female, cformat(%9.3f) nolog b(1) mlogtest, lr mlogtest, lrcomb * Problem 3 Shuttle data using Interval Regression use https://www3.nd.edu/~rwilliam/statafiles/shuttle2.dta, clear recode distress (1 = .)(2=1)(3=3), gen(dlow) recode distress (1=0)(2=2)(3=.), gen(dhigh) intreg dlow dhigh date temp, cformat(%9.4f) nolog oprobit distress date temp, nolog cformat(%9.4f)