Professional Documents
Culture Documents
SOLUCIÓN 1:
datos=read.table("sociodemographic1.csv", header=TRUE, sep=";")
#Genero vs Estatus
Genestat=table(datos$Genero,datos$Estatus)
barplot(Genestat,beside = TRUE,legend=row.names(Genestat), col =
c("yellow","red"))
#Estado vs Grado
EstGrad=table(datos$Estado,datos$Grado)
barplot(EstGrad,beside = TRUE,legend=row.names(Genestat), col =
c("yellow","red"))
text(x=1.5, y=17, "30", cex = 1)
text(x=2.5, y=7, "12", cex = 1)
text(x=4.5, y=3, "5", cex = 1)
text(x=5.5, y=5, "10", cex = 1)
text(x=7.5, y=13, "25", cex = 1)
text(x=8.5, y=8, "14", cex = 1)
#Grado vs Color
GraCol=table(datos$Grado,datos$Color)
barplot(GraCol,beside = TRUE,legend=row.names(Genestat), col =
c("yellow","red"))
#Color vs Genero
ColGen=table(datos$Color,datos$Genero)
barplot(ColGen,beside = TRUE,legend=row.names(Genestat), col =
c("yellow","red"))
SOLUCIÓN 2:
NORMANO<- 0.70
NORMAPM<- 1.50
NO<-c(0.77,0.88,0.44,0.74,0.94,0.76,0.61,0.94,0.76,0.53,0.48)
PM<-c(1.75,1.53,1.28,1.34,1.66,1.73,1.25,1.47,1.31,1.14,1.02)
t.test(NO, mu=NORMANO, conf.level = 0.90)
t.test(PM, mu=NORMAPM, conf.level = 0.90)
RESULTADOS:
> NORMANO<- 0.70
> NORMAPM<- 1.50
> NO<-c(0.77,0.88,0.44,0.74,0.94,0.76,0.61,0.94,0.76,0.53,0.48)
> PM<-c(1.75,1.53,1.28,1.34,1.66,1.73,1.25,1.47,1.31,1.14,1.02)
> t.test(NO, mu=NORMANO, conf.level = 0.90)
data: NO
t = 0.25594, df = 10, p-value = 0.8032
alternative hypothesis: true mean is not equal to 0.7
90 percent confidence interval:
0.6170698 0.8102029
sample estimates:
mean of x
0.7136364
*EL P-VALUE ES MAYOR A 0.1…0.80>0.1, OSEA NO EXISTE DIFERENCIA SIGNIFI
CATIVA AL 90% ENTRE LA NORMA Y LA MEDIA DE LOS RESULTADOS.
data: PM
t = -1.2761, df = 10, p-value = 0.2308
alternative hypothesis: true mean is not equal to 1.5
90 percent confidence interval:
1.275571 1.538975
sample estimates:
mean of x
1.407273
**EL P-VALUE ES MAYOR A 0.1…0.23>0.1, OSEA NO EXISTE DIFERENCIA SIGNIF
ICATIVA AL 90% ENTRE LA NORMA Y LA MEDIA DE LOS RESULTADOS.
SOLUCIÓN 3:
NORMANO<- 0.70
NORMAPM<- 1.50
NO<-c(0.77,0.88,0.44,0.74,0.94,0.76,0.61,0.94,0.76,0.53,0.48)
PM<-c(1.75,1.53,1.28,1.34,1.66,1.73,1.25,1.47,1.31,1.14,1.02)
NO2<-c(0.52,0.78,0.49,0.63,0.93,0.85,0.59,0.66,0.78,0.57,0.87)
PM2<-c(1.83,1.74,1.45,1.16,1.47,1.76,1.51,1.37,1.07,0.88,1.62)
t.test(NO2, mu=NORMANO, conf.level = 0.99)
t.test(PM2, mu=NORMAPM, conf.level = 0.99)
#T-PAIRED
t.test(NO,NO2,paired = TRUE, conf.level = 0.99)
t.test(PM,PM2,paired = TRUE, conf.level = 0.99)
RESULTADOS:
> NORMANO<- 0.70
> NORMAPM<- 1.50
> NO<-c(0.77,0.88,0.44,0.74,0.94,0.76,0.61,0.94,0.76,0.53,0.48)
> PM<-c(1.75,1.53,1.28,1.34,1.66,1.73,1.25,1.47,1.31,1.14,1.02)
> NO2<-c(0.52,0.78,0.49,0.63,0.93,0.85,0.59,0.66,0.78,0.57,0.87)
> PM2<-c(1.83,1.74,1.45,1.16,1.47,1.76,1.51,1.37,1.07,0.88,1.62)
> t.test(NO2, mu=NORMANO, conf.level = 0.99)
data: NO2
t = -0.059771, df = 10, p-value = 0.9535
alternative hypothesis: true mean is not equal to 0.7
99 percent confidence interval:
0.5526628 0.8418827
sample estimates:
mean of x
0.6972727
**EL P-VALUE ES MAYOR A 0.01…0.95>0.01, OSEA NO EXISTE DIFERENCIA SIGN
IFICATIVA AL 99% ENTRE LA NORMA Y LA MEDIA DE LOS RESULTADOS.
> #T-PAIRED
> t.test(NO,NO2,paired = TRUE, conf.level = 0.99)
Paired t-test
Paired t-test
SOLUCIÓN 4:
# ANOVA
anova<-read.table("anova.csv",header = TRUE,sep=",")
aov(CONCENTRACIÓN~RÍOS, data=anova)
resanova<-aov(CONCENTRACIÓN~RÍOS, data=anova)
summary(resanova)
Resultados
> anova<-read.table("anova.csv",header = TRUE,sep=",")
> View(anova)
> aov(CONCENTRACIÓN~RÍOS, data=anova)
Call:
aov(formula = CONCENTRACIÓN ~ RÍOS, data = anova)
Terms:
RÍOS Residuals
Sum of Squares 3.75475 14.60300
Deg. of Freedom 3 36
#TUKEY
> TukeyHSD(resanova)
Tukey multiple comparisons of means
95% family-wise confidence level
$RÍOS
diff lwr upr p adj
Huallaga-Amazonas 0.86 0.09288977 1.6271102 0.0229487
MANTARO-Amazonas 0.36 -0.40711023 1.1271102 0.5912618
Rimac-Amazonas 0.35 -0.41711023 1.1171102 0.6130126
MANTARO-Huallaga -0.50 -1.26711023 0.2671102 0.3110605
Rimac-Huallaga -0.51 -1.27711023 0.2571102 0.2943724
Rimac-MANTARO -0.01 -0.77711023 0.7571102 0.9999841
#CUADRO DE CAJAS
> boxplot(CONCENTRACIÓN~RÍOS, data=anova,col=c("pink","red","yellow"))
CUADRO 2
#ANOVA
anova<-read.table("anova2.csv",header = TRUE,sep=",")
aov(Concentración~Ríos, data=anova)
resanova<-aov(Concentración~Ríos, data=anova)
summary(resanova)
Resultados
> anova<-read.table("anova2.csv",header = TRUE,sep=",")
> aov(Concentración~Ríos, data=anova)
Call:
aov(formula = Concentración ~ Ríos, data = anova)
Terms:
Ríos Residuals
Sum of Squares 1.165807 0.805780
Deg. of Freedom 2 27
#TUKEY
TukeyHSD(resanova)
Resultados
> TukeyHSD(resanova)
Tukey multiple comparisons of means
95% family-wise confidence level
$Ríos
diff lwr upr p adj
Piura-Ene -0.425 -0.6165539 -0.2334461 0.0000231
Tumbes-Ene -0.014 -0.2055539 0.1775539 0.9820717
Tumbes-Piura 0.411 0.2194461 0.6025539 0.0000375
#BOXPLOT
> boxplot(Concentración~Ríos, data=anova,col=c("pink","red","yellow"))