Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. > x.out <- setx(mod, credit=1)
  2. Error in dta[complete.cases(mf), names(dta) %in% vars, drop = FALSE] :
  3. incorrect number of dimensions
  4.  
  5. data=read.table("https://onlinecourses.science.psu.edu/stat504/sites/onlinecourses.science.psu.edu.stat504/files/lesson07/cheese.dat",col.names=c("cheese","response","count"))
  6. data$response=factor(data$response, ordered=T)
  7. fit=polr(response ~ cheese, weights=count, data=data)
  8. summary(fit)
  9. z=summary(fit)$coefficients/summary(fit)$standard.errors
  10. p=(1 - pnorm(abs(z), 0, 1)) * 2 # 2-tailed Wald z tests to test significance of coefficients
  11. p
  12. Anova(fit, type="III") # likelihood ratio tests for effect of different factors
  13. library(colorRamps)
  14. plot(allEffects(fit),ylab="Response",rescale.axis=F,style="stacked",colors=colorRampPalette(c("white","red"))(9))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement