Guest User

Untitled

a guest
Dec 13th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. library(rms)
  2. library(foreign)
  3. df <- read.dta("https://stats.idre.ucla.edu/stat/data/ologit.dta")
  4. dd <- datadist(df)
  5. options(datadist = "dd")
  6. fit = lrm(apply ~ gpa, data = df, x = T, y = T)
  7. pred.fitted = round(predict(fit, type = "fitted"), 2)
  8. head(pred.fitted, 1) # predictions for the first subject
  9. # y >= somewhat likely 0.5; y >= very likely 0.12
  10. pred.ind = round(predict(fit, type = "fitted.ind"), 2)
  11. head(pred.ind, 1) # predictions for the first subject
  12. # y = unlikely 0.5; y = somewhat likely 0.38; y = very likely 0.12
  13. latex(fit, file = "") # see equation below
Add Comment
Please, Sign In to add comment