Está en la página 1de 7

24/4/23, 18:14 CLASE 6

CLASE 6
GABRIELA VACA ARROBO
2023-04-24
#PRUEBA DE LA MEDIA POBLACIONAL: DESVIACIÓN ESTÁNDAR DE LA POBLACIÓN DESCONOCIDA

#Ejemplo 1 #El departamento de quejas de McFarland Insurance Company informa que el costo medio para
tramitar una queja es de $60. Una comparación en la industria demostró que esta cantidad es mayor que en
las demás compañías de seguros, así que la compañía tomó medidas para reducir gastos. Para evaluar el
efecto de las medidas de reducción de gastos, el supervisor del departamento de quejas seleccionó una
muestra aleatoria de 26 quejas atendidas el mes pasado.La información de la muestra aparece a
continuación.

#DISTRIBUTION T STUDENT

z1<-seq(58,62,0.1)
z1

## [1] 58.0 58.1 58.2 58.3 58.4 58.5 58.6 58.7 58.8 58.9 59.0 59.1 59.2 59.3 59.4
## [16] 59.5 59.6 59.7 59.8 59.9 60.0 60.1 60.2 60.3 60.4 60.5 60.6 60.7 60.8 60.9
## [31] 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 61.8 61.9 62.0

z1x<-c(58,z1,62)
z1x

## [1] 58.0 58.0 58.1 58.2 58.3 58.4 58.5 58.6 58.7 58.8 58.9 59.0 59.1 59.2 59.3
## [16] 59.4 59.5 59.6 59.7 59.8 59.9 60.0 60.1 60.2 60.3 60.4 60.5 60.6 60.7 60.8
## [31] 60.9 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 61.8 61.9 62.0 62.0

z1y<-c(-0,dnorm(z1,63,4.4),0)
curve(dnorm(x,63,4.4),xlim = c(40,80))
polygon(z1x,z1y,col="red")

file:///Users/gabynicole/CLASE-6.html 1/7
24/4/23, 18:14 CLASE 6

t1<-c(45,48,48,58,38,49,53,54,51,76,62,67,51,58,40,63,56,59,43,78,63,56,61,64,69,57)
t1

## [1] 45 48 48 58 38 49 53 54 51 76 62 67 51 58 40 63 56 59 43 78 63 56 61 64 69
## [26] 57

t.test(t1)

##
## One Sample t-test
##
## data: t1
## t = 28.654, df = 25, p-value < 2.2e-16
## alternative hypothesis: true mean is not equal to 0
## 95 percent confidence interval:
## 52.36759 60.47857
## sample estimates:
## mean of x
## 56.42308

qt(0.01,df=25)

## [1] -2.485107

##GRAFICAR

file:///Users/gabynicole/CLASE-6.html 2/7
24/4/23, 18:14 CLASE 6

sdp1<-sd(t1)
sdp1

## [1] 10.04061

z1<-seq(58,62,0.1)
z1

## [1] 58.0 58.1 58.2 58.3 58.4 58.5 58.6 58.7 58.8 58.9 59.0 59.1 59.2 59.3 59.4
## [16] 59.5 59.6 59.7 59.8 59.9 60.0 60.1 60.2 60.3 60.4 60.5 60.6 60.7 60.8 60.9
## [31] 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 61.8 61.9 62.0

zlx<-c(58,z1,62)
zlx

## [1] 58.0 58.0 58.1 58.2 58.3 58.4 58.5 58.6 58.7 58.8 58.9 59.0 59.1 59.2 59.3
## [16] 59.4 59.5 59.6 59.7 59.8 59.9 60.0 60.1 60.2 60.3 60.4 60.5 60.6 60.7 60.8
## [31] 60.9 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 61.8 61.9 62.0 62.0

zly<-c(-0,dnorm(z1,63,4,4),0)
curve(dnorm(x,43,10.04),xlim = c(5,80))
polygon(zlx,zly,col= "purple")

file:///Users/gabynicole/CLASE-6.html 3/7
24/4/23, 18:14 CLASE 6

t1<-seq(5,62,1)
t1

## [1] 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
## [26] 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
## [51] 55 56 57 58 59 60 61 62

tlx<-c(5,t1,62)
tlx

## [1] 5 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
## [26] 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
## [51] 54 55 56 57 58 59 60 61 62 62

tly<-c(-0,dnorm(t1,62,10,04),04)
tly

## [1] 0.000000 -19.466524 -18.901524 -18.346524 -17.801524 -17.266524


## [7] -16.741524 -16.226524 -15.721524 -15.226524 -14.741524 -14.266524
## [13] -13.801524 -13.346524 -12.901524 -12.466524 -12.041524 -11.626524
## [19] -11.221524 -10.826524 -10.441524 -10.066524 -9.701524 -9.346524
## [25] -9.001524 -8.666524 -8.341524 -8.026524 -7.721524 -7.426524
## [31] -7.141524 -6.866524 -6.601524 -6.346524 -6.101524 -5.866524
## [37] -5.641524 -5.426524 -5.221524 -5.026524 -4.841524 -4.666524
## [43] -4.501524 -4.346524 -4.201524 -4.066524 -3.941524 -3.826524
## [49] -3.721524 -3.626524 -3.541524 -3.466524 -3.401524 -3.346524
## [55] -3.301524 -3.266524 -3.241524 -3.226524 -3.221524 4.000000

curve(dnorm(x,43,10.04),xlim=c(5,80))
polygon(tlx,tly,col= "Orange")

file:///Users/gabynicole/CLASE-6.html 4/7
24/4/23, 18:14 CLASE 6

sdp1<-sd(t1)
sdp1

## [1] 16.88688

z1<-seq(58,62,0.1)
z1

## [1] 58.0 58.1 58.2 58.3 58.4 58.5 58.6 58.7 58.8 58.9 59.0 59.1 59.2 59.3 59.4
## [16] 59.5 59.6 59.7 59.8 59.9 60.0 60.1 60.2 60.3 60.4 60.5 60.6 60.7 60.8 60.9
## [31] 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 61.8 61.9 62.0

z2x<-c(58,z1,62)
z2x

## [1] 58.0 58.0 58.1 58.2 58.3 58.4 58.5 58.6 58.7 58.8 58.9 59.0 59.1 59.2 59.3
## [16] 59.4 59.5 59.6 59.7 59.8 59.9 60.0 60.1 60.2 60.3 60.4 60.5 60.6 60.7 60.8
## [31] 60.9 61.0 61.1 61.2 61.3 61.4 61.5 61.6 61.7 61.8 61.9 62.0 62.0

z2y<-c(-0,dnorm(z1,63,4.4),0)
z2y

file:///Users/gabynicole/CLASE-6.html 5/7
24/4/23, 18:14 CLASE 6

## [1] 0.00000000 0.04753903 0.04877019 0.05000739 0.05124951 0.05249535


## [7] 0.05374371 0.05499335 0.05624298 0.05749130 0.05873699 0.05997867
## [13] 0.06121498 0.06244451 0.06366584 0.06487754 0.06607816 0.06726624
## [19] 0.06844033 0.06959894 0.07074063 0.07186391 0.07296733 0.07404943
## [25] 0.07510878 0.07614393 0.07715350 0.07813608 0.07909031 0.08001485
## [31] 0.08090839 0.08176967 0.08259744 0.08339051 0.08414772 0.08486795
## [37] 0.08555015 0.08619329 0.08679643 0.08735866 0.08787912 0.08835703
## [43] 0.00000000

curve(dnorm(x,63,4.4),xlim= c(40,80))
polygon(z2x,z2y,col = "blue")

sdp1<-sd(t1)
sdp1

## [1] 16.88688

t1<-seq(40,80,1)
t1

## [1] 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
## [26] 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80

file:///Users/gabynicole/CLASE-6.html 6/7
24/4/23, 18:14 CLASE 6

t1x<-c(40,t1,80)
t1x

## [1] 40 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
## [26] 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 80

t1y<-c(-0,dnorm(t1,60,10.04),0)
t1y

## [1] 0.000000000 0.005463798 0.006629925 0.007965520 0.009475700 0.011160921


## [7] 0.013016085 0.015029769 0.017183666 0.019452299 0.021803069 0.024196688
## [13] 0.026588008 0.028927259 0.031161643 0.033237243 0.035101142 0.036703636
## [19] 0.038000430 0.038954671 0.039538678 0.039735287 0.039538678 0.038954671
## [25] 0.038000430 0.036703636 0.035101142 0.033237243 0.031161643 0.028927259
## [31] 0.026588008 0.024196688 0.021803069 0.019452299 0.017183666 0.015029769
## [37] 0.013016085 0.011160921 0.009475700 0.007965520 0.006629925 0.005463798
## [43] 0.000000000

curve(dnorm(x,60,10.04),xlim=c(5,80))
polygon(t1x,t1y,col= "pink")

file:///Users/gabynicole/CLASE-6.html 7/7

También podría gustarte