daily pastebin goal
39%
SHARE
TWEET

Untitled

a guest Dec 13th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top