Skip to content

Instantly share code, notes, and snippets.

@andrewheiss
Created March 31, 2012 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewheiss/2259416 to your computer and use it in GitHub Desktop.
Save andrewheiss/2259416 to your computer and use it in GitHub Desktop.
Ordinal logistic regression
library(rms) # This is the library that does all the orginal logistic regression magic
EMC <- latest.EMC.2011.clean.v2 # Make a copy of the data frame with a shorter name
model <- lrm(lifeoverall ~ fire + med + streetrepair + streetclean, data=EMC) # Fit an ordinal logistic regression model
model # General model summary
exp(coefficients(model)) # Factor change coefficients?
anova(model) # Wald statistics
Predict(model, fire=0, med=0, streetrepair=0, streetclean=0) # Predict yhat based on given values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment