SHARE
TWEET

Qualitativa vs Qualitativa

a guest Apr 18th, 2019 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Variavel Qualitativa vs Variavel Qualitativa
  2.  
  3. #######################################################################
  4. # Tabela de Frequencias (absoluta e relativa)
  5. #######################################################################
  6.  
  7. # Tabela Cruzada
  8.  
  9. #o primeiro presenta parte horizontal e o segundo a vertical
  10.  
  11. f.absolutas <- table(cancer$Grau,cancer$Local)
  12. f.relativas <- f.absolutas/c(sum(f.absolutas[1,]),sum(f.absolutas[2,]),sum(f.absolutas[3,]))
  13.  
  14. #######################################################################
  15. # Diagrama de Colunas
  16. #######################################################################
  17.  
  18. barplot(table(cancer$Local),ylab="Frequencia Absoluta",xlab="Hipertensao")
  19.  
  20. barplot(table(cancer$Local)/nrow(dados),ylab="Frequencia Relativa",xlab="Hipertensao",col=c("green","red"))
  21.  
  22. # Grafico de barras Cruzados
  23.  
  24. f.absolutas <- table(cancer$Grau,cancer$Local)
  25. f.relativas <- f.absolutas/c(sum(f.absolutas[1,]),sum(f.absolutas[2,]))
  26.  
  27. bmp("questaoe.bmp")
  28. barplot(f.relativas,beside=T,col=c("orange","yellow","blue"),xlab="Grau de diferenciacao do tumor",ylab="Frequencia Relativa",names.arg=c("Arco", "Fossa", "Faringe"))
  29. legend("topleft",fill=c("orange","yellow","blue"),legend=c("Bem diferenciado","Moderadamante","Pouco"),bty="n")
  30. graphics.off()
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