Carregando a Base de Dados CARROS.

load("C:/Users/VIC NOTE/Documents/Ciencia Politica/8 Periodo/Estatistica/bases_curso_estatistica/Base_de_dados-master/CARROS.RData")

Trabalhando com a base de dados.

summary(CARROS)
##    Kmporlitro      Cilindros         Preco             HP       
##  Min.   :10.40   Min.   :4.000   Min.   : 71.1   Min.   : 52.0  
##  1st Qu.:15.43   1st Qu.:4.000   1st Qu.:120.8   1st Qu.: 96.5  
##  Median :19.20   Median :6.000   Median :196.3   Median :123.0  
##  Mean   :20.09   Mean   :6.188   Mean   :230.7   Mean   :146.7  
##  3rd Qu.:22.80   3rd Qu.:8.000   3rd Qu.:326.0   3rd Qu.:180.0  
##  Max.   :33.90   Max.   :8.000   Max.   :472.0   Max.   :335.0  
##  Amperagem_circ_eletrico      Peso            RPM        Tipodecombustivel
##  Min.   :2.760           Min.   :1.513   Min.   :14.50   Min.   :0.0000   
##  1st Qu.:3.080           1st Qu.:2.581   1st Qu.:16.89   1st Qu.:0.0000   
##  Median :3.695           Median :3.325   Median :17.71   Median :0.0000   
##  Mean   :3.597           Mean   :3.217   Mean   :17.85   Mean   :0.4375   
##  3rd Qu.:3.920           3rd Qu.:3.610   3rd Qu.:18.90   3rd Qu.:1.0000   
##  Max.   :4.930           Max.   :5.424   Max.   :22.90   Max.   :1.0000   
##   TipodeMarcha     NumdeMarchas   NumdeValvulas  
##  Min.   :0.0000   Min.   :3.000   Min.   :1.000  
##  1st Qu.:0.0000   1st Qu.:3.000   1st Qu.:2.000  
##  Median :0.0000   Median :4.000   Median :2.000  
##  Mean   :0.4062   Mean   :3.688   Mean   :2.812  
##  3rd Qu.:1.0000   3rd Qu.:4.000   3rd Qu.:4.000  
##  Max.   :1.0000   Max.   :5.000   Max.   :8.000
mean(CARROS$Kmporlitro)
## [1] 20.09062
var(CARROS$Kmporlitro)
## [1] 36.3241
sd(CARROS$Kmporlitro)
## [1] 6.026948
mean(CARROS$Preco)
## [1] 230.7219
sd(CARROS$Preco)
## [1] 123.9387
conjunto1<-c(4,4,4,10,16,16,16)
conjunto2<-c(4,6,8,10,12,14,16)
conjunto3<-c(7,8,9,10,11,12,13)
conjunto4<-c(10,10,10,10,10,10,10)

mean(conjunto1)
## [1] 10
mean(conjunto2)
## [1] 10
mean(conjunto3)
## [1] 10
mean(conjunto4)
## [1] 10
eixo1<-c(1,1,1,1,1,1,1)
eixo2<-c(2,2,2,2,2,2,2)
eixo3<-c(3,3,3,3,3,3,3)
eixo4<-c(4,4,4,4,4,4,4)

Criaçao grafica do cruzamento de 4 conjuntos.

plot(conjunto1,eixo1, col="red",ylim=c(0,5),pch=16, main = "Quatro conjuntos de dados",ylab="conjuntos", xlab="valores")
points(conjunto2,eixo2, col="blue",pch=16)
points(conjunto3,eixo3, col="green",pch=16)
points(conjunto4,eixo4, col="black",pch=16)

Análise com duas variaveis - Qualitativa e Quantitativa.

Carregando a Base de Dados Prefeito Fluminense.

load("C:/Users/VIC NOTE/Documents/Ciencia Politica/8 Periodo/Estatistica/bases_curso_estatistica/Base_de_dados-master/prefeitofluminense.RData")

Corrigindo a base de dados tem duas entradas para dois candidatos porque foram os que seguiram para a disputa do 2º turno.

prefeitofluminense<-prefeitofluminense[prefeitofluminense$COD_SIT_TOT_TURNO!=6,]

Criando Tabelas.

tab_sexo<-table(prefeitofluminense$DESCRICAO_SEXO,prefeitofluminense$DESC_SIT_TOT_TURNO)
tab_sexo
##            
##             #NULO# ELEITO NÃO ELEITO
##   FEMININO       0      9         39
##   MASCULINO      8     83        292
tab_cor<-table(prefeitofluminense$DESCRICAO_COR_RACA, prefeitofluminense$DESC_SIT_TOT_TURNO)
tab_cor
##           
##            #NULO# ELEITO NÃO ELEITO
##   AMARELA       0      0          1
##   BRANCA        6     79        257
##   INDÍGENA      0      0          1
##   PARDA         2     13         56
##   PRETA         0      0         16
tab_educa<-table(prefeitofluminense$DESCRICAO_GRAU_INSTRUCAO, prefeitofluminense$DESC_SIT_TOT_TURNO)
tab_educa
##                                
##                                 #NULO# ELEITO NÃO ELEITO
##   ENSINO FUNDAMENTAL COMPLETO        0      6         13
##   ENSINO FUNDAMENTAL INCOMPLETO      0      3          6
##   ENSINO MÉDIO COMPLETO              4     19         75
##   ENSINO MÉDIO INCOMPLETO            0      2          8
##   SUPERIOR COMPLETO                  4     53        195
##   SUPERIOR INCOMPLETO                0      9         34

Criando o Percentual.

round(prop.table(tab_sexo,1)*100,2)
##            
##             #NULO# ELEITO NÃO ELEITO
##   FEMININO    0.00  18.75      81.25
##   MASCULINO   2.09  21.67      76.24
round(prop.table(tab_cor,1)*100,2)
##           
##            #NULO# ELEITO NÃO ELEITO
##   AMARELA    0.00   0.00     100.00
##   BRANCA     1.75  23.10      75.15
##   INDÍGENA   0.00   0.00     100.00
##   PARDA      2.82  18.31      78.87
##   PRETA      0.00   0.00     100.00
round(prop.table(tab_educa,1)*100,2)
##                                
##                                 #NULO# ELEITO NÃO ELEITO
##   ENSINO FUNDAMENTAL COMPLETO     0.00  31.58      68.42
##   ENSINO FUNDAMENTAL INCOMPLETO   0.00  33.33      66.67
##   ENSINO MÉDIO COMPLETO           4.08  19.39      76.53
##   ENSINO MÉDIO INCOMPLETO         0.00  20.00      80.00
##   SUPERIOR COMPLETO               1.59  21.03      77.38
##   SUPERIOR INCOMPLETO             0.00  20.93      79.07
round(prop.table(tab_educa,2)*100,2)
##                                
##                                 #NULO# ELEITO NÃO ELEITO
##   ENSINO FUNDAMENTAL COMPLETO     0.00   6.52       3.93
##   ENSINO FUNDAMENTAL INCOMPLETO   0.00   3.26       1.81
##   ENSINO MÉDIO COMPLETO          50.00  20.65      22.66
##   ENSINO MÉDIO INCOMPLETO         0.00   2.17       2.42
##   SUPERIOR COMPLETO              50.00  57.61      58.91
##   SUPERIOR INCOMPLETO             0.00   9.78      10.27

```