This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| title: "Análise de variável quantitativa por qualitativa" | |
| subtitle: "Uma introdução ao boxplot, dplyr e flextable" | |
| author: "Prof. Steven Dutt Ross" | |
| date: "02/05/2022" | |
| output: | |
| html_document: | |
| theme: | |
| bg: "lightyellow" | |
| fg: "red" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dados <-data.frame(x=c(2,3,4,5,5,6,7,8), | |
| y=c(4,7,9,10,11,11,13,15)) | |
| plot(dados$x,dados$y) | |
| cor(dados$x,dados$y) | |
| cor(dados$x,dados$y, method="spearman") | |
| #----------------------------------------------------- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(RcmdrMisc) | |
| .x <- seq(-3.291, 3.291, length.out=1000) | |
| plotDistr(.x, dnorm(.x, mean=0, sd=1), cdf=FALSE, xlab="x", ylab="Densidade",regions=list(c(0, 4)), col=c('#0080C0', '#BEBEBE'), legend=FALSE) | |
| # X ~ N(Mu,Sigma) | |
| # Z ~ N(0,1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(leaflet) | |
| leaflet() %>% | |
| addTiles() %>% | |
| addCircles(lng=-42.5292995, lat=-22.2944243, | |
| popup="Escola C.E. Dr. João Bazet", radius = 50) %>% | |
| setView(lng=-42.5292995, lat=-22.2944243,zoom=16) | |
| leaflet() %>% | |
| addTiles() %>% | |
| addProviderTiles(providers$CartoDB.DarkMatter) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| População Alvo: Alunos(as) | |
| Provavelmente + alunos da engenharia civil | |
| 1. (email institucional) | |
| Amostra por conveniencia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### Criação da tabela | |
| tabela <- as.table(rbind(c(117,54), | |
| c(950,348))) | |
| tabela | |
| ### Rótulos para tabela | |
| dimnames(tabela) <- list(mortalidade = c("Vivo", "Morto"), | |
| fumar = c("não fuma","fuma")) | |
| #---------------------------------------------------------- | |
| # Hipóteses |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Importar | |
| library(readxl) | |
| QE <- read_excel("C:/Users/Hp/Desktop/Base_de_dados-master/Questionario_Estresse.xls") | |
| View(QE) | |
| # Transformar | |
| QE$Mora_pais <- ifelse(QE$Mora_pais==1,"Sim","Não") | |
| QE$RJ <- ifelse(QE$RJ==1,"Sim","Não") | |
| QE$Namorado_a <- ifelse(QE$Namorado_a==1,"Sim","Não") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # remotes::install_github("thomas-neitmann/ggcharts", upgrade = "never") | |
| library(dplyr) | |
| library(ggcharts) | |
| biomedicalrevenue %>% | |
| filter(year %in% c(2012, 2015, 2018)) %>% | |
| bar_chart(x = company, y = revenue, facet = year, top_n = 10) | |
| biomedicalrevenue %>% filter(year == 2018) %>% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Carrega o pacote | |
| library(deflateBR) | |
| deflate(nominal_values = 1091.01, | |
| nominal_dates = as.Date("2015-01-01"), | |
| real_date = "01/2022") | |
| # R$ 1653.53 | |
| # R$ 1759,56 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| salario <- rnorm(200,4000,15) | |
| salario <- round(salario,2) | |
| anos_de_empresa<- salario/1000 + rnorm(200,0,5) | |
| anos_de_empresa<- anos_de_empresa + 10 | |
| anos_de_empresa<- round(anos_de_empresa) | |
| plot(anos_de_empresa,salario) | |
| min(anos_de_empresa) | |
| modelo <- lm(salario ~ anos_de_empresa) | |
| bptest(modelo) |