Shawn
Upcoming SlideShare
Loading in...5
×
 

Like this? Share it with your network

Share

Shawn

on

  • 644 views

 

Statistics

Views

Total Views
644
Views on SlideShare
644
Embed Views
0

Actions

Likes
0
Downloads
4
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft Word

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Shawn Document Transcript

  • 1. 16.33 Shawn. Se realiza un experimento para saber si el color del cabello y la altura de mujeres adultas en estados unidos tienen alguna influencia en el rendimiento escolar.<br />PelirrojaRubiaCastaño<br />Alta757880<br />Media 817679<br />Bajo737577<br />> cris=data.frame(Notas,Estatura,CC)<br />> cris<br /> Notas Estatura CC<br />1 75 alta pelirroja<br />2 78 alta Rubia<br />3 80 alta Castaño<br />4 81 media pelirroja<br />5 76 media Rubia<br />6 79 media Castaño<br />7 73 baja pelirroja<br />8 75 baja Rubia<br />9 77 baja Castaño<br />><br />> Notas=c(75,78,80,81,76,79,73,75,77)<br />> CC=factor(rep(rep(1:3,each=1),3),labels=c(" pelirroja" ," Rubia" ," Castaño" ))<br />> Estatura=factor(rep(1:3,each=3),labels=c(" alta" ," media" ," baja" ))<br />> cris=data.frame(Estatura,CC,Notas)<br />> cris<br /> Estatura CC Notas<br />1 alta pelirroja 75<br />2 alta Rubia 78<br />3 alta Castaño 80<br />4 media pelirroja 81<br />5 media Rubia 76<br />6 media Castaño 79<br />7 baja pelirroja 73<br />8 baja Rubia 75<br />9 baja Castaño 77<br />> AA=aov(Notas~Estatura+CC)<br />> summary(AA)<br /> Df Sum Sq Mean Sq F value Pr(>F)<br />Estatura 2 21.5556 10.7778 1.9208 0.2602<br />CC 2 10.8889 5.4444 0.9703 0.4534<br />Residuals 4 22.4444 5.6111 <br />><br />> interaction.plot(CC,Estatura,Notas)<br />><br />2476512700<br />interaction.plot(Estatura,CC,Notas)<br />310515110490><br />Ejercicio 2<br />La siguiente tabla da artículos producidos por 4 trabajadores en dos maquinas distintas en diferentes días a la semana.<br />Maq IMaq II<br /> L M Mie J V L M Mie J V<br />A 15 18 17 20 1214 16 18 17 15<br />B 12 16 14 18 1111 15 12 16 12<br />C 14 17 18 16 1312 14 16 14 11<br />D 19 16 21 23 18 17 15 18 20 17<br />> Numerart=c(15,18,17,20,12,12,16,14,18,11,14,17,18,16,13,19,16,21,23,18,14,16,18,17,15,11,15,12,16,12,12,14,16,14,11,17,15,18,20,17)<br />> length(Numerart)<br />[1] 40<br />> Operario=factor(rep(rep(1:4,each=5),2),labels=c(" A" ," B" ," C" ," D" ))<br />> Maquina=factor(rep(1:2,each=20),labels=c(" MAQ 1" ," MAQ 2" ))<br />> trab=data.frame(Maquina,Operario,Numerart)<br />> trab<br /> Maquina Operario Numerart<br />1 MAQ 1 A 15<br />2 MAQ 1 A 18<br />3 MAQ 1 A 17<br />4 MAQ 1 A 20<br />5 MAQ 1 A 12<br />6 MAQ 1 B 12<br />7 MAQ 1 B 16<br />8 MAQ 1 B 14<br />9 MAQ 1 B 18<br />10 MAQ 1 B 11<br />11 MAQ 1 C 14<br />12 MAQ 1 C 17<br />13 MAQ 1 C 18<br />14 MAQ 1 C 16<br />15 MAQ 1 C 13<br />16 MAQ 1 D 19<br />17 MAQ 1 D 16<br />18 MAQ 1 D 21<br />19 MAQ 1 D 23<br />20 MAQ 1 D 18<br />21 MAQ 2 A 14<br />22 MAQ 2 A 16<br />23 MAQ 2 A 18<br />24 MAQ 2 A 17<br />25 MAQ 2 A 15<br />26 MAQ 2 B 11<br />27 MAQ 2 B 15<br />28 MAQ 2 B 12<br />29 MAQ 2 B 16<br />30 MAQ 2 B 12<br />31 MAQ 2 C 12<br />32 MAQ 2 C 14<br />33 MAQ 2 C 16<br />34 MAQ 2 C 14<br />35 MAQ 2 C 11<br />36 MAQ 2 D 17<br />37 MAQ 2 D 15<br />38 MAQ 2 D 18<br />39 MAQ 2 D 20<br />40 MAQ 2 D 17<br />> AA=aov(Numerart~Maquina+Operario)<br />> summary(AA)<br /> Df Sum Sq Mean Sq F value Pr(>F) <br />Maquina 1 19.600 19.600 3.8324 0.0582818 . <br />Operario 3 129.800 43.267 8.4600 0.0002322 ***<br />Residuals 35 179.000 5.114 <br />---<br />Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 <br />> AA=aov(Numerart~Maquina*Operario)<br />> summary(AA)<br /> Df Sum Sq Mean Sq F value Pr(>F) <br />Maquina 1 19.600 19.600 3.6129 0.0663727 . <br />Operario 3 129.800 43.267 7.9754 0.0004139 ***<br />Maquina:Operario 3 5.400 1.800 0.3318 0.8023881 <br />Residuals 32 173.600 5.425 <br />---<br />Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 <br />><br />> AA=aov(Numerart~Operario*Maquina)<br />> summary(AA)<br /> Df Sum Sq Mean Sq F value Pr(>F) <br />Operario 3 129.800 43.267 7.9754 0.0004139 ***<br />Maquina 1 19.600 19.600 3.6129 0.0663727 . <br />Operario:Maquina 3 5.400 1.800 0.3318 0.8023881 <br />Residuals 32 173.600 5.425 <br />---<br />Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 <br />><br />> tapply(Numerart,list(Maquina,Operario),mean)<br /> A B C D<br />MAQ 1 16.4 14.2 15.6 19.4<br />MAQ 2 16.0 13.2 13.4 17.4<br />><br />> interaction.plot(Operario,Maquina,Numerart)<br />> <br />> interaction.plot(Maquina,Operario,Numerart)<br />> <br />> boxplot(Numerart~Operario*Maquina)<br />> <br />> boxplot(Numerart~Operario+Maquina)<br />><br />> boxplot(Numerart~Operario,Maquina)<br />> <br />> boxplot(Numerart~Operario,Maquina)<br />> AATukey=TukeyHSD(AA," Operario" )<br />> AATukey<br /> Tukey multiple comparisons of means<br /> 95% family-wise confidence level<br />Fit: aov(formula = Numerart ~ Operario * Maquina)<br />$Operario<br /> diff lwr upr p adj<br />B-A -2.5 -5.3221614 0.3221614 0.0974246<br />C-A -1.7 -4.5221614 1.1221614 0.3756566<br />D-A 2.2 -0.6221614 5.0221614 0.1709897<br />C-B 0.8 -2.0221614 3.6221614 0.8682166<br />D-B 4.7 1.8778386 7.5221614 0.0004533<br />D-C 3.9 1.0778386 6.7221614 0.0037944<br />> AATukey=TukeyHSD(AA," Maquina" )<br />> AATukey<br /> Tukey multiple comparisons of means<br /> 95% family-wise confidence level<br />Fit: aov(formula = Numerart ~ Operario * Maquina)<br />$Maquina<br /> diff lwr upr p adj<br />MAQ 2-MAQ 1 -1.4 -2.900295 0.1002951 0.0663727<br />Nonononono <br />Notas=c(3,15,2,3,14,3,6,18,6,8,10,5,1,13,2,3,4,0)<br />En determinado colegio secundario se probaron 3 tipos de programas de enseñanza de Inglés, Historia y Matemática. A través de videos. Después, los investigadores midieron el nivel de aprendizaje. Había 2 alumnos por casilla y los resultados son los siguientes.<br />> Notas=c(3,3,15,14,2,3,6,8,18,10,6,5,1,3,13,4,2,0)<br />> length(Notas)<br />[1] 18<br />> Asignatura=factor(rep(rep(1:3,each=2),1),labels=c(" Ingles" ," Histo" ," Matem" ))<br />> Programas=factor(rep(1:3,each=6),labels=c(" PA" ," PB" ," PC" ))<br />> estudio=data.frame(Programas,Asignatura,Notas)<br />> estudio<br /> Programas Asignatura Notas<br />1 PA Ingles 3<br />2 PA Ingles 3<br />3 PA Histo 15<br />4 PA Histo 14<br />5 PA Matem 2<br />6 PA Matem 3<br />7 PB Ingles 6<br />8 PB Ingles 8<br />9 PB Histo 18<br />10 PB Histo 10<br />11 PB Matem 6<br />12 PB Matem 5<br />13 PC Ingles 1<br />14 PC Ingles 3<br />15 PC Histo 13<br />16 PC Histo 4<br />17 PC Matem 2<br />18 PC Matem 0<br />> AA=aov(Notas~Programas+Asignatura)<br />> summary(AA)<br /> Df Sum Sq Mean Sq F value Pr(>F) <br />Programas 2 75.444 37.722 5.0096 0.02438 * <br />Asignatura 2 315.111 157.556 20.9240 8.632e-05 ***<br />Residuals 13 97.889 7.530 <br />---<br />Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 <br />><br />> tapply(Notas,list(Programas,Asignatura),mean)<br /> Ingles Histo Matem<br />PA 3 14.5 2.5<br />PB 7 14.0 5.5<br />PC 2 8.5 1.0<br />><br />> tapply(Notas,list(Programas,Asignatura),sd)<br /> Ingles Histo Matem<br />PA 0.000000 0.7071068 0.7071068<br />PB 1.414214 5.6568542 0.7071068<br />PC 1.414214 6.3639610 1.4142136<br />><br />> interaction.plot(Programas,Asignatura,Notas)<br />> <br />interaction.plot(Asignatura,Programas,Notas)<br />> <br />> boxplot(Notas~Programas*Asignatura)<br />> <br />> AATukey=TukeyHSD(AA," Programas" )<br />> AATukey<br /> Tukey multiple comparisons of means<br /> 95% family-wise confidence level<br />Fit: aov(formula = Notas ~ Programas + Asignatura)<br />$Programas<br /> diff lwr upr p adj<br />PB-PA 2.166667 -2.016549 6.3498820 0.3853160<br />PC-PA -2.833333 -7.016549 1.3498820 0.2118233<br />PC-PB -5.000000 -9.183215 -0.8167846 0.0193608<br />><br />