Documentos de Académico
Documentos de Profesional
Documentos de Cultura
FACULTAD DE INGENIERIA
FINAL WORK
ESTADISTICA 1
AUTOR
WILLIAM DAVID CAMPO LÓPEZ - 2021216103
DAYANA MISHELL NARVAEZ PATIÑO - 2021216100
KEVIN TELLO MORALES - 2021216021
JUAN DAVID VANEGAS CARO - 2021216116
JUAN SEBASTIÁN BUSTAMANTE MANJARRES - 2021216015
DOCENTE
CARLOS MIGUEL RODRÍGUEZ MORENO
GRUPO 5
Load the packages LSD, plyr, psych, ggplot2, MASS, plotrix and Publish on R.
1. Use the rnorm command, run a sample of 10000 numbers for two variables X and
Y, the X variable with mean 8 and standard deviation 10, and the Y variable with
mean 3 and standard deviation 7:
En este grafico se puede observar que la mayor parte de los datos están concentrados, por lo que hay
poca dispersión.
b) HeatScatter with the command heatscatter(x,y)
En el gráfico de dispersión de calor se puede observar de mejor forma, como los datos están
concentrados la mayoría en el centro del gráfico, muy cerca uno del otro, lo que indica baja dispersión
c) SmoothScatter with the command smoothScatter(x,y)
Al igual que con el gráfico anterior, con el gráfico de dispersión suave podemos observar que hay
una alta concentración de los datos, pero además se puede ver los datos atípicos de las áreas con las
densidades regionales menores.
4. Draw Boxplots for each variable, conclude.
En el gráfico de caja de la variable x se puede observar que los datos siguen los parámetros iniciales
de media 8 y desviación estándar 10, además nos muestra que los datos atípicos se encuentran
cercanos a valores de 40 y -20.
En el gráfico de caja de la variable x se puede observar que los datos siguen los parámetros iniciales
de media 3 y desviación estándar 7, además nos muestra que los datos atípicos se encuentran
cercanos a valores de 25 y -15.
Load the sleep dataframe from the package datasets.
5. What the dataset parameters represent?
Datos que muestran el efecto de dos fármacos soporíferos (aumento de las horas de sueño respecto al
control) en 10 pacientes.
6. Draw boxplots and 90% confidence intervals (with the command error.bars (psych
package)) of the extra variable in function of the independent variable group. Use
the ddply function (plry package) for the confidence intervals and its parameters.
Conclude.
error.bars(sleep, alpha = 0.1)
7. Draw a coplot or ggplot with the ggplot2 library, relate the extra variable (response)
with its two independent variables. Interpret the graphics, a relation between the
variables can be inferred.
Con la información visual que nos proporcionan los gráficos, se puede inferir que hay relación entre
las variables extra y group.
9. For each variable, calculate the mean, median, standard deviation, variance, min,
max, range.
The next database refers to the differents variables of the San Andrés homes in poverty
(2016 year):
10. The file “hogares_2016.txt” contains the database necessary for the next
questions, download it in your working directory and read it with the command
read.delim(“hogares_2016.txt”,header=T)
11. Interpret the read dataframe, how many observations have? how many variables?
El dataframe contiene información de los hogares de alguna población en el año 2016, este tiene
3326 observaciones y 21 variables.
12. Identify the class of the variables 5 and 6, are those string or numbers?
Las variables 5 y 6 son p5010 y p5090 respectivamente. Ambas variables son de tipo numérico.
Based on what was previously applied, present a descriptive report on the official results
of the parliamentary elections in Colombia for the year 2022.
partido votos
1 2692999
2 2201183
3 2078858
4 1906021
5 1874762
6 1586284
7 1494098
8 564737
9 417300
10 352704
11 108657
12 55046
13 36346
14 30066
15 24862
16 11915
17 1052395
18 732003
19 524982
datos_v = read.delim("votaciones_2022.txt")
y1 = with(datos_v, partido)
x1 = with(datos_v, votos)
Para y1:
> mean(y1)
[1] 10
> median(y1)
[1] 10
> sd(y1)
[1] 5.627314
> var(y1)
[1] 31.66667
> min(y1)
[1] 1
> max(y1)
[1] 19
> max(y1)-min(y1)
[1] 18
> range(y1)
[1] 1 19
Para x1:
> mean(x1)
[1] 933958.8
> median(x1)
[1] 564737
> sd(x1)
[1] 891201.8
> var(x1)
[1] 794240578337
> min(x1)
[1] 11915
> max(x1)
[1] 2692999
> max(x1)-min(x1)
[1] 2681084
> range(x1)
[1] 11915 2692999
Graficas: