This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see http://rmarkdown.rstudio.com.
When you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:
summary(cars)
## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00
You can also embed plots, for example:
Note that the echo = FALSE parameter was added to the
code chunk to prevent printing of the R code that generated the plot.
library(tidyverse) library(kableExtra)
#RESPUESTA: Si tengo datos asimétricos, lo más factible es utilizar los estadísticos de medidas de centralidad (media, mediana y moda), posición (máxima, mínima, cuartiles y percentiles) y de dispersión (recorrido, rango intercuartílico, desviación típica y varianza).
#PREGUNTA 2. Cuando los datos presentan potenciales “outliers”, ¿qué estadístico(s) emplearías?
#RESPUESTA: Los datos que presentan potenciales “outliers”, es conveniente utilizar los estadísticos de posición como lo son los cuartiles, deciles y percentiles, que dan valores considerablemente más estables frente a valores extremos.
#PREGUNTA 3. Un boxplot, ¿permite identificar rápidamente la desviación estándar? ¿por qué?
#RESPUESTA: El gráfico boxplot no se puede identificar la desviación estándar, sino que este se centra es mostrar la distribución que tienen los datos a través del rango intercuartílico, mostrando con ello la mediana, primer y tercer cuartil, limites superiores e inferiores y aquellos datos atípicos.
#PREGUNTA 4. ¿Con qué otros nombres podemos referirnos a las variables cualitativas?
#RESPUESTA: A las variables cualitativas también se le nombran como variables categóricas y están medidas en una escala nominal.
library(tidyverse) library(kableExtra) library(car) data(Davis) attach(Davis) Davis
library(ggplot2) library(grid) library(gridExtra) library(plyr) library(dplyr) library(magrittr)
Davis %>% head() %>% kable() %>% kable_styling()
Davis %>% head() %>% kable() %>% kable_styling(“striped”, full_width=FALSE, position=“center”, font_size=16,) %>% row_spec(0, monospace=T, bold=T, color=“orange”) %>% row_spec(1:6, color=“white”, background=“blue”) %>% column_spec(1:5, bold= T, color= “green”, background= “white”)
str(Davis)
Davis\(weight=as.numeric(Davis\)weight) Davis\(height=as.numeric(Davis\)height) Davis\(repwt=as.numeric(Davis\)repwt) Davis\(repht=as.numeric(Davis\)repht) str(Davis)
dim(Davis) str(Davis)
cc= Davis %>% arrange(weight, height) cc %>% kable() %>% kable_styling()
##Ver el resumen como factores summary(select_if(Davis, is.factor))
##Ver el resumen como numeros summary(select_if(Davis, is.numeric))
library(prettyR) Mode(weight) library(modeest) mfv(weight) table(weight) mean(weight) median(weight)
Mode(height) mfv(height) table(height) mean(height) median(height)
library(plotly)
boxplot(Davis\(weight, frame.plot=TRUE, na.rm=TRUE)\)out
ggplot (Davis, aes(x=sex, y=weight, fill=factor(height)))+geom_boxplot()
p= ggplot(Davis, aes(x=sex, y=weight, fill=sex))+geom_boxplot()
plotly::ggplotly(p)
hist(x = Davis$weight, main = “Histograma”, xlab = “F”, ylab = “Frecuencia”, col = “purple”)
library (stats)
stats::qqnorm(Davis\(weight, main="Q-Q Plot de weight", col="red") stats::qqline(Davis\)weight)