You are on page 1of 4

Bai 1

> load("C:/Users/admin/Desktop/CNTP/Học kì 6/ĐGCQ/thihieu1.txt")


Error in load("C:/Users/admin/Desktop/CNTP/Học kì 6/ĐGCQ/thihieu1.txt") :
bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘thihieu1.txt’ has magic number 'stt n'
Use of save versions prior to 2 is deprecated
> thihieu1=read.table("C:/Users/admin/Desktop/CNTP/Học kì
6/ĐGCQ/thihieu1.txt",header=TRUE, stringsAsFactors=TRUE, sep="\t",
na.strings="", dec=".", strip.white=TRUE)
> thihieu1
stt nguoitd sp diem
1 1 S1 A 3
2 2 S2 A 1
3 3 S3 A 2
4 4 S4 A 1
5 5 S5 A 1
6 6 S6 A 1
7 7 S1 M1 2
8 8 S2 M1 2
9 9 S3 M1 6
10 10 S4 M1 6
11 11 S5 M1 5
12 12 S6 M1 2
13 13 S1 M2 5
14 14 S2 M2 4
15 15 S3 M2 5
16 16 S4 M2 5
17 17 S5 M2 4
18 18 S6 M2 6
19 19 S1 M3 1
20 20 S2 M3 6
21 21 S1 M3 1
22 22 S2 M3 4
23 23 S3 M3 6
24 24 S4 M3 4
25 25 S5 M4 2
26 26 S6 M4 3
27 27 S1 M4 3
28 28 S2 M4 2
29 29 S3 M4 3
30 30 S4 M4 1
31 31 S5 M5 6
32 32 S6 M5 5
33 33 S1 M5 4
34 34 S2 M5 5
35 35 S3 M5 4
36 36 S4 M5 6
> attach(thihieu1)
> analysis<-aov(diem~sp+nguoitd)
> anova(analysis)
Analysis of Variance Table

Response: diem
Df Sum Sq Mean Sq F value Pr(>F)
sp 5 57.139 11.4278 5.6934 0.001224 **
nguoitd 5 9.653 1.9307 0.9619 0.459696
Residuals 25 50.180 2.0072
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(analysis)
Tukey multiple comparisons of means
95% family-wise confidence level

Fit: aov(formula = diem ~ sp + nguoitd)

$sp
diff lwr upr p adj
M1-A 2.3333333 -0.1874609 4.85412756 0.0812952
M2-A 3.3333333 0.8125391 5.85412756 0.0048847
M3-A 2.1666667 -0.3541276 4.68746089 0.1223224
M4-A 0.8333333 -1.6874609 3.35412756 0.9072258
M5-A 3.5000000 0.9792058 6.02079423 0.0029505
M2-M1 1.0000000 -1.5207942 3.52079423 0.8218333
M3-M1 -0.1666667 -2.6874609 2.35412756 0.9999448
M4-M1 -1.5000000 -4.0207942 1.02079423 0.4635633
M5-M1 1.1666667 -1.3541276 3.68746089 0.7113470
M3-M2 -1.1666667 -3.6874609 1.35412756 0.7113470
M4-M2 -2.5000000 -5.0207942 0.02079423 0.0528353
M5-M2 0.1666667 -2.3541276 2.68746089 0.9999448
M4-M3 -1.3333333 -3.8541276 1.18746089 0.5874788
M5-M3 1.3333333 -1.1874609 3.85412756 0.5874788
M5-M4 2.6666667 0.1458724 5.18746089 0.0336954

$nguoitd
diff lwr upr p adj
S2-S1 0.71428571 -1.6195162 3.048088 0.9311386
S3-S1 1.63888889 -0.7902092 4.067987 0.3294703
S4-S1 1.13888889 -1.2902092 3.567987 0.7003909
S5-S1 0.93333333 -1.6232186 3.489885 0.8663395
S6-S1 0.73333333 -1.8232186 3.289885 0.9468763
S3-S2 0.92460317 -1.5044949 3.353701 0.8452327
S4-S2 0.42460317 -2.0044949 2.853701 0.9939412
S5-S2 0.21904762 -2.3375043 2.775600 0.9998021
S6-S2 0.01904762 -2.5375043 2.575600 1.0000000
S4-S3 -0.50000000 -3.0207942 2.020794 0.9891924
S5-S3 -0.70555556 -3.3493868 1.938276 0.9605352
S6-S3 -0.90555556 -3.5493868 1.738276 0.8940278
S5-S4 -0.20555556 -2.8493868 2.438276 0.9998772
S6-S4 -0.40555556 -3.0493868 2.238276 0.9967081
S6-S5 -0.20000000 -2.9613917 2.561392 0.9999135

> boxplot(diem~sp)
Bai 2
> load("C:/Users/admin/Desktop/CNTP/Học kì 6/ĐGCQ/thihieu2.txt")
Error in load("C:/Users/admin/Desktop/CNTP/Học kì 6/ĐGCQ/thihieu2.txt") :
bad restore file magic number (file may be corrupted) -- no data loaded
In addition: Warning message:
file ‘thihieu2.txt’ has magic number 'stt n'
Use of save versions prior to 2 is deprecated
> thihieu2=read.table("C:/Users/admin/Desktop/CNTP/Học kì
6/ĐGCQ/thihieu2.txt",header=TRUE, stringsAsFactors=TRUE, sep="\t",
na.strings="", dec=".", strip.white=TRUE)
> thihieu2
stt nguoitd sp diem
1 1 N1 NUTIX 6
2 2 N2 NUTIX 6
3 3 N3 NUTIX 7
4 4 N4 NUTIX 7
5 5 N5 NUTIX 9
6 6 N1 VINX 3
7 7 N2 VINX 5
8 8 N3 VINX 4
9 9 N4 VINX 3
10 10 N5 VINX 5
11 11 N1 VNSOY 8
12 12 N2 VNSOY 7
13 13 N3 VNSOY 8
14 14 N4 VNSOY 6
15 15 N5 VNSOY 8
16 16 N1 FAMIX 3
17 17 N2 FAMIX 3
18 18 N3 FAMIX 3
19 19 N4 FAMIX 5
20 20 N5 FAMIX 4
21 21 N1 MIXY 4
22 22 N2 MIXY 5
23 23 N3 MIXY 6
24 24 N4 MIXY 5
25 25 N5 MIXY 6
> attach(thihieu2)
The following objects are masked from thihieu1:

diem, nguoitd, sp, stt


> analysis<-aov(diem~sp+nguoitd)
> anova(analysis)
Analysis of Variance Table

Response: diem
Df Sum Sq Mean Sq F value Pr(>F)
sp 4 58.96 14.74 19.9189 4.687e-06 ***
nguoitd 4 7.36 1.84 2.4865 0.08504 .
Residuals 16 11.84 0.74
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
> TukeyHSD(analysis)
Tukey multiple comparisons of means
95% family-wise confidence level

Fit: aov(formula = diem ~ sp + nguoitd)

$sp
diff lwr upr p adj
MIXY-FAMIX 1.6 -0.06681829 3.2668183 0.0630749
NUTIX-FAMIX 3.4 1.73318171 5.0668183 0.0000992
VINX-FAMIX 0.4 -1.26681829 2.0668183 0.9449595
VNSOY-FAMIX 3.8 2.13318171 5.4668183 0.0000267
NUTIX-MIXY 1.8 0.13318171 3.4668183 0.0311641
VINX-MIXY -1.2 -2.86681829 0.4668183 0.2270926
VNSOY-MIXY 2.2 0.53318171 3.8668183 0.0072123
VINX-NUTIX -3.0 -4.66681829 -1.3331817 0.0003936
VNSOY-NUTIX 0.4 -1.26681829 2.0668183 0.9449595
VNSOY-VINX 3.4 1.73318171 5.0668183 0.0000992

$nguoitd
diff lwr upr p adj
N2-N1 4.000000e-01 -1.26681829 2.066818 0.9449595
N3-N1 8.000000e-01 -0.86681829 2.466818 0.5944541
N4-N1 4.000000e-01 -1.26681829 2.066818 0.9449595
N5-N1 1.600000e+00 -0.06681829 3.266818 0.0630749
N3-N2 4.000000e-01 -1.26681829 2.066818 0.9449595
N4-N2 8.881784e-16 -1.66681829 1.666818 1.0000000
N5-N2 1.200000e+00 -0.46681829 2.866818 0.2270926
N4-N3 -4.000000e-01 -2.06681829 1.266818 0.9449595
N5-N3 8.000000e-01 -0.86681829 2.466818 0.5944541
N5-N4 1.200000e+00 -0.46681829 2.866818 0.2270926

> boxplot(diem~sp)

You might also like