Lab 4_2014_withR.doc

advertisement
Lab 4:
1. A manufacturer of cloth has a factory consisting of a large number of looms which
produce the same cloth fabric. A quality control program is in place to maintain the
quality of the cloth produced by the looms. If a loom produces an inferior quality fabric,
it must be shut down and the loom re-tuned. It is known that re-tuning is necessary for
all looms if the variation in the fabric from all of the looms reaches a threshold.
Furthermore, it is very expensive to test all looms in the factory, so an experimental
design is developed to assess the variation among looms. The data are as follows:
Loom Quality
1
2
3
4
1
2
3
4
1
2
3
4
1
2
3
4
98
91
96
95
97
90
95
96
99
93
97
99
96
92
95
98
Is there a difference among the looms used? Identify the TYPE of Design, the NUMBER of
factors, if the factor is random or fixed. Are the assumptions of ANOVA met in this
problem?
*program for 1 factor ANOVA with random factor;
data loomdata;
input loom quality ;
cards;
1 98
2 91
3 96
4 95
1 97
2 90
3 95
4 96
1 99
2 93
3 97
4 99
1 96
2 92
3 95
4 98
;
proc print data = loomdata;
run;
*using GLM and RANDOM statement;
proc glm data = loomdata;
class loom;
model quality = loom;
random loom / q test;
output out=loomout r=resid p=pred;
run;
proc gplot data=loomout;
plot resid*pred;
run;
proc capability data=loomout normaltest;
var resid;
qqplot;
run;
*using MIXED;
proc mixed data=loomdata method=type3;
class loom;
model quality = /outp=lmout residuals;
random loom;
run;
proc print data=lmout;
run;
proc gplot data=lmout;
plot resid*pred;
run;
proc capability data=lmout normaltest;
var resid;
qqplot;
run;
# R commands for random effect model (CRD with a single factor)
y <- c(98, 91, 96, 95, 97, 90, 95, 96, 99, 93, 97, 99, 96, 92, 95, 98)
looms <- as.factor(rep(1:4,times=4))
qwe <- rbind(y[looms==1],y[looms==2],y[looms==3],y[looms==4])
dimnames(qwe) <- list(c("loom1", "loom2", "loom3","loom4"),NULL)
qwe
g <- lm(y~looms)
anova(g)
# 95% CI on the intraclass correlation coefficient
u <- qf(.975,3,12); l <- qf(.025,3,12)
F0 <- 15.681
L <- (F0/u-1)/4; U <- (F0/l-1)/4
L/(1+L); U/(1+U)
# 95% CI on sigma.sqd.epsilon
u <- qchisq(.975,12); l <- qchisq(.025,12)
df.MSE <- 12*1.896
L <- df.MSE/u; U <- df.MSE/l
L; U
2.
An accounting firm, prior to introducing in the firm widespread training in statistical sampling for
auditing, tested three training methods: (1) study at home with programmed training materials,
(2) training sessions at local offices conducted by local staff, and (3) training session in Chicago
conducted by a national staff. Thirty officers were used for the study but as there was difference
among the officers they were grouped into ten groups of three, according to time elapsed since
college graduation, and the auditors in each group were randomly assigned to the three training
methods. At the end of the training, each auditor was asked to analyze a complex case involving
statistical applications; a proficiency measure based on this analysis was obtained for each
auditor. The results were (group1 consists of auditors graduated most recently, group 10 consists
of those graduated most distantly):
Training
Group
1
2
3
4
5
6
7
8
9
10
1
2
3
73
76
75
74
76
73
68
64
65
62
81
78
76
77
71
75
72
74
73
69
92
89
87
90
88
86
88
82
81
78
Discuss what kind of design this is?
How many factors? How many levels? Are the factors fixed or random?
3. 1. An experiment was conducted to examine the effects of different levels of reinforcement and
different levels of isolation on children’s ability to recall. A single analyst was to work with a
random sample of 36 children. Two levels of reinforcement (none and verbal) and three levels of
isolation (20, 40, and 60 minutes) were to be used. Students were randomly assigned to the six
treatment groups, with a total of 6 students being assigned to each group. Each student was to
spend a 30-minute session with the analyst. During this time, the student was to memorize a
specific passage, with reinforcement provided as dictated by the group to which the student was
assigned. Following the 30-minute session, the student was isolated for the time specified for his
or her group and then tested for recall of the memorized passage. These data appear in the
accompanying table.
Time of Isolation (Minutes)
Level of
reinforcement
None
Verbal
20
40
60
20
19
23
30
36
25
6
10
11
18
28
25
28
27
24
14
17
19
15
16
24
24
26
29
31
38
29
22
25
21
27
23
21
34
35
30
4. Identify the factor(s) and discuss if they are fixed or random.
Download