Carregamento e Manipulação de Dados mtcars

Neste exercício, vamos carregar o conjunto de dados mtcars

Operações

Média do Consumo de Combustível (km/l): \[\bar{x} = \frac{1}{n} \sum_{i=1}^n x_i = \frac{1}{n} \sum_{i=1}^{n} \text{mpg}_i = \textbf{8.54 km/l}\]

Correlação entre Peso e Consumo: \[r_{xy} = \frac{\text{Cov}(x, y)}{\sigma_x \cdot \sigma_y} = \textbf{-0.87}\]

Desvio Padrão do Peso (kg): \[\sigma_x = \sqrt{\frac{1}{n} \sum_{i=1}^n (x_i - \bar{x})^2} = \textbf{443.82 kg}\]

Relação Peso-Potência Média (kg/cv): \[\text{Média} = \frac{1}{n} \sum_{i=1}^n \frac{\text{Peso}_i}{\text{Potência}_i} = \textbf{11.25 kg/cv}\]

Média Ponderada do Consumo (km/l): \[\bar{x}_\text{ponderada} = \frac{\sum_{i=1}^n w_i x_i}{\sum_{i=1}^n w_i} = \textbf{7.89 km/l}\]

Carros com melhores com melhor quilômetro por litro

Toyota Corolla 1 lugar°

toyota.
toyota.

Fiat 128 2 lugar°

fiat128.
fiat128.

Referências

Grolemund and Wickham (2014) Xie (2017) Xie, Allaire, and Grolemund (2018) James et al. (2013) Peng (2016)

Grolemund, Garrett, and Hadley Wickham. 2014. “A Cognitive Interpretation of Data Analysis.” International Statistical Review 82 (2): 184–204.
James, Gareth, Daniela Witten, Trevor Hastie, Robert Tibshirani, et al. 2013. An Introduction to Statistical Learning. Vol. 112. Springer.
Peng, Roger. 2016. Exploratory Data Analysis with r. Lulu. com.
Xie, Yihui. 2017. Dynamic Documents with r and Knitr. Chapman; Hall/CRC.
Xie, Yihui, Joseph J Allaire, and Garrett Grolemund. 2018. R Markdown: The Definitive Guide. Chapman; Hall/CRC.