Skip to content

Instantly share code, notes, and snippets.

View DATAUNIRIO's full-sized avatar

DATAUNIRIO DATAUNIRIO

View GitHub Profile
---
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"
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")
#-----------------------------------------------------
@DATAUNIRIO
DATAUNIRIO / aula_7_Eng.R
Created May 16, 2022 14:50
aula_7_Eng.R
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)
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) %>%
População Alvo: Alunos(as)
Provavelmente + alunos da engenharia civil
1. (email institucional)
Amostra por conveniencia
@DATAUNIRIO
DATAUNIRIO / aula_9_Eng.R
Created May 30, 2022 14:58
Teste qui-quadrado e mapa
### 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
# 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")
# 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) %>%
# 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
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)