Annotated SAS Output (ASO) Michael P. Meredith, David M. Lansky

advertisement
•
Annotated SAS Output (ASO)
Michael P. Meredith,
David M. Lansky and Foster B. Cady
The analyses for 15 data sets are done using
the statistical software package SAS.
annotated SAS output
The focus of the
<ASO) is upon specifying appropriate
include problems involving multiple linear regression,
polynomial regression with lack-of-fit, comparison of regression lines and analysis
of
covariance.
treatrnPnL means is demonstrated for one-way classifications
•
and Lwo-way factorial treatment designs from completely
randomized and randomized complete block experimental de~; i
qn !::. !·-,a.\/ :i. n q E!qual
<::~r-,
d u.1·"! t::·qui:il
J•-pp
1 i c: ,;:. t. i or-,.
T1,.. c~at. rnE·n t:
means are also analyzed from split-plot, repeated measures
and crossover experiments.
BU-866-M in the Biometrics Unit series,
Cornell University,
,J i::ll..ii..I.EII'.. y,
•
Ithaca, NY
lCJU:'!
•
ID. t.r:..oduct. ion..
The present form of the Annotated SAS Output
CASO) has
evolved from the original project aimed at illustrating common statistical methods using the statistical software package SAS <BU-664-M,
BU-705-M, and BU-814-M).
pa.c::ka(Je
The primary goal of these annotated outputs
data at the level of Statistics 602.
.l.••...
L lJ
outside the classroom.
Over the past six years there have been many people who
have contributed to the ASO.
students,
Most of these people have been either
lab instructors or undergraduate assistants involved with
the conduct of Statistics 602.
Suzanne Aref,
This list includes Anna Angelos,
Valerie Arneson, Jim Babb, Calvin Berry, Margaret
Patricia Firey, Laura Gnazzo, Walter Kremers, George Legall,
Maatta, Charles McCulloch,
gorsch,
•
Patricia Nolan,
Norma Phalen,
Cecce~
Jon
Walter Ple-
Beth Snelbaker, and David Umbach .
P. t~l-~.~;:,;.r.-:J._p t. Lc;m.
A total of 15 data sets are employed to illustrate the
application of SAS in the analysis of data.
The data sets are derived
from actual designed or observational experiments.
The name of the data set, which appears in the Table of
Contents, and a description of the type of analysis that it serves
to illustrate are provided below.
+I'" om
f}n ,::t 1 y -::.~ j:..l:l~l ~~~.~U::lg[jJJl~~ n t <:t t
Q.SI t f!.
The first 10 data sets are taken
t:!.Y.· !3..e:- cl.t:..<~..§..~.:i..<..:?.D. ( {1 l 1 e r. 1
<.1 n d
C'" d y ,
:l 9 U::: ) ,
while references are given for the sources of the remaining five.
:1.)
!~.r:J.:;e!Ji..£~ ..Q£~t..iE.~
i
11u~:;tl"'i:?ttf2
s~tr.. <:.1i
ght--1 :i nE~
J·-·~::gr.. f?!S!Si
on for- the m<;=dn ..·-
slope and intercept-slope models.
2)
!:J.J::.!=!fl..:L. l2.s!.t.<;!. illus;tr·,:::..tE! multiple linear· r·egt··es;siun with twc)
predictor Vdriables.
Model sequences are demonstrated and par-
t.ial leverage and residual plots are shown.
Orthogonal polynomial
•
contrast coefficients are calculated for unequdlly spdced treatThese contrasts are compared with the sequential
model sums of squares.
-i.-
4)
!~.L~f:J:. r- ..i c:...Lt.. 2::.....1.!2~~.L... J1'E.d:;_§:~ :l 1 1 us t
r· C:t t
~?
a mCJ d f..~ 1 s e que n c E~ whE~ n
s £~\IE-:? r.. a .l
straight lines may need to be fitted.
•
Fot.~t.~.2._J::::i~.~~.f.!J.i:;u:}QET...Jd.!~~J~ 5~\.
ill us;t.1·· ,:::~t<;~ an ar..lc:tl y~> is of
via a complete set of orthogonal contrasts.
tt-eatm£~nt
me<::tn S';
The experiment
design is a one-way classification in a completely randomized
design with equal replication.
f:..)
b.:iinpho<;vtELlLiu~a
ill us;t1~ <=•.te an
an.:.~l
y!::;:i s
CJf a 2 ;.; 2 +<:tc:tclr· i al
experiment laid out in a completely randomized design with equal
r·eplicatiDn.
7)
Fat _.kL9.!?"25.?.~J. i . t~..LLLt..L...Jl§tt.~~~ i 1 1 us t r· ate an an ctl y s i s
Df
+act--
a :2 ;.: 2
orial experiment laid out in a randomized complete block design.
B)
EJ:.:J::! t;,~;:.tJ::LJ:~.:!.t.!::.J.J) C!.IL..JL~'.tj:ij!.
pletely randomized
!"1 on -cw t
or· t
!:;E·~t
t~2.l:.':!.<E!.!llR ..... R!:LJL:~:!.:t~~
!J
£.;
+
onE?.-·-~"~ <::t ·y
<::t
with unequal replication.
de~ign
con t1r· ;;1 ~::;.t !:;
h D~i CH"IiO.tl
1-·1 O.:J c::.r·1 ii'i.l
:i. 1 1 us t r at t::! an .:1 n c\ 1 y s; i
;:H- F£~
p 1r F2!:;en t f?d as:;
t
ii!t n a 1 y s
t·H~ 11
,::ts> <:t
A set of
c:clinp 1 et •::?
.
i 1 1 u <:; t
I'" ii:i t E)
1-1 <:?
j !"::>
CJ f
c: e 1 l
mE-) an s :i n
factorial experiment with unequal replication.
2 :-: :::::
ii.-i
The first anal-
ysis follows that presented in Allen and Cady C1982).
•
com-·
Several
ANOVA tables are considered as are the weighted and unweighted
cell means (the MEANS and LSMEANS of SAS).
The second approach
demonstrates an analysis of unweighted means which is discussed
:in Snedecor ii:ind Cochran (1980).
1 () )
ti!,;l:'i b E:~ill::!.. _J::JJ..Y.:1?.LL9.lJ.;:1.9iJ;,;.id..... J~.§:\1_<Ei :i. 1 1 us; t.l'" at t") a c:: o v i:£t r" :i. <:t t e
<:it 1"1 Et 1 y s; :l ~:5 •
Several ways are shown to estimate treatment means adjusted
and unadjusted for the covariate.
·rhe ''c:l<!:'ts;s.;ical''
{~NCClV{.'i
t.:tble
is given as is a test for homogeneity of slopes.
:1.
l )
1:::· u t !E:!.:L.U.......!J!~:~.!E~.!2. . J2.~~~t§~ :i. 1 1 u !:; t r· ;,:t t. <·!~ .::t n
,:t n ii:'t 1 y s; :i. !5
c1 + a 2 ;: :::; f '"' c:: t
tJ r-
:i i::i 1
experiment where one treatment factor is qualitative with two
levels and the other treatment fii:ictor :ic quant:itii:itive with three
unequally spaced levels.
T~;~c;
<:::qui vc:d ent analyses are presented:
the first :is a model sequence approach comparing quadratic regression curves (see Allen and Cady, Unit 19>; the second is an
analysis of cell means wherein appropriate single degree-offreedom orthogonal polynomial contrasts and interaction contrasts
These data are taken from a larger
•
:i.
1.':.')
J"1
Cc:)c:l·n·
;,;tl'i
i::'tl
H::l Cu;:
{:lJJ~QJJ.nX::J:!.t:. .Lt.q......n~~L~~.'.
ment.
Cl
p. 9'7) ..
'?~5'/'.,
:i. J ltt<:; tx
set presented
d
t. C) the an a 1 '!!=> i
~:;
qf
a
!;; p 1 :i.
t --u rd.
t
f.~;.;
p E) 1
L .. ·
The cell means model is fitted as described in Allen
and Cady (1982, p.280).
The approach presented allows the simple
-ii-
effects to be estimated more easily than in a default model
~;pt:~c
•
i
+:i cat i Cin.
The whole-unit analysis proceeds by analyzing
the sums and the split-unit analysis is accomplished after removing the whole-unit variability.
Such an approach can result
in substantial savings of computing dollars and a strengthening
of the understanding of such experiments.
The usual approach
1s presented for comparison.
1 ~:;)
~~r··<':?a
§yntj"'iE!S:i..J~_Q£!~!;:2!
:i 11 U)";tl·-·,:::tt~:! the anal Y~";i s of
<::1.
r-epE~ated
meas--
ures experiment with two treatment groups of unequal numbers,
and two repeated measurements upon each experimental unit.
The pertinent hypothesis tests may be reduced to three twosample t-tests based upon the within subject sums or differSuch an approach tends to render the analysis more
understandable than does the usual ANOVA.
also presented for completeness.
Brogan and Kutner
I. f.!.)
Li.!fii.T:!!;Jg.J.._.~!J;U,_l:L.l).!.~!J~::i
The ANOVA table is
These data are taken from
(1980).
:i. 1 1 Lt ~::; t
t' ;::~. t. ;.:;,
t. hE:! an a 1 y !5 :i. !:; o + a t:. wD ..... p t? I" i n d c 1'- D ~5 s; u v E~ I'"
experiment with unequal numbers of experimental un1ts 1n the
•
two groups.
The calculations for this design are exactly the
same as those of the preceding Urea Synthesis Data.
The distinc-
tion between the two designs is in the method of treatment alloThese data are taken from Grizzle (1965).
cation.
:1. ~:: )
.
t1.Ll.J~-~{_:j.J:d 5LJ~i:=!L.£
i 1 l us t. I"' <:t t. E~ t. h (':? an a 1 y ~;; :i. ~5 o + a t h r· f'! E! -· p t=21'" i o cl t h t·· t::~ e
treatment crossover design which is balanced for first order
carryover effects.
The layout is in repeated Latin squares.
Treatment means adjusted and unadjusted for carryover effects
ii:'l I'" E!
1.:;)
:i. \,/ E! 1"1
i:':'t <;;
a 1··- E·! t. h E-! i ,.-·
from Cochran and Cox
•
<;:; t. <:":t 1' ..1cl i::\ I'" d
(1957,
E~ I'" I·-· C! ,.-· <:;;...
p. 135) .
-iii-
These data are
t:.a~en
•
Intrc)duc:ti Dn
Df2sct··· :i.
i
pt. ion
In {U len
F:i
•
tr <-:.~+
J.·/
D;::~ti:\
l
::::;2
7
(:;):~
Soymi 1 k 0.::\t:.c:\
l
·-·
''=!'
1 :1. :l
Electricity Load Data
c·
1 ,:j
14 l
PCJtato Leafhopper Data
·")
..
. .:.. ;
:1. ~79
:2f.J
l
'?::::;
Fat Digestib1lity Data
:~:
:1.
c;s)
Protein Nutrition Data
:::::'-1·
r·t
btA!atnp pl···l Do:\ta
:::::6
~?~'?
Soybean Physiological Data
4~5
::?::::::~:.
L..ymphoc:yt.E~
DE1t<::!
,
l
c::·
·Potato Scab Data
·-· l
l
r:.::-
,.)
1
*
Alcohol-Drug Data
!:.'i8
2E!O
Urea Synthesis Data
66
Hf,:'lliDgl obi
woy
*
n
Di.;·~t<:'!
£::-
i..J
1"1i 1 k Yi E•l d Data
t34
Htl
* See
,,::.
description for references .
•
-iv-
w
'I•
*
•
TITLE
a;s~~!C
•
'1!,T6.
'"5fNIC;
:11ST o\ 0 S:NIC;
1, t· v = C I ; T - l o. 1 ;
xo = I;
(l';f.>JT
4
II
1')
I2
I'•
n
?;I
\ •)
it-,
ani f.; Annotated Computer Output, p. j\c (BMDP)
:.' ) l'rints n heading on coer. pHr.:r·.
l. 1-;
) • 2 •,
IV
\.'),>
I • .J 'i
ARSENIC is the observed arsenic level,
:. IST is the distance from the arsenic source,
~EV is the difference between Dist and the
mean distance (16.1),
.) •• ~ "l
.'! 1 .i :; '' ..:1ne
1.~7
OBS
1
2
'5
4
f'(,r t:•.ra<"h 1•1J~;t·r·v;d, i (Jfl •
b
7
B
1 • .l4
j. 7 J
1. t. ()
.~ • ~ 1
r-l'r.CL P~'ti\T;
VI" 10 tlEV
"iJ
ARSENIC DATA
,...,
'f'b(·r:•· r:i.td.emen tA <T<·Ii 1.<· '' ,J:oi.t, r.Pt. "'' l1 Pd ARGENIC
whlvl. '" 11la l11s four var [;,I.JJet.::
(.\·';));
2
~ ~- Un:t;; ., '
1\TA;
•
q
l'W!C:
tJI<;T AR<;E•HC;
l~!rN'r
print.r. t,hc·
11!111 AIWl!:Nl('.
v~or'i~otd~:n
xo,
I~'V,
10
!JfD'T',
,J(J
[)EV
DIST
ARSE~IC
-14.1
2
3.19
l
-12.1
4
3.26
l
1
l
1
1
-8.1
-6 • l
-4. l
-1.1
4.9
1
6.9
1
1
13.9
8
10
12
15
21
23
30
36
19.9
~
ese
ol~o
1.82
1 •0 2
1 • 8 '5
2.0')
1.34
).79
0.66
0.30
two
are uaed in model@
pre · t ar enic levels.
;:- r, ~ ~ T .\ '1. R Sf' "'If;
PROC REG is a regression procedure;
~
"llEL A115~'11!C =X) OFV/'II'l'H <;~tl'~ ,, ClM -;q >:;;
l'uucu!v<id:;t~reillunt.rutetlB-E:
'l'hese _tw colw:.ns are used in
O:fTPUT u·.JT=NEWl ,>~t·J!CTE 1 1=fHATl OfSl9'.1H='< Sill
~B is a mean slope ~odel.
model'Q
L'J'i"'=L'lWEC. J9'i'l. =cJi>P[D :;r•W=S-=P"'() STU~' NT=<;To)H'S; C is an intercept slope model.
~
)11(1:)~1. Af. s E"'l C = 01 s T 1:;-= Q~ o SS 1 s <; 2;
D is regression through the origin.
This column is used alone
2(
M•JtJEL Atl.S"'IIIC = !liST/'IIOl"oJT S!:'Hl <> SSl <;S;>;
E is a mean model.
in mode 1 1;1; •
,§,)
"'('')cL ~PSC::N!C = Xv/1'1.-J!NT :
The OUTPUT stat<•ments create new data sets called
OdTPUT OUT=!\!Ewl P 0 EJ!CTE:)=Y!HI 0 ;
Nl!."'Wl and NEW2. Eaoh new data set contains Pll variThis column is used alone ln model~.
ables in the original data set plus the variables
:>-ot:r. PLCT 0.\ T ~ = NEWt:----_
nruncd in t.he output statement.
~
PL•JT RF.Sl:.ll*YI-lAT/V;l.EF='J: ]J
PLCT AP<;E:<IC*OIST='*'
YHATli<;H'>T~-.
·•n•
~Notice that we have directed SAS to use the data set NEW1 for these plots.
If we do not specifY a
'I PDF";: *c11 ')T= 'l) 1
l.JWcR*()!·;T= 'L '/rVF~l !l.Y;
d:otu sE-t t'nr n procedure, SAS will use the most recently created data set, in this case SAS would
have used NEW2.
DATA OFCC"P;
Plot ':Q) is a residual plot for models ~ and @.
Mt:f<GE i'l!:lol1 NE~i
VREI•' = 0 druws u horizont!il line at RESI!> = 0.
c~sl = YHAT1 - YBARi
Plot "B) prints observed, predicted, and confidence limits on the same set of axes using
the symbols *, P, U and 1.
PRQC ~R!NT OAT~=DECQMP;
DECOMP is a new data set which is a combination, or MERGE of NEWl and NEW2. DECOMP conj) [.\" \"S~'"l!C ftitl."' "'!:51 o<;S!Lll STIF::'S SFPDEJ;
TITLr ~o\T~ DECOMPOSITICN FrR A1S~NIC DATA A'~ti.LY~IS;
tains all the variables in NEWl and NEW2 and the new variable.
RESl is the diff~ence ~ween the mean arsenic level and the predicted arsenic level
l'rom model JV or \.£).
vr. -'C
~
=
\
I
1;)
PROC PRINT prints th£' dat.11 lecomposi tion.
-1-
1»
•
S~~UE:f~T
IAL o A~! '~ETc:!'
1.,oz~~
~ 2
XO
OED VARIAE'LF::
•:~T I··~
t
or
ME ~.N
DF
:-:-~u~;;rs
SCU,~"E
F VALUE
FqQf;)"
?.
3::'.31:~~14
H:of-'='32~7
:;7,00
C.Q001.
F\
2.3403!'6
3:.• 7 2SQ
10
ROOT
Note that using DEV instead of DIS~ as the X variable
produces sequential b' s that are the same as the partials.
See@).
Coefficient for the mean model (see p.35).
Coefficients for the mean and slope model
(see pp. 39 and ~5).
~ur-~
MO n:::L
E:R"O'l
U T::JTAL
T[S ~The option SEQB produces the sequential b's.
'< S <:'':I C
ANOVA:
SOURCE
MODEL ARSENIC=XO DEV/l~OINT P ~E~:;; ~21 SS2 CLM;
e -, :; ·; ~ 1:::, 1 ~
i ,
DEV
•
MEAN ANI
j::
Q(J
0.2c2::4.~== s 2
-
U TOTAL stands for UNCORRECTED TOTAL.
MS£"
P
0.3345
o.::>2E:3
-SOUAR:
~CJ
')(P t!EA'''
P-SQ
The option NOINT instructs SAS not to supply an intercept]
[ since XO has been included in the model. When XO is in
the model and the NOINT option is used, the model SS
includes the SS for the mean.
ROOT MSE is the standard deviation.
when NOINT is used, the reported ~ is incorrect.
PARTIAL
ST
P aii.AMfTE;l
VA
RIA~LE
XO
1.&2P8CO= Y
-0. 0 7 b 1 ~ 1 =.;>
1
1
DEV
r.~:DAP.D
c:srr••:TE
CF
T FOI'\ HO:
EPRrf'
PA~A~ET~R=O
:.171040
c 16112
3.51!'-4.850
(1.
~lope
0
>
P.OB
IT I
C.OCC!
0.0013
TYFE I SS
2 ~ • ~ C 3 2 10: = R( 0)
E ,&8;::~74= R(DEVIO)
/
L
The options SSl and SS2 in the MODEL statement produce the TYPE I SS (the sequential SS) and the TYPE II SS (the partial SS).
VA" I ABLE
OF
TYP:.. II
ss
I
xo
The P option in the MODEL statement prints each observed
value, predicted value, and residual.
2 6.: 0 3 f-4 0 = R( 0 DEV)
!::.;;82":7'1= R(DEVJO)
DEV
PR~DIC-
STD ERR
LOWrFq~l
UPFER351
OBS
ACTUAL
~ALU~
FREDirT
MEAN
~EA~
1
3~19C
3~260
~.73P
~.574
0.2~4371
?.074
2
1.~76
3
4
1~820
o.259352
:.261 0.215145
1~020
~.10~
0.19726~
2>050
1i340
~ o.79oooo
1.oa~
9 0.660000 Oe54170E
10 0.300000 0.072601
o.2o39~7
o.s1e3~9
0.28180~
•.10~140
0.~63402
-.7E5212
5
6
7
SUr-' 0 F
su~
1~850
RES1DU~LS
!.76~
1.650
loq4: 0,1833~4
loc26
1.714 o.1719cE
1.317
1.24~ O.l8B3f2 0.810647
RESIDUAL
~ .
.
~~
Corrected Model ss
When NOINT is used, the reported n- ~s ~ncorrect. -"=Corrected Total SS
where both model and total SS have been corrected for the mean. NOINT
causes the SS for the mean to be included in both numerator and denominator.
To calculate the correct ~' subtract the SS for the mean (n~) from the
MODEL SS and TOTAL SS.
3.386 0,460075
o.6a6377
2.757 -.441020
2o56C
-1.C85
2 0 371 -.OqR418
2.111 o.336C34
1o679 0.094938
1.559 -.2~27&0
1.1~2 0.11f294
C,S10615 0.~27199
~.172
Ex. :
@
~
n;? = 26.503840
33.386414-
nY:
0.7462
35. 7268oo- n?
(compare to above ~)
~v
:IF 'SGUAt:ED F,ESICIIOL.S '~
Should be exact~y
zero.
The CLM option prints
the upper and lower
confidence limits for
a 95% confidence interval
on " 9-t each observed X.
Model
~
~d~
-
·-
Corrected Model SS = 1 _
RESIDUAL SS
Corrected Total SS
Corrected Total SS
l-
*___;;:(~---LL=l
(Re_sid_ss_)
)]
[P where n is the number of observations and
Corrected Total SS
p is the number of variables fitted,
in~lud~~c the interce?t or XO.
•
S!:·:iU=:··'T~!tL
P!T:R<E~
c;.;!METL.:(
DED VARU::L:::
~l!"' OF
s:;u ~:; ES
8
R"OT
') EP
c. v.
I
"'EAN
SGUlPE
6.&13~:74
F.~P2574
2.3403(:!'.
C' •
F
V~LL;E
PRCE>I='
23.52~
0.0004
2 9 2 ;; 4 8 = s2 , same as
@
R·SGUARE
0. 7462 .(;--Correct ~.
M'J P-SQ
C. 714 5
PARTIAL
PAkAI>'"'TfP
STANDA~D
ESTII'l.\Tf:
ERROR
T FOR ~0:
PARAMET~R=C
2.ii~6?~·e
Co310720
9.01€:112
~.2t9
o.ooo1
-4.850
0.0013
YS£
L: A~.,
f- The adjusted
~
is "adjusted 11 for the number of variables in the model.
:.:.22:.42
['!"
1/ARH.'?L::
NTC:'~CEC
DI
The NOINT option is not used, so SAS supplies an]
[ intercept. The model SS does not include the SS
for the mean (nj2).
®
\fi.Sf.tdC
o•
SOURCE
~10DEL ARSENIC= DIST/P SEQB SSl SS2;
;<;T!Pt~TCS
1.!0::8
2 • & :. ~ 23 • • 0 7 ~ 1:: 1 } same sequentials as
D I c:T
•
SLOPE MODEL
:9
~T
-0.078151
PROB
> ITI
(SEQUENTIAL)
T YF E I
')S
.503840
fo882:74
z~
Lsame as
@
(PARTIAL)
VARI.l.DL::
C·F
TYP!:.. r1 SS
I NT£11 CE;>
DI"lT
1
1
25.241773
6 .E.825 74
Csame as
®
PRU'ICT
OB'>
~CTLIAL
VdLU':
RtSIDU-~L
1
2
:ool90
3it260
2. 73()
c .460070::
2e~7A
3
h>l20
Z.26:i.
4
l .. 02C
2.1 o~
7
B '•
9 t:o
....
1!)
.e: c
lo94P -.G91'4lf-
;<•050
1. 71'· Oo33EC::'4
1.24"" O.G~4':'::'i·
1. 0 's•'; -.29~7~(
~
~
6
c.
O.f:SE:377
-.4410::(
-1.0£-:'
1.340
:;(lOGO
The parameter estimates are different from those in
but the TYPE I SS are the same.
same as
PROC REG does not compute F tests for the TYPE I or TYPE II ss.
The t tests of the parameter estimates are equivalent to F
tests of the TYPE II ss. To perform the independent F tests
of the TYPE I SS, form the ratio
®
(TYPE I SS)/df
_ df
(Residual SS)/(Residual df) - FResid df
0.54170!: Oo1H';''?4
~ 0 C'C 0 o.c7280l o.:::211'?:;
:o~Jo
su~
o~
RESIDU!LS
SUM
"~
s:uA~Er
RESICUAL~
@,
8.40~ 0 4~-~~
2.34D3tE
-3-
•
SE)UE~!TIAL
cAK~~~T~~
.04~7':-73
D! oT
JC::P V.l.I\IJlE'LE:
c:Tl''AT~~
=slope of line through origin (seep. 53)
lFiSEUC
s u ~, o'
SOIJ~CE
llEP
c.v.
model. Result: fitting a straight line
through the origin.
r·;:: .1 N
sru:.c:.
a
l'o144Eli1
::.0646P4
lQ
8.1440:41
27.:82159
35.726PQQ
MSE
1.750l24
M::-A~l
l.f:2f<GOC
"-<:91.1!\I>E'
~CJ R-SG
~RR::l"<
~nor
j
sr;ur;Es
= s2 ,
F 'I•LUE
F'ROt->"'
2.1058
0.1::7'0
~L:
compare to previous models
~
E
N
I
y-£2~
USE~.
R-SGUAR[ IS
•
••
'
c
107.5322
NOTE: NO INTERCEPT TERM IS
•
A?.SENIC = DIST/NOINT;
NOINT is used, so SAS does not supply the
intercept, and XO is not specified in the
includes SS for the mean
DF
M0 '.lEL
U TOTAL
:!J
.
DIST
R~QEFTNEC.
Such a model does not make much sense with the
VARIAPLZ:
OF
STA"JDMlD
F.R R rR
PARAMETi:i\=0
1
0 .c 4f.798
C,G2870E.
1.630
D~'"
(PARTIAL)
TYPE II ss
1
8.1441' 41
0! ST
V.6'l!APL:::
T FOR HO:
PARA ~1['!' E.P
ESTI'HTE
DI ST
PFiOE
>
ARSENIC data set, although regression through
(SEQUENTIAL)
IT I
TYFE I SS
0.12"7':
P,l44641
the origin is useful in other circumstances.
MEAN MODEL
@
DEP VARIABLE:
DF
SOU'lCE'
ER."<O'l
U T·}HL
9
10
'l00T r-'SE
'JEP MEAN
c.v.
\:)
'3.22~:
bO
35.726 00
1 • c 12~ 11
1.621'000
62.1".126
ss
for the mean, equal to nr = 10 * (1.628) 2
14E &N
F
Sr~AOE
2€:.503840
1.024773
V~LUE
pqG~)I'"
2=.8€:3
G.OC07
~Note that s 2 for this model is larger than for models
reduces the estimate of cr 2
c.741P
C,74ll'
"·SGUAP[
~[·J R. -SG
®
and
@.
Fitting the slope
•
No INTERCEPT TFR'·' r~, u~E:~". F-SG'U~RE: IS R:::c.un;e::o.
1~t.iEI>
STAMO.oG
OF
SSTP""T:::
FRR"R
P~RAMET~R=r
1
l.E:2~C•CC
c.?~D121
~.OfE
PARA
VAk!APLC
XC
~
SUM OF
............
S"U'"'""S
26.503 4
MOC'SL
<§"Q!):
ARSO)IC
ARSENIC "'XO /NOINT
T
F8R HC:
Pft\lB
> ITI
Do80C7
-4-
TYFE
ISS
0
This model was run so that the predicted values,
each equal to y =1. 628, could be saved in the
data set ONE, to be used in the data decomposition, part G;).
.,.
•
r!msiruiLANALYSISJ
PLOT OF RES!Dl•YHATl
LEGEND: A : 1 OBS, A : 2 OASt ETCo
@ Residual plot for the models in
Oo6 +
.)
®
and
A
@.
RESID is on the vertical axis,
YHAT is on the horizontal axis (see p. 317).
A
0 o4 +
A
A
Oo2 +
I
I
l
0 .o
\·
R
::.
s
A
A
·
·-·--------------------·---------------·-------------------------------1
I
I
-o .2
/ote the horizontal line drawn by VREF = 0
A
I
+
I
D
GD
A
u
A
L
s
OBS
-0.4 +
A
/
DATA DECO~POSITION FOR ARSENIC DATA ANALYSIS
ARSENIC
1
2
3
1 o6 2fl
1o628
1o628
lo628
1.628
1o628
lo628
1.628
1o628
~
1.1019
0. 74 56
0.6330
0.4767
0.3204
0.0860
-0.3829
-0.5392
-1.0863
~..-...,.-.--'
lo62~
-~
(yi -i")
7
8
-o.8
9
+
10
I
I
I
I
:vi
I
I
I
A
•1o2 +
I
I
-·---------·---------+---------·---------·---------·---------·---------·
0.4
o.P
1.2
2.0
2.4
o.o
1o6
2o8
PREIHCTED VALUF
-
y
+
STORES
RESIDl
0.4601
Oo6864
-o." 41 o
-1.0847
-0.091l4
0.3360 ..
0.0949
-0.2988
Ooll83
1.0000
1.4461
-0.8887
-2.1538
-0.1934
0.6553
Ool873
-0.5964
~
+
(yi -yi)
Each observation can be deco..!posed into the overall mean,
the difference between the predicted values and the mean,
and the difference between the observed and predicted
values. See Unit 6, p. 50.
-1.0 +
I
RESl
3.19
3o26
lo82
lo02
loSS
2o05
lo34
o. 79
Oo66
"56
-0.6 +
YBAR
-5-
0.2562
0.5671
SEPRED
0.284371
0.259352
0.215145
0.197268
0.183354
0.171956
0.188382
0.203997
0.281803
0.363402
•
i LOT (,F
sv~~~cL
~RS'.I,JC•l!ST
CL')T (JI' YHATl+OIST
fLOT OF !:FPFR •CI <:T
PLOT OF LC'W":F<*CISi
'
"
~ ·~
..I
I
~v~c~L
SY~~~L
SY~~OL
u
!:'
u
f"\
C·
u
u
IS •
IS F
IS U
•
[' IS L
®
u
I •
•
~~
I
OVERLAY plot of the observed values (*),
the predicted values (P), and the upper
(U) and lower (L) 95% confidence limits
for a mean predicted value.
3.0 +
I
~
I
1.'
I P~~
L·
I~
2 .5 +
I
p
R
E
0
I
c
2.0
l<:·"~"'"
1 .s +
T
E
0
J
1
.a
A
+
A
L
yi-yi
)
I'
""
J
1~
l
II
u
L
L
IJ
p,
\.1
L
+
u
£
o.s
y =2.886-0.07815 * DIST
L
=
+
1.628- 0.07815
Note* outside of L's
0. c
+
L
-0.5
+
'-1.0
+
--·---·---·---·~--·---·---·~--·--~·---+---·---·---·---·---·---·---·---·I.
~
lC
1?
]A
1~
1~
20
22
24
2~
2F
~0
~~
~4
3f
t::
2
~I ~:T
-6-
* DEV
•
•
•
FIREFLY DATA- Units 10, 12, and 13; ACO, p. 351 (SAS)
TITLE FlR=FLY JATA;
DATA fiREFLY;
~~PUT fl{~E LIGHT TEMP
XO=l;
~~;
Creates the data ~~~ FIREFLY.
FTTh1E is the ~·esponsc variable; LIGHT and TEMP are e::planetory variables.
We used~~ to tell SAS to read the entire line because we have more than one observation on each line.
C~RDS;
45 26 21.1
52 55 23.3
38 79 25.0
31 130 25.5
56 40 17.8 50 41 22.0 31 45 22.3
4..) 3 5 23 9
33 56 25.5 54 55 20.5 40 70 21.7 28 75 26.7
36 87 24.4 3b 100 22.3 46 100 25.5 40 110 26.7
4•J 140 26.7
0
FIREF'LY DATA
OE!S
1
2
3
PRINT;
VAR XO LIGHT TE~'~P FTU~E; -Prints the~:!_ matrix for@.
_,--,_P~OC
.!y
@
~
~
PROC PLCT;
PLOT FTI,.E*LlGHT FTIME*TEI4P LlGHJ:_*Tl;fo\P; -
4
3 separate plots, FTTh1E against each explanatory
variable and LIGHT vs. TEMP.
PRCC REG;
MODEL FTI~E=XO LIGHT TEMP/NOINT P SSl SSZ SEQB;
OUTPUT OUT=NEW1 PPEDICTED=YHATl RESIDUAL=RESIOl;
MCDEL FTI~==TEMP LIGHT/P CLM SSl SS2 SEQB PARTIAL TOL;
MODEL FTI~E=TEMP/P SSl SS2 SEQB;
CUTPUT OUT=NEW2 PREOlCTEO=YHAf2 RESIDUAL=~ESID2;
PROC REG used to i'i t
reodels with both LIGHT
and TEMP, and then a
reduced model.
1
5
6
7
8
9
10
11
12
13
14
i5
16
17
'1\'
XII
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
LTGHT
TEMP
26
35
4J
41
45
55
56
55
7J
75
79
87
HJ
1 c <)
1U
21.1
23.9
17of:!
22.}
22.3
23.3
25.5
20.5
21.7
26.7
25.0
24.4
22.3
25.5
2 6. 7
25.5
26.7
13~
140
FTIME
45
4~
51'1
5n
31
52
3JC\
54
4'1
28
38
36
36
46
'+~
31
4"
X ! Y matrix for the general model:
;M "'XO LIGHT TEMP /NOINT in part
DATA NE~Alli
MERGE ~Ewl NEwZ;
PROC PLOT CATA=NEWALL;
®PLOT RESICl*YHATl/VREF=O; -Residual plot for ~and~@ PLCT RESID2*TEMP/VREF=O; -Residual plot for ®.
-7-
©.
•
•
...-----·~I
FULL HODEL
FTIME = XO LIGHT TEMP/NO"-,~
@
FIREFLY DAU
StOU!:NTIAL PARAMETER ESTIMATES- The sequential coefficients are the diagonal elements of t!J.e SEQB output (seep. 99).
XI'
LIGHT
TE"''P
OEP
41.352 9 = y -. See p. 94.
48,8962 -.103083
Intercept and slope coefficients for FTJNE = XO LIGHT (seep. 95).
91.4745 6.9E-Q4 -2.12753 +--Intercept and two slopes which define a tilted pla:-!e (seep. 99).
VARIABL~:
Note that the slope in the LIGHT direction changes sign when TEMP is aided to the model.
FTIMc
SUM Of
MEAN
SQUA«f
SOURCE
OF
S.;)U,\"ES
"'OO':L
3
14
17
29527.857
683.143
3 J 211.000 -
ERP.Of{
U TOTAL
ROOT t1S t::
OEP MEA"'
c.v.
V.~LUE
F
t' 1<0B>F
c ,I)Q.')l
9842.619
201.710
48.795924 = s 2
Includes SS for the mean.
R-SQUARE
6.985408
41.352941
16.89217
!\OJ R-SQ
~4
!t2
0
[~OTE:jNO HJERtEPT TERM IS USED. R-S~JARE IS REDEFINED.
STANDARD
ERROF
P!IRA'~ETER
::OS Til-lATE
VAr:; I Af\L E OF
,...-.. Intercept
~ xo
l
91.474451
18.825103
{LIGHT
1 0.0006919891-~
u.J68339
f. TEMP
1
-2.127529~ 0.917599
~Slope
L. Partial coefficients.
VA~
£ABLE
xo
Df
1
LIGHT
t
TE'-IP
l
rw::
T FCR HO:
PARAMETER=;)
4.859
0.010
-2.319
ss
PROS
> ITI
45.00J
40.000
58.:))!)
50.000
31.000
52.0)0
38.000
54.000
41. O'l•)
28.000
38.000
36.0:)0
36.1)0)
46.000
6
.J.0003
0.9921
G.03t>l
7
B
9
29371.118
1152.148 = R(O,T,L)
194.42~ 0.005003143 = R(L T,O)
26.2.318~.
262.318 = R(T L,O)
\
1
2
3
TYPE I I SS
\\
ACTUAL
4
5
of plane in LIGHT direction, see p. 100.
Slope of plane in TEMP direction, see p. 100.
1
013$
10
11
12
13
14
15
16
11
4').000
31.000
40.000
PREDICT
'JAUJE
STO ERR
PREDICT
LOWER95~
MEAN
UPPER95t
MEAN RESIDUAL
46.602
40.651
53.632
4tt. 69 7
44.06.2
41.941
37.261
47.898
45.356
34.721
38.341
3q.623
44.100
37.292
31t.746
37.312
34.766
2.972
3.280
4.517
2. 373
2.235
2.015
3.170
2. 795
2.326
3.256
2.011
1. 843
3.231
2.259
2.821
3.478
3.847
40.227
33.616
4'3.944
39.607
39.2b8
37.620
30.462
41.904
40.36 7
27. 73 7
34.028
35.61')
37.110
32.447
28.695
29.853
26.516
52.976
-1.602
47.6135 -.65072C
63.321
4.366
49.787
5.303
413.855 -13.062
46.262
10. •)59
44.061 '). 738795
53.1:l92
6.102
51). 344
-5.356
41.705
-6.721
42.653 -.340885
43.576
-3.623
51.030
-8.100
4.2.136
a. 708
4'). 796
5.254
44.772
-6.312
43.016
5.234
\;.
R(O~
\.== R(L
0)
SUM OF RESIDUALS
SUM OF SQUARED RESIDUALS
= R(T L,O)
'Nhen LIGHT is fitted last, it does not account for much of the remaining SS.
-2-
3.94351E-13
683.1429
•
•
,----
•
------.
FULL MODEL
~ FTIME = TEHP LIGHT
SEQUENTIAL
P~RAMETE~
ESTI~ATES
lNTERCE:P
TEMP
LIGHT
DED VAP. [ABLE:
Note that the sequential coefficient.s from ABDO !:!re on the
diagonal of the SEQB output. See p. 100.
FT 1'1<0
SOUPCE
OF
SUM OF
SQUAR':S
MEAN
SQUARE
MODEL
2
14
16
456.739
683.143
1139.882
228.370
48.195924
POOT lolSE
OEP MEAN
6,98'3408
1<.-SQUARE
41.352941
ERRCR
C TOTAL
c.v.
PR08>f 1 same ANOVA as ~, except that
F VALUE
~
~DJ
4.680
= s2
,
same as
0. 02 76
@.
j
the MODEL and TOTAL SS are correctei
for the mean.
P-SQ
16.89217
STANDARf)
ERROR
P~R>\"'ETER
VARIABLE
OF
ESTIMATE
lNTERC!:J>
l
91.4 74451
TE~P
1
-2.127529
LIGHT
l
VARIABLE
OF
lNTERCEP
TEMP
1
1
LIGHT
1
T FOP HO:
PARAMETER=J
PROB > ITI
4.859
-2.319
:),()JJ69198<H
18.825103
1),917599
<) • .)68 339
0.0003
0.')361
Q,!Jl(}
J.9921
SS
TypE I I ss
TOLERANCE
2 -1)71.118
456.734
o. 0135003143
1152.148
262.318
0.005003143
0.571054
0.511054
~
~
TYPE I
R(OI
= R(L T,O)
=
= R(T 0)
=
=
=
R(OIT,l)
R(TL,O)
R(LjT,O)
r all other X' s
(
~
'
'2
l\Xi- X (0, ···)'
____________,
Tel =
i
L(Xi- x)2
;
= 1 -
~
RXi.
Again, LIGHT
fitted after
TEMP accounts
for little of
the remaining SS.
all other X's
Same as ~.
-9-
•
~
PLUT OF
60
•
fiREFLY DATA
~
F~!ME*LIGHT
LEGEN:J: A
1 fJBS,
2 OB$ 1 ETC.
B
54
51
RESIDU~L
•
PLCTS
fTIME
+
I
I
I
57
~
PARTIAL R=GRcSSION
21)
+
15
+
The option PARTIAL in the model statement
frorr. @ produces this (and other) plots.
These are similar to the plots on p. 141.
+
+
A
I
I
I
·~
+
1': +
+
+
'
~
48
+
5
I
I
I
45
FTI ME
42
+
A
.) +
A
I
+
I
-5
:.
39
A
+
+
+
+
+
+
+
+
...
+
+
A
A
+
+
+
+
A
+
+
+
-1·J +
36
A
+
A
I
+
I
I
33
+
30
+
-15 +
A
!:.
-21 +
I
I
I
27
+---------+---------+---------+---------+
-'50
0
50
100
-l 0:)
!:.
LIGHT
+
/""--..
24
+
--+----+----+----·----+----+----·----·----+----·----·----·----·----·20
30
50
60
7C
BJ
90
l)J 111 121 131 141 15)
4~
LIGHT
-10-
LIGHT - LIGHT (INTERCEPT, TEMP)
There is little linear trend in this plot, so fitting LIGHT after
an intercept and TEJ.lP v1ill acc~t for a small portion of the remaining 2wo of squares, as in (.£) and @.
•
s~~UE~TIAL
PARlMET~R
ESTIMATES
41o3"'29=Y
91 • 3 216 -2.121 '14 "r- same estimates as second line,
l('
T:: '1 P
•
REDUCL~
@
FTIME =XO TEMP /NOINT
::E;
o::o VARIABLE: FTIM[
$ 0 1JRC
J GC:L
2
ER~OR
15
17
M
5UM OF
SGUA.RES
OF
~'"
u TQT AL
2'1527.852
683.148
3a211.000
R 1)0T MSE
r:lEP MEAIII
6. 74P570
41.352941
16.319'14
c. v.
t'.EAN
SQUARE
14763.926
4 5 • 5 4 3 19 6 = s2
R-SQUAP.E
ADJ R-SQ
>"
F VALUE
PROe
324.17'1
o.J'JDt
Note that s 2 has not increased very much from the s 2
in @ and @ -.-here both TEMP and LIGHT were fitted.
n• .,774
0.3759
1\!0TE: NO INTERCEPT TERM IS USEDo R-SGUARF IS R"DEFINED.
V~'HABLE
X1
T E'•P
OF
P.ARAMrTER
EST !MATE
1
1
31.381582
-2.1214'1'1
STANDARD
ERRrR
T FOR H!1!
PARAMET::R=C'
5.754
-3 ol67
PllC2
)
TYF E I
ITI
o.o·~!'l
o.il064
ss
SS for reduced model (FTIME = XO/NOINT)
= SS for the mean (n~) ~ 456.736
2'?q1.11E
456.734
standard errors of the estimates, part ~
OF
VA"IflflLE
x·
1
1
Ti:. vp
IT SS
TOLERANt"E
1507.671
456.734
1805.'165876
loOOODt'J
TYPE
F test for the need of the general model with TEMP and LIGHT
over the reduced model with TEMP (pp. 138-140):
difference in df between models
df,general model
'"~BS
ACTUAL
1
45.00"
2
3
4
5
6
7
8
;_
5!).00~
31.00~
52.00~
11
38.00~
12
36.00~
13
36.00~
SIJ"
)
4!Je00 ...
1'l
14
15
16
17
. 'l"
... c
'16.619
-1.619
4a.679 -.b79071
53.620
4o380
5.291!
44.710
44.073
-13.073
41.952
10.048
37.285 0.715240
6.1(18
47.892
4!:J.346
-5.346
3'+.739
-6.739
38.345 -.34541l2
39.618
-3.618
4'1.()73
-8.073
8. 715
37.285
34.739
5.261
-6.2R5
37.2f\5
5.261
34.739
58.00"
38.00')
54.001
4(1.001
28.(101
9
PREDICT
VALUE RESIDUAL
46.0C~
4
o.oo,
31.00~
40.001
'\ESIDUALS
)~I..'~I)Er
I'!C~!DU~L"
~.65930[-13
E:P3.147"'
_(456.739-456.736)/1.!. 0 0001
(683.143)/14
- .
Reduced model is adequate
This test is equivalent to the t-test of the LIGHT parameter
estimate in @ or @ .
-11- .
•
PLOT OF RES!Dl•YHATI
LEGEND: A
1
0~
2 OElSo
S, B
.,
•
nc.
PLOT OF RESID2•TEMP
1 O,Q +
A
A
A
A
A
8
+
A
I
I
5.0 +
A
+
I
I
I
2.5 +
A
·---------------------------------------------------------------------A
A
o.o ·---------------------------------------------------------------------A
A
I
A
-2.5
+
F.:
s
A
I
I
I
A
I
I
D
u
-7.5 +
A
s
I
I
I
A
A
-7.5 +
I
I
•
-1
-12.5
A
-5.0 +
A
L
A
A
-2.5 +
I
-s. ·; •
~.a
I
I
R
A
-1
B
A
I
~.J
oes, ETc.
7.5 +
A
2.5
2
I
I
I
7.5 +
'i.:;
LEGEND: A : I OBS, 8
A
1 ~.1 +
+
A
I
I
I
o.o
A
I
+
-12.5 +
A
-1'0\.Q +
-1 '5. 0 +
-17.5
@
+
®
-17.5 +
Residual plot for full model
F'rn!E : XO TEMP LIGHT, parts
@
and
Residual plot for reduced model
FTIME: XO TEMP, part
@
@
y
-2 ry.J +
--·-----·-----·-----·-----·-----·-----·-----·-----·-----·-----·-----·-32
34
36
38
40
"2
44
"6
'18
50
52
5'1
-2 ~.a
•
---·----·----·----·----·----·----·-15
16
17
19
18
20
rREOICTED V4LUE
-12-
Residuals can be plotted against
or
against any of t:1e explanatory variabl·
23
2'1
25
26
27
28
•
•
~;---~-TA-----U-n-it_l_l-.1
DATA SOYMILK;
INPUT TIME Y 00;
TIME2 = TIME*TIME;
LOF z TIME; CARDS;
In this output the time is coded in minutes.
Thus, the coefficients differ from those reported
in Unit 11 by a ·factor of Eo or 60 2 for x and x 2 ,
respectively.
8 2.74 0 2.25 0 2.34 12 3.14 12 2.68 12 2.83
30 3.44 30 3.53 30 3.63 60 3.68 60 3.75 60 3.51
~ PROC RES;
MODEL Y
TIME TIME2 I SS1 SS2 SEQB;
OUTPUT OUT=QUAD PREDI~TED=YHAT RESIDUAL=RESQ;
Fitting a quadratic pol::nomial as a reduced model.
=
The sequential and partial SS and regression coefficients
are requested.
~ PROC SLM; CLASS TIME;
MODEL Y
TIME;
ESTIMATE 'LINEAR' TIME -25.5 -13.5 4.5 34.5 I DIVISOR=2043;
ESTIMATE 'QUADRATIC' TIME 415.507 -182.379 -539.207 306.079./
DIVISOR=590336.7098;
CONTRAST 'LINEAR' TIME -25.5 -13.5 4.5 34.5;
CONTRAST 'QUADRATIC' TIME 415.507 -182.379 -539.207 306.079;
LSMEANS TIME I STDERR;
OUTPUT OUT=FULL PREDICTED=YBAR RESIDUAL=RESID;
=
~
~
PROC PLOT;
PLOT RESID*YBAR=TIME I VREF=0;
PLOT Y*TIME='*' YHAT*TIME='P' YBAR*TIME='M' I OVERLAY;
~ PROC 6LM; CLASS LOF;
MODEL
Y
= TIME
X
=
[
Fitting the full (cell means) model.
The ESTI~ffiTE statements compute the sequential
coefficients using the orthogonal polynomial
contrast coefficients obtained via the ORTHO
algorithm (see X and L below).
The CONTFAST statements give the SS associated
with the above ESTIMATE statements. Compare
wit~ the PROC REG Type I SS.
The residual plot for t~e full (cell means) model
and an overlay of the observed data, the fitted means
and the predicted response from the quadratic model.
This provides an easy -wa:: to assess the Lack-of-Fit
due to fitting a lower order polynomial rather than
the full (cell means) model.
TIME2 LOF;
~o1 ~ 144~] --+ [~0 -13.5 -182.379
::;~~']x)
Note:
_:;\
12
1 30 900
l 60 3600
•
L ,.
1
1
ORTHO
1
4. 5 -539· 207
34.5 306.079
E(x-~(0)) 2
The computations required in the ORTHO algorithm may be carried out
by any regression program. For example, the last column of L may be
obtained as the residuals from a regression of x 2 on x and x (see p. 109).
0
These results vrere found using the REGR command in MINITAB.
Compare with L on p. 114 where time is in hours.
= 2043
E(x 2 -~(0,x)) 2
= 590336.7098
-13-
•••
®
•
•
@
PROC REG output for the fitted quadratic polynomial oodel
Test for lack-of-Fit
SEQUENTIAL PARAMETER ESTIMATES
INTERCEP
TIME
TIME2
3. 12667
GENERAL LINEAR MODELS PROCEDURE
=y
2. 62141 0. 019814" bl·
2. 41049 0. 051197 -5. 1%:-04
= b0·12
= bl•02
CLASS LEVEL INFORMATION
= b2·0l
LEVELS
CLASS
4
LOF
DEP VARIABLE: Y
MEAN
SQUARE
1.431282
0.035323
F VALUE
40.520
R-SQUARE
ADJ R-SQ
0.9000
0.8778
STANDARD
ERROR
T FOR H0:
PARAMETER=0
PROB > ITI
0.100670
2.410490
0. 051197 0.009055173
1
1 -0.000507621 0.0001412264
23.944
5.654
-3.594
0.0001
0.0003
0.0058
OF
SOURCE
2
MODEL
ERROR
9
11
C TOTAL
ROOT MSE
DEP MEAN
c. v.
SUM OF
SQUARES
2.862563
0.317903
3.180467
0.187943
3.126667
6.010972
Partial PARAMETER
VARIABLE
INTERCEP
TIME
TIME2
OF
ESTIMATE
VARIABLE
OF
TYPE II SS
INTERCEP
TIME
TIME2
1
1
1
20. 251745
1. 129142
0. 456351
DEPENDENT VARIABLE: Y
TYPE I SS
= R(x Ix,x2 )
= R(xYx0 ,x2 )
= R(x 2 jx0 ,x)
117.313
2. 406212
0. 456351
0 12 30 60
NUMBER OF OBSERVATIONS IN DATA SET = 12
PROB>F
0.0001
DF
SUM OF SQUARES
MEAN SQUARE
F VALUE
MODEL
3
2.88580000
0.96193333
26. 12
ERROR
a
0.29466667
0.03683333
PR > F
11
3.18046667
R-SQUARE
c. v.
ROOT MSE
Y MEAN
0.907351
G.1382
0.19192012
3.126666£.7
OF
TYPE I SS
F VALUE
PR > F
1
1
1
2.40621204
0.45635131
0.02323665
65.33
12.39
0.63
0.0001
0.0078
0.4500
OF
TYPE I II SS
F VALUE
PR ) F
0
0.00000000
0.00000000
0.02323665
0.63
0.4500
SOURCE
1
VALUES
= R(x0 )
= R(XIX )
= R(x2j~0 ,x)
CORRECTED TOTAL
SOURCE
TIME
TIME2
~OF
SOURCE
TIME
TIME2
LOF
0
1
Note:
0.000>=
The F statistic reported above could have been computed from the
combined results of parts A and B as
F
=
~S(full model) - SS(reduced model)]/ (dffull - dfreduced)
SS(due to experimental error)/ dfexpt'l error
or,
.,-14-
-15-
l
0.63
= (2.88580
- 2.862563)/(3 - 2)
o. 29466667/8
•
•
GENERAL LINEAR MODELS PROCEDURE
~·
CLASS LEVEL INF8RMATION
CLASS
LEVELS
TIME
VALUES
•
0 12 30 60
4
NUMBER OF OBSERVATIONS IN DATA SET = 12
)EPENDENT VARIABLE: Y
OF
SUM OF SQUARES
MEAN SQUARE
F VALUE
~ODEL
3
2.88580000
0.96193333
26. 12
::RROR
8
0.29466667
0. 03683333
11
3. 18046667
R-SQUARE
c. v.
ROOT MSE
Y MEAN
21.907351
6. 1382
0.19192012
3. 12666667
DF
TYPE I SS
F VALUE
PR > F
3
2.88580000
2:6.12
0.0002
30URCE
:ORRECTED TOTAL
SOURCE
TIME
SOURCE
TIME
CONTRAST
OF
TYPE III SS
F VALUE
PR > F
3
2.88580000
26.12
0.0002
ss
F VALUE
R(xlx 0 ) = 2. 40621204
65.33
12.39
DF.
1
1
LINEAR
QUADRATIC
R(x 2 jx ,x) ~
PR
ESTIMATE
PARAMETER=0
0.01981400
-0.00050762
8.08
-3.52
PARAMETER
bl.O:
0 2.01
.
T FOR H0:
0
LINEAR
QUADRATIC
0.45635231
>
PR
0.0001
0.0078
0.0001
0.0078
LSMEAN
STD ERR
LSMEAN
0
12
30
2.44333333
2.88333333
3.53333333
0. 11080513
0.11080513
0.11080513
1=171
-.:. E.4E,F,6F.F. 7
Ql_
TIME
~ ~
t7!.Pt.?!C:
~
7
PR > F
Note that s 2 is the pooled estimate of
0.0002
experimental error with 4(3-1) df.
l
I
This is not of any real interest since it is
J
a test of
J
These SS correspond to the TYPe I SS reported in
PROC REG.
H0 :
~0 =
••• =
~ 60
-....
STD ERROR OF
ESTIMATE
JTI
0. 00245147
0.00014421
l
These estimates are the same as the sequential
estimates reported in PROC REG via the SEQB option.
J'
The standard errors differ because the experimental
error is used here, whereas the residual error was
used in PROC REG.
l
LEAST SQUARES MEANS
y
F
~
= s2
These are the means for each time and their standard
r
•71 01171
-16-
errors.
Note that SEM
= {):036833/3 1= 0.1108
•
RESID
0.40
+ ©
PLOT OF RESID*YBAR
SYMBOL IS VALUE OF TIME
•
PLOT OF Y*TIME
PLOT OF YHAT*TIME
PLOT OF YBAR*TIME
SYMBOL USED IS *
SYMBOL USED IS P
SYMBOL USED IS M
•
*
Residual plot for full model.
J.7
+
@
~
I
I
0.35 +
I
I
~
p
3.5 +
3.4
M
*
3.6 +
*
*
+
I
I
p
R
E
D
3.3
+
3.2
+
I
I
I
3.1
+
T
E
D
3.0
+
v
2.9
+
2.a
+
c
*
p 1
I
I
A
l
u
0.00 +---------------------------------------------------------3-----------l
E
2.7
I
I*
+
I
I
-0.05 +
I
I
I
-0.10
+
I
I
I
1
2.6 +
-0.20 +
I
------__ Sum of these squared
/ gives the SS due to
/:
Sum of
these
squared
gives
*
l ss(Full)- ss(reduced)
2.5 +
3
0
= SS(I.OF)
I
IM
2.4 +P
6
-0. 15 +
I
I
I
l
I
I*
2.3 +
I*
I
0
1
-+---------+---------+---------+---------+---------+---------+---------+
2.4
2.6
2.8
3.0
3.2
3.4
3.6
3.8
2.2 +
-+---------+---------+---------+---------+---------+-----0
12
24
36
48
60
TIME
YBAR
-17-
•
!
~ECTRICITY
LOAD
DATA·,~
13; ACO, p. <6'
(~DP)I
•
TITLE ELECTRICITY LGAD CATA;
DATA ELECTJC;
'/3 ::.ndicates that DAY is a character variable.
INPUT OATE C~Y $ TE~P Yi
X3=J; X4=J; X5=J; XE=);
Xl=l; X2=TEMP;
IF DAY='SU' cc CATE=5 THEN DO;
All statements ~r~ a DO to an END are exec~~ed as a group.
X5•1; X6=TEMP; Xl=ili X2=0; END;
SA· is changed to Q for ,;.t:::h::e:......!p:::l::::o:..:t:......::i::;n:._b~G:,:._:·_ _ _ _ _ _ _ _ _ _ _ _ ____,
IF DAY =1 SA' THEN DO;
1
1
Xl=l; X4=TEMP; Xl=O; X2=0; JAY= 1 Q 1 ; END;
See ® and ® for the X variables created
CARDS;
by the above statements.
1
®
::>~-,::
Pf\I"JT:
"il\
...::;
~
])
"
001""
0
~
R•'O.
>:
Y 1 X::
VAl'
.. .
X 4 '::
1
1
3 intercepts and 3 slopes.
'· t;-; Prints the X matrix for the full model:
O:>H:T•
"' ...
V!l.P.
-~:
'I 3 X": T ~ r-;:: Prints the X matrix for the reduced model:
GLI"l
MOCEL Y=Xl X2 X3 X4 v5 XE/~OI~T PI
OUTPUT CUT=~E~l !=~EDICT~Q=YHATl
"'~" • "'L ~ T CAT A
3 intercepts and 1 slope.
~[f!CUhL=P~~!Ol:
=•. c: i·' I:
?LOT ~E~Irl•YHATl/VIi"'!==C;} Residual plot for the full model.
~ 0 ~·~· Gu•;
MC~EL
Y=Xl
our~ur
~R"r
I
'G'
PL~T
X~
'15
T~VD/~CI~T;
LU!=~~w:
c~F~ICTL~=Y~4T~
>i[SH.Ut-L=~rsro:;:;
} Fits the reduced model.
~ATA=~rw2:
PLCT PESir2•Y~-'AT2/VF.'"!==Ci The residual plot for the reduced model.
0 L~.T YoTEr->F=CAYl y vs. TEMP, and the character used to plot each observation (Y) is the data stored in DAY which corresponds
to that observation (i.e., the first letter of the day in which the observation was·taken).
-18-
•
•
~ The X natrix for the reduced model in
']) The X matrix for the full model in ,]) , p. 145
/1L - : -ELECT'<IIITY
--r,f('~1
_____...---~
lCtD
JHA
.'
Y.::
>3
1
1
77
7"'
c
0
0
0
4
0
5
()
~
1
7
8
1::'
11
c
72
79
0
0
:2
14
~
l~
:
7"'
77
77
1 ~.
0
0
17
1
:::: 1
1
1
1
1
7 f'.
7a
c
2~
G
0
::·G.
1
1
1
1
7q
73
~s
~· ~
.: G
31
c
c
Xl =1 if
X3 = 1 if
X'5 = 1 if
X2 =temp
X4 =temp
X6 =temp
0
75
"E
1
Q
0
:J
G
~.
.'i
2
1
1
0
c
1:">
~}
4
77
0
G
G
f.
e.
~
·~
v
c.
0
74
1
~
c
J
0
1
"u
G
G
G
0
a
1
;:::.
b
7
&
C·
0
0
71
Ci
n
0
0
1
~
0
2 ·.:;
30
31
weekday, 0 otherwise
Saturday, 0 otherwise
SUnday or holiday, 0 otherwise
if weekday, 0 otherwise
if Saturday, 0 otherwise
if Sunday or holiday, 0 otherwise
~
1
a
c
0
0
1
0
0
~
c
c
0
0
78
78
1
0
0
1
7'+
77
0
0
79
0
0
G
.
1
0
c
71
73
73
J
c
7:
0
0
0
l
0
69
71
0
f:-8
~i/
Separate
Intercepts
-19-
0
~
1
0
24
0
23
;2
1
1
E.G
;:.::
77
77
82.
74
72
"~
0
!'1
7"'
23
c
0
1
0
0
77
c
7f:
:7
72
79
0
1
0
c
6 0,
1
-'
"-
a
G
u
1
1
0
17
12
:9
20
r:
0
0
0
7A
0
G
c
1
1
:0.6
J
c
c
7".:
7':'
77
0
c
74
a
c
"
c-·
c
77
G
0
0
"
"·c
(\
"
.'
14
i5
c
T ':~' F
12
13
G
G
1
X5
c
c
j
E.;<
"3
JlT~
1c
11
:,
C·
lJAO
~
7
P2
-.
:i.
D
~
0
0
72
71
73
:>3
?'I
27
c
0
G
't6
0
7E
7'+
~
77
~2
0
c
77.
l
lP
J
fLECTP"CITY
.~ ~
Y:
Q
r
'
17
-~
81
£5
g
@
Separate
Slopes
Separate
Intercepts
.
•
t_Common Slope
•
D-: =:. '! o::: '' T
v A"
._9)
FULL !WD~L, 3
.:f:
T :
f
L :::
Y
~E' .~.22
X2 :.:~ :·::. X5 :·:.: :miNT
= 72
y
s :- !_ ~ c:
:-F
~·L~··;
t)e
rw'! :-A ~-J
SGUt.RES
s Q L1 ;\ 1:' ~
·: '::L
E:
34~4C~~7.0~721010
57~Cl~2.~4Se~~C2
'~". <;'(
2::
2E:S47,'.iC27E.990
106:.7H11H~
31
::47cES5.CCCDGOOO
:~
'J':-J=l'1E~i!CD
•
:" SLOPES
r··.TPL
F '"
~
t! L'.l~
4::2.:::.
~:
).
F
:.COOl
Like PROC ?EG, PROC GLM computes
R2 when NOINT is used
c.v.
STO DlV
~.lCl~
~2.~4P3707~
s J Jq c c:
(sequentials)
TYP> I SS
i'F
1
y
~·£~~-
1C':2.E:7741"i?~
F
V.lLUt:.
~·
R
>
r::
o.oc·c:
\(
C779.42430620
47 3'?20.COCOCOCO
?.4621.01
47.64
4431.79
0.802:
X
Ei>'C.OCOCGOOJ
27.C9
o.:GC·:
2""1.aocooooo
::u.t:P.E·2771
3464.41:
C· .:.GGl
0.~3
'2.~7~=
X
1
\(
~62
::.t:
\(
\(
-~ r,J •::
C f.
~~32.1QQ4761•
(partials)
TYPE IV SS
r>F
X1
F
c.:CCl
V A.LUE.
F· R
n
I.
>
"'
4 c:. c;; 1
X2
~
'
613.59455571
5C77"'.4248C620
X3
1
1~3.724GG562
c.'5.8
47.64
C.lO
\(4
~
2e~.::o.OOC00008
27 .C"'
1E:C3.8411E:G67
1 .50
::.• 2.
5E::-.6f.1~2771
c ·~~
""
Ca47~c
1
x::
l(
f,
PARTIAL
<>:."c\M::-Tc::~
·~
S 1 1•'' A '!'!:.
T
to :
~='0P
HC!
R .\ r.o ': T ~.1'1: 0
Y 1 weekday intercept=11 G • "34 2 1 9 2 7
X?
weekday slope = 13 • 3 0 <; 3 C2 3 3
C.76
6.'70
Satur. intercept=·to2.142E:714
'f4
Satur. slope= 13.':7142€'5.7
<:: Sunday intercept=5~:;. t: 50 E: r :< 41
·t ~
Sunday slope = 4 .1 2 0 4 t: 1 9 ~
.. ;:: .• 31
:. -~ 1
1. 2 3
c.7?
·~:
H<
.., IT I
•
... ......
c.:cCl
~.7'577
o.ccc:
~
14
~TC
ER~~~
OF
~~TJV'T~
(.4551
:'-~
.ce1 C!1°S'
c.ooc1
1.=2P 32'51
9 • .21C· :;t;c.7
2.£:728487
c.2314
t.::s.~4:::2;:s
C.OOCl
c.1:.11
(.4739
:~
'5
-~
-:::-.;-
.fE6~074E:
PROC GLM has no option which gives estimates
of the sequential b's.
•
.----•!:..--~ REDUCED MODE:L, 3 INTERCEPTS AND A CCMMON SLOPE
@
Gf~~P'L
:=:c:::r:~·r·'...i
:; '·I~
"~
-.,...
· .:
~
:; E L C.:
C:
LI~FlR
~OOELS
Y = Xl X3 X5 TEMP /NOINT
PROCfDUPE
y
r.f
su~
OF SGUH\ES
~F~N
sr.UAP>
F VALUE.
79%.55
~L
4
3473e249,28002397
8E:845E:2,32CCJ5:o
.:::.:-~~a
27
29315.71997603
1S85.7674:E.52
31
34767565,000COOQO
~\z~~
c.v.
STD DEll
y ''E.! N
J.~7
3.1302
32.950%4'?1
1052.67741S35
•J'I':')~~ECTt::
S:
"':'j'{CI:
Sequentials
TYPF. I S$
C:F
(1}
:< :" intercept.
t:;
T"
r-,:.L
"'P~
slo;o•
1
1
1
1
R(l)
R(311)
R(5j3,1)
R(Tj5,3,1)
= 26"24:3932.19 047619
= 4 7 2 3 9 2 0, 0 0 0 0 0 0 C0
= 3692841o800GOOOO
=
77555.28954779
Partials
TYP/0: IV S~
s'":ur<cF
"il
1
)(3
)(5
T r ·•p
1
1
1
o ~ ·' l.'·• ··r::.;:;:
•
R(lj3,5, T) =1 :134.52471<:.2.0
R(3jl,5,T) =o,OOC06809
R(5,1,3,T) = 1325,61070453
R(T 1,3,5) =77555.28'?5477<!
ro;TI r'A TE
X: weekday int,,•cept=i52. 7367432€:
Y '3 Satur. intc.·cept= 0. 0 2 9 0 34 97
Sunday inte~ · ~pt=-13 0, 4 286 C.9 3C
I(=
T:.:.''ol common L?pe=yl2.75552448 1
T FOR HO:
P:\R.\MF.TE.f\=0
1o33
c.oo
-1.1 ()
8.4 5
PR
)
F
0.0001
To evaluate the adequacy of the reduced model, form the F statistic
[(Model
~'P
F VALUE..
F
c .n 01
2417 0 .£(;
4350.77
:;'.401.14
71.43
F
)
C:.'R )
1.78
0 .o 0
1 .2'2
71 .4 3
Col931
0. 0 ':'98
PF
)
IT
[34,740,917-34,738,249]/2,;, 1.25 = ~
1065.916
25
0,00('1
GoC:G01
C,J001
VALLI(
Based on the relatively small F value, the reduced model is judged
to be sufficient and there is no need to fit separate slopes.
F
0.278=!
0,0001
I
c.1931
o.'?':'9P
0.:: 7&'?
C.C001
difference in df
model ) - (Model SS, reduced model ) ] / b t
th 2
d
e ween
e
mo e 1
\Res:i.dua.Y ss-;-full modelJ/ (Residual df, full model)
ss, full
~T
ERROR OF
[ STIMATE
0
114.42601&14
115.945065gC
118,04118545
1.50924939
Predic;.: :>n equation given
·.n p. 146
-21-
•
•
I
PLOT OF RCSI01•YHAT1
@
~=·~xnt
LEGE~O:
A
•
RESIIllJAL ANALYSIS
= l OBS, A = 2 OPSt £TC.
I
LCGEND! A
PLOT OF Rf.SID2•YHAT2
Residual plot for the :f'Ull model
R!: SI 02
50
40
~
A
= 1 OBS, e : 2 OFSo
Residual plot for the reduced model
A
30
A
40
A
A
A
A
A
A
20
A
A
A
A
A
30
A
20
A
10
I
I
I
A
A
•--------------······-···------------------------------A-------------····
10
I
I
I
A
0 ·-------------------------------------------------------1----------------
-10
A
A
A
-20
-10
+
A
A
A
•30
-20
I
I
A
+
I
I
•4 D
+
•30
+
-4 0
+
A
A
"
A
-50
-~
+
A
-50
0
A
-70
-fl 0
-·-------·-------·-------·-------·-------·-------·-------·-------·------1100
900
950
1000
1050
1150
1200
ll5 0
I
I
I
+
A
A
A
.-60
-70
+
--·-------·-------·-------·-------·-------·---·---·-------·---~--·-·-----1200
11!i0
1100
800
850
900
950
1000
10~0
~00
Yl-'i<T1
YHAT2
-22-
•
y
1250
PLOT OF Y•THH'
•
IS VALUE OF DAY
5YM~OL
@ Plot of Y vs. TEMP.
+
F
The lines are the estimated regression
lines from the reduced 3-intercept, 1slope model in part
®.
T
1200 +
Weekdays:
yw =lll8+12.76(xw -75.67)
M
F
T
11'00
II
+
,,
\.1
11 0 0
+
p
1 0 ~0
Saturdays:
YQ = 972 + 12. 76(~ -76.2)
+
Q
1000
::0'50
900
+
I
I
I
I
+
I
I
I
I
Sundays:
+12. 76(x8 -77 .6)
y 8 = 859.4
+
Q
s
®
s
B'iO +
s
!\CO +
---·---·-·-+·--·---·---·---+---·---·---·---·---·---·-·-+---·---·---·---·--6!!
69
70
71
72
73
71!
7':1
76
77
78
79
80
81
82
83
8'1 85
TF.MP
-23-
•
•
,..---
.'---------,I
LEAFHOPPER DATA -
u:-,:.-:;
1:':
TITLE LEAFHOPPER DATA;
DATA LHOPPER;
INPUT TRTS $ DAYS;
•
CARDS;
\DAYS is the response variable
CONTROL 2.3
CONTROL 1. 7
~ indicates that TRTS is a non-numerical variable
SUCROSE 3.6
SUCROSE 4. 0
GLUCOSE 3. 0
GLUCOSE 2.8
FRUCTOSE 2. 1
FRUCTOSE 2. 3
[The CLASS statement constructs the treatment indicator variables.
CIJ_SS ic not available in PROC REG.
Treatment indicators
PROC GLM;
\.irould have to be set up in the input statement as in the Electri::;. ty load Data or the Soybean Physiological Data.
CLASS TRTS;
MODEL DA YS:TRTS/NOINT SOLUTION P XPX SSI; This model, following a CLASe statement, is the equivalent of a general means model. A
SO~TION option is needed after a CLASS statement so
OUTPUT OUT:NEW PREDICTED:YHAT RESIDUAL:RESID;
that the parameter estimates will be printed.
ESTIMATE 'CONTROL VS SUGARS'
}
X?X prints the~·~ matrix (see pp. 179-180).
TRTS 3 -1 -1 -1 /DIVISOR:3 E;
ESTIMATE '6-CARBONS VS SUCROSE'
ESTIMATE
TRTS 0 -.5 -.5 1/E;
contrasts,
SAS orders levels of a classed variable alphabetically, or numerically, so
ESTIMATE 'FRUCTOSE vs GLUCOSE I
P• 181
the coefficient~ ~ust be ordered: fontrol, ~ructose, Qlucose, ~ucrose.
TRTS 0 -1 1 0/E;
MEANS TRTS;
Calculates TRT means.
®
PROC PLOT;
@ PLOT RESID*YHAT/VREF:O;
Residual plot for the. general means model in
J;)
PROC GLM;
CLASS TRTS;
MODEL DAYS:TRTS/P XPX SSI;
ESTIMATE 'CONTROL VS SUGARS'
TRTS 3 -1 -1 -1 /DIVISOR=3
ESTIMATE '6-CARBONS VS SUCROSE'
TRTS 0 -.5 -.5 1;
ESTIMATE 'FRUCTOSE VS GLUCOSE'
TRTS 0 -1
1 0;
LEAFHOPPER DAH
The CLASS
statement
produces this
output.
rl ASS
G~~ERAL
LIH~~R
MOCELS
CL'SS LrVFL
L-VELS
TPTS
4
0
~0CEDURE
I~FSRM3TICN
vAL ur::s
C0~TROL
FRUCTJSE GLUCOSE
SUCR~Sr
Note all'habetical ordering
'-:ur-cr.:R
CF
OE'SEFV.t.TIU.s
rr~
iJATA
SFT
=
-:.~--
•
•
With a CLASS statement, SAS creates indicator (dummy) variables and actUEUly forms an X'X matrix as if indicator
variables had been set up in the input statements.
LEAFHOPPER DATA
LEAFHOPPER OAT.\
GENERAL LIN~AR MODELS PROCEDURE
GEN ER AL LINEAR MODELS PR 0 CE.O-UR F.
MATRIX ELf.MtNT R~PRESENTATION
THr X •X MATRIX
fPENDENT VARIABLE: DAYS
DEPENOENT VARIABLE: DAYS
EFFECT
REPRESENTATION
DUMMYr01
OUMMY002
DUMMY003
TPTS
CONTRI"L
FRUCTOSF;:
GLUCO~E
SUCROSE
DUMMYI')Ol
DUMMY ('1)2
DUMMYnl';<
DUMMYn04
DUMMY "01
DUMMY 'l02
DUMMY n()3
DUMMYI'I04
D
TRTS
COEFFICIENTS
CONTROL
FRUCT('SE
RUCOSE
SUCR nsF.:
1}
0.333333
·0.333333
·11.333333
')
(l
2
.,
0
The E option for each
ESTIMATE statement
prints the contrast
vector (the c vector
of cs) •
ESTIMABLE FUNCTIONS FOR CONTROL VS SUGARS
EFFECT
n
0
2
Note the function of the
DIVISOR= 3 option.
~STJMABLf FUNCTIONS FOR 6 CARBONS VS SUCRrSE
COEF F J C1 PHS
EFFECT
MEAfJS
TR TS
CONTROL
FRUCTrSE
GLUCr.!:'f.
SUCROSE
(I
TPTS
·0.5
-0.5
1
CONTROL
FRUCTOSE
GLUCOSE
SUCROSE
ESTIMABLE FUNrTIONS FOR FRUCTOSE VS GLUCOSE
TRTS
CONT RPL
FRUCTr.SE
GLUCO":;(
SUCR"Sf.
IJ
-1
1
0
.,
?
::>
?
DAYS
2.0000001')0
2.20000000
2.9(10000'.)0
3.8001JOOOtl
MEANS TRTS prints the treatment
means. Compare to parameter estimates on next page.
COEFFICTEIIITS
EFFECT
N
-25-
•
OUMMY004
1]
2
•
•
•
GENERAL MEANS MODEL
Jij
Y = TRTS /NOINT
GfNERAL LIN[AR MODELS PROCEDURE
1ARI'ELE: DAYS
D~PE~rE~T
S
~"'lCC
1-1
r,'"'t:L
4
f.3.31J00GOOJ
0~
4
0,3"l"'J0•)0J
E
63.68~oooo:
E•<:::
U~"JRPECTEJ
TOTAL
~·~.~£
1~.05'!0
SIJ'JR'.'O::
rF
T«
~s
TYP>
Note order
CO''TROL
E~TIMA
"SE
=Ys
VS
SUG 'RS
6-CAR~ONS VS S~CRCSE
F~UCT"SE VS GLUCOSE
oe~::RVAT!ON
15.8450"0""
211.?7
DEV
I
S3
l_3 .8"0000 J~
·t1o96666F67
1.250COO:i~
0,7(\00000.1
OBSERVED
V! L UE
.:ns !' "0"~
>
!) •
0 0 "1
F
2.7250~0~"
F
F' R
211.27
.•
~0"!
IT
I
STD ERROR OF
ESTIM!TE
0. f): 05
Oo0003
n."' !l 01
0.19364917
0 ol 9 36 4 917
0 • 1 '? 36 4 9 1 7
0.19364917
1 D.33
llo36
14.98
l9o62
-4.32
5,27
2.56
PREDICTED
VALUE
> "
VALUE.
PR
>
<E--% :ilc
o.~~Cl
Oo0124
0.%29
~ .3 0 "1000 0
_, o3 (F·"OPr 0
- • 2 0 ·"' : -') !' ~ c
2.30SCOOOO
2.COOJil:l0"
lo70':'Ct'OOL'
2.CCO)JJ~')
~
:'i,60'!0COO~
~.P..OO'Jj31J
4
4.0010000"
3.00;)(, 0000
:'.P':'O~J:l8D
.2o~~'"'~,..o
2.c:;OO)J(IQ':'
o10c'l')r"o
- .lCfl"'!':'r:'G
-".1t'""'l"r·c
2ofl'J'COaO':'
?.'?ro··JJ:J~·
2o10'l0000(1
;>,20011JllilC
8
?..30')00000
~.2T!OJJOJO
=IJ.c
=l-Ie -=0
"'~~750
RESIOUftl
1
7
=J.lF
0.2236068:1
') .23717 ')P.2]Contrasts
0.273&6128.
O,'i"·6?
2
5
6
PR
MEAN
DAYS
T FOR He:
PARA"10:TER= 1
TF
GLUC fl~E
<;UCR
F VALUE
~
63.38~GG:JOJ
(2 • IJ 0 0 0 C0 Q~ = Yc
12 .2 0 0 0 (l 0 0" =YF
) :> • 9 (:' 0 0 c t:: ': ' = YG
CGNTRCL
FRUCFSE
SQlJAFE
r-"E~N
0.27:."&6128
Sequentia1s from
ABDO, p. 180
PA'<A~":TEP
SGU.~RES
STD
4
TQ '"S
QP
c.v.
95?
)'• 0
SUr-<
CF
• .1
'J~'lonr
-26-
Control vs. Sugar contrast (seep. 181):
Estimate= -.9667
Standard Error= .2236
= 2.0= SQ,RT[
.3333(2.2)- .3333(2.9)- .3333(3.8)
1.
~ (1+119+119+119)]
o
.
,.,..
•
~ Y
LEA~-1-'0PPE~
GfNERAL
.--
""'I:""":::- t•-.
~.
-
: ,.,
';~:
~
'~
HE'LE:
':"
MODELS
LIN~~R
oqoCECUR~
D~YS
SUM
~F
0~
SGUARES
t'EAN SQUARI'
3
3.97500C0}
1.325010Dn
>!lP.')q
4
0.3;}-:'CC~':l.l
,,,()75-~-~~~
7
4.27:-JCOG~
R-<"~U~R:
c.v.
STD DEl/
DAYS "EAII!
' . "'29;25
1'.05:'0
0.27:"8612?-
2.725r'10fC"
f'F
TYP"" I SS
3
3.975 ::;oc c J
r:~.,R:~"T:::
-r~L
SOVRC:::-
TR TS
ESTIM
~~G'RS
F
PR
1 7 .6 7
"•'!Oq~
'TE
PAq~METER='
-C.9E-66 667
-4.32
1.2st1o ,a)
SLUCOSE
0.7090 '0')
5.27
?.:.G
OJ? SERVED
V~LUE
1
2
3
A
f
7
e
PREDICTED
V.ALUE
0~
17.67
PR
>
F
PR
>
ITI
=11F
=lla =lls =11
STD
ERROR ')F
ESTIMHE
(\ .223606P~
0.23717082
0 .273861 :?E'
0.'124
o.,-o£2
o.:'E?9
OfSIDUtL
2.000. JQOO
1.70~00000
JBO
-".3o~nonr.o
3,6n··o::;ao~
2,['00
?- .e'J'J
JOVC
-~.20"'J3CCO
4.1)');-.0COOO
3,8QO
JJ')O
".2CfrJO!lfO
3.C:'~(~~C~::"
2. 0 20~j:CC
'olC''9('I('O
;>.e-0"0()1)0"
?.10'1CJG0'1
?.3')'00000
?,Q[•(l'JO'J!)
-".10~''1)('('()
?.2::('');)8(1
.r.10"~0t'r·o
2.20C:'JOCO
R:i-lc
F
2.3o~ooooa
RESTDUALS
OF SQU'RED ~ESIDUALS
~~~ OF SQU'~ED RESIDUALS
~RRCR SS
'JQ~T ORD~P AUTOCORRELATI0N
·u~·'·IN· .. ATSIJN C'
·.u~·
~u~
>
VALUE
';ucROSE
0!'-<'EflVATl'
F VALUE}
'1,30°·:'~
_,
T FOP f-10:
PaC!A"':T::;
CO\ITRr·L \:
6-CARI?O'i"
~"RUCT"~SE ·
= TRTS
DAH
·J '"'EL
t.A
•
·~
GENERAL MEANS t-10DEL
'>,;QI'\'l(){){\Q
LEA~'"I-'OPPER
GF.NERAL
CL~SS
c.1ornoooo
......
0"~~('1':')
".:H• ""1"C" 0
-~."0')':'!:'0('0
LINEO~
a
~ss
TRTS
L=-VELS
IJ
OAT~
M02ELS
L~VEL
0 ROC[DUR~
I~FORM~TIO~
V~LUES
2."6f-,f.6H7
'CUMe<R CF O'SE'VP!O>'S IN DATA SP "
-27-
J
rC''TROL FRUCTOSE GLUCOSE SUCFI !SF'
.r.2o~~~cco
F.
•
•
r LYMPHOCYTE DATA -
Unit 17
TITLE LYMPHOCYTE DATA;
DATA LYMPH;
INPUT ATP IG V;
CARDS;
®
j0
no
stimulation
anti-IG
stimulation
no
ATP
treatment
(o,o)
treatment
(0,1)
ATP
added
treatment
(1,0)
treatment
(1,1)
PROC GLM;
CLASSES ATP IG;
Class on both ATP and IG.
MODEL V = ATP IG ATP*IG/P;
~ This model fits the main effects of ATP and IG,
OUTPUT OUT = NEW
R=RESID P= YHAT; f and their interaction, ATP * IG.
PROC GLM DATA = LYMPH;
CLASSES ATP IG;
MODEL Y = ATP*lG/NOlNT SOLUTION SS1;
eSTIMATE 'STI~ULUS' ATP*IG 1 -1 1 -1/DIVISOR=Z;
=sTIMATE 1 ATP PRESENCE' ATP*IG 1 1 -1 -l/OIVISOR=29
ESTIMATE 'INTERACTION' ATP*IG 1 -1 -1 l/DIV1SOR=2;
ESTIMATE 'INTERACTION AOJ 1 ATP*IG 1 -1 -1 1;
Use the general means model to estimate contrasts.
Contrasts among treatment means in part ~ would be
"non-estimable" because the main effects are fitted first.
The CLASSES statement orders the treatments numerically:
(0,0); (0,1); (1,0); (1,1). The contrast coefficients
must be in this order.
------r Refers to variables in CLA.SSES Statement.
9
•
I
PROC PLOT;
PLOT RESID*YHAT/VREF=O;- Residual plot for @ and @.
-2..:-
•
D~ 0 ENDENT
•
FAC:O~LP-~ALYSIS
'l) Y = AI'P IG
VA~IAELE!
A~IG
v
SOURCE
f.'F
OF SGU.A.fiES
SUI"
MEAN
SGUA~'E
F VALUE
"'CDEL
~
19"6oO:'COOG0j
635.3333"33:!
87o63
~~'lOR
4
29 .OO(' ~co,n
7.25nf)~COO
PR > F
CORRECTED TOT4L
7
19:"5.00t ;JCO OJ
R-SQUAR[
c.v.
01 851'13
f:o335=
2o6925b24")
['·F
TYP"" I SS
'l.
SOURCE
Q.00()4
y
"TO GEV
_,
"E~"-'
42o500CI'!Q(~
F VALUE
FR > F
39. T2
216.2 8
6.90
r."'584
o\TP
1
IG
ATP•IG
1
21l8oOOOjOGO
1568.0Q')Ij(-()0
1
50.00~JOOO
SOURCE
rF
TYPE IV SS
F VALUE
PR > F
ATP
IG
4TP•I(;
1
ia 8. o~ ~ oc. c !3 J
15f..8.0000GOllJ
1
':'C.OOOGOOOJ
39.72
216.28
6o90
e.J0:!2
1
c • :: 0 3 2 "1
~· ."0~1
o.~trl
t'o"5e'+
C'B"ERVED
VALUE
PRED!CTEP
VALUE
RESIDUAL
1
3~+.oo:coooo
2
30.00'JLOOCO
3
62.50~00000
4
6 7 .5~ 'l(j 0000
2~ .5Qfj lj 0000
32.000JJ00!1
32.COOJ:i0')0
65.000J!lJOO
65oOOODJOO
25.CIOCJ.lll!l0
2."0C'O)Cil0
-2."00000CO
-<:.5GCOCOOO
2.'50C!!oroo
25.00Qj)Q00
H.COOuilGuO
•J o50t':)'J()C0
-2 .::r,r>'JOCOO
48oll00J):J00
2.:ti(aCI"C·!!
08~ERVATION
5
6
7
8
24 .so co ooco
46oOOCCOCOO
5:·.000CCOOC1
suu CF ~ESIDUALS
S!JV C!= SQL'!"!EO RESIDUALS
SU~
OF
ct~.:T
SQU~RED
9ft8E~:
RESIDUALS - ERRCR SS
,Q!!T~CORPEI ATION
nu<>:· rrJ-w~.ts.ow· iT
~.5cr~t~~ro
r."OC~OCCO
2~.~0CO!H!CO
r..~OOOOCCO
eo~5'.. c·~~·O
~41~+-<;:3
Note that TYPE I and TYPE IV SS's
are the same due to orthogonality.
The SSI option could have been used.
•
•
r])
G[NERAL
D~PEN~E~T
VARI~fLE:
LIN~tR
r·F
~ODELS
PROCEDUR~
SUt>'
()<="
SQUtP E'3
MEAN SOUAR!'"
4r£'.9.:Jor·o.~orn
"'O'>EL
4
163':&.cr.:.'JCOC1
ERROR
4
?9.D'H.lLCO:
UNCORRECTED TOTAL
i'
163E'5.000J0;)01
R~~E
c.v.
STD DEV
!).~3J
E .33:-.5
2.69258241
S 0LIRCE
['f
TYPE I SS
AT 0 •IG
4
1635&.ooovOC:l~
PII.RA"'ETI:R
a
32. C OUi)(!OC =leo
1
6!':1.
1 !l
1 1
25.
STT"'ULUS
A TP PRESErJCE
I ~~'!';O:P ACTI0~J
INTERACT ION AOJ
0 'J u0 0 0 0 = lo 1
(' 0 () 0 c c0 = ~l 0
0 0 0 0 1J 0 0 = Y11
48.
- 28 •
<)
0 0 0 0 0 0 0}
cooooc
-s.nooooooo
12. r:.c
-10.00000000
7. 2 5 r 0 1 0 r:
P·
197
(I
F VALUE
%4
=s2
.flo
PR > F
Y
"~UN
42.5000G000
F
VALUE
PR > F
564 .oc
~.10('1
PR )
IT I
STD ERROR OF
ESTIMqE
16.81
34.14
O.OOCl
1.90394328
0.0001
1.90394328
13.13
25.21
0.00~2
'}.00!11
1.90394328
1.903'9't328
-14.71
; .3 0
-~
s:t.~ame as for ~
0.0001
T FOR HJ:
PARAr-'ET!'"R=(I
ESTIMATE
~
•
Y=ATP*IG/NOINT
Y
SIJI!RC:
ATD•!"
•
GENERAL MEANS MODEL
.63
-2.63
lJ.OOCl\
1.90394328}
1.90394328
o.oo3~j
·
e.o5?4
1.90394328
0.058~
.
3.80788655
Compare
s~gnif~cance
levels to those of
the TYPE I SS in
part ®
-30-
In 'A) the contrasts are computed as part of the model.
In :}3) the contrasts are specified.
•
.----------::•---..
FAT DIGESTIBILITY DArA-
~ni:
17; ACO, p. 365 (SAS)
TITLE FAT 01GtSTI6ILITV DATA;
OATA FAT_CIG;
[NPUT BLOCK F!T $ LECITHIN V;
)
LAeEL 8LCCK = PERIGO;
IF FAT='T' Af\jO LECITHIN=O ThEN HIT=l;
ELSE IF F~T='C' AND LECITHII'i"'J THEN TMT=2;
Creating the indicator variables.
ELSE IF FAT= 1 T 1 AND LECITHIN=l THEN TMT=3;
ELSE If FAT= 1 C1 AND LECITHIN=l THEN TMT=4;
CARDS;
T o o4.6
T 0 52.4
T 0 S3.8
c
c
0 6l: •.j
0 60.1
c 0 64.4
T 1 as.o
T 1 68.<;
T 1 17.5
c 1 <;6.0
C 1 ~O.It
c
1 98.2
PROC GLM;
CLASS BLCCK T!olT;
MODEL Y = BLCCK T~T/XPX;
10 OUTPUT OUT=NEW R=RESID P=YHAl;
ESTIMATE •w VS WO LECITHIN' TMT .5 .5 -.5 -.5;
ESTIMATE 'F~T OIFF WO LECITHIN' TMT 1 -1 0 O;
ESTIMATE 1 FAT Olff W LECITHIN' TMT 0 0 1 -1;
PROC PLOT;
~ PLCT RESID*YHAT/¥~Ef=O;
Residual plot for
®.
}
~del'
Equal means/Period Indicators/Treatment Indicators
and contrasts as discussed in unit 17.
•
•
•
GENERAL LINEAR
~UDELS
MODEL SEQUENCE
PPOCEOURE
®
CLASS LEVEL INFORMATION
CLASS
LEVELS
VALUES
BLOCK
3
l 2 3
HIT
4
1 2 3 4
NUMBE~
•
OF CBSERVATIONS IN DATA SET
Y = Equal means IPeriods I'l'reatments
12
THE X'X MATRIX
DEPENDENT VARIABLE: Y
INTERCEPT
BLOCK 1
12
4
4
INTERCEPT
BLOCK 1
BLOCK 2
BLOCK 3
TMT 1
TMT 2
TMT 3
TMT 4
4
3
3
3
3
BLOCK 2
BLOCK 3
•4
4
I~
0
4
4
0
I
I
I
I
I
-
--
--
1
1
1
1
I)
~
1
1
1
1
1
1
1
1
TMT 1
3
.- - , - - - - 1
l
3
0
0
0
OF
SUM Of SQlJARES
MEAN SQUARE
MODEL
5
2729.5~083333
545.90816667
46.06
ERRCR
6
71.10833333
ll.85l38889
PR > F
11
2800.6491666 7
R-SQUARE
c.v.
ROOT IolSE
Y MEAN
IJ.<;1461C
4.7089
3.44258'•62
13.10833333
OF
TYPE I SS
F VALUE
PR > F
!~LOCK
2
TMT
3
1911.81166667
2530.72916667
8.39
71.18
O.Olfl3
0.0001
l)f
TYPE 11 I SS
F VALUE
PR > F
2
3
198.tHl66667
8.39
2530.72916667
71.18
0.0183
0.0001
'
CORRECTED TOTAL
SOURCE
SOURCE
f3LOCK
T14T
PARAMETER
Contrasts:
W VS WO LECITHIN
FAT OIFF ~C LECITHIN
FAT diFF W LECITHIN
f
VALUE
0.0001
ESTIMATE
T FOR HO:
PAR AMET ER=O
PR > IT I
STll ERROR UF
ESTIMATE
-25.78333333
-6. 5f666667
-17.73333333
-12.97
-2.34
-6.31
0.0001
0.0581
0 •.0007
1.98757716
2.81085857
2.81085857
3
·- 1- 1
1
0
3
0
0
-
-
-
-
TMT 4
3
r-- - - - 3r·- 1
1
0
0
3
0
The XPX option on the model statement produces this
listing o~ the X'X matrix. Notice that the blocks
are orthogonal to one another (upper left box) and
the treatments are orthogonal to one another (lower
right box). Further, the blocks are orthogonal to
the treatments.
DEPENDENT VARIABLE: Y
SOU~CE
TMT 3
THT 2
-32-
1
1
0
0
0
3
I
'
•
FAr
~LCT
JF
~ES!C~VHAT
U:GENO:
A
•
~ ResUual ::clot :'!'c::: ~.
CATA
DIG~STlo!LlT~
l
2 CBS,
OBS, 8
ETC.
.HSIO
4
+
3
+
2
A
A
I
I
I
I
A
+
A
l
0
+
•
I
I
I
I
A
A
A
+------------------------------------A------------------------------1
I
I
I
-1
+
-2
+
A
-3
A
+
I
I
I
I
-4
-5
A
r..
+
+
--+---+---+---+---+---+---+---+---·---•---+---+---+---+---+---+---+-51
S4
51
60
63
66
f9
72
7~
VH~T
78
81
84
97
~1
~3
96
~~
•
•
•
I ?::\::7-r~; :~::::·RITION
TITLE: ~UTRITI l"l
DATA PPOlE'If\;
lf\PUT FRCTEI\
CARCS;
CATA;
$
DATA - C:ni;; lC
I
Y;
H 179
h 136
I" ll:O
H 227
H 217
H ll:8
:1.0 ::::crsebean observations
H 108
H 124
H 143
H 140
L 309
l 22S
L 1s1
l 141
l 260
L 2iJ3
l 148
12 linseed observations
l lf:9
l 213
L 257
l 244
l
s
s
s
s
s
s
s
s
s
s
s
s
s
s
211
243
230
248
327
329
250
1<;3
211
316
14
sc~•bean
observations
2l:7
199
177
158
248
PROC GL~;
CLASS PRUTEIN;
MGDEL Y = P~CTEIN/NOI~T SOLUTION
CuTPLT UuT=NE~ P=YhAT R=RESIO;
ESll~ATE 'HORSEBEAN VS OllMEAL'
{ ESTIMATE 'LINSEED VS SOY9EAN 1
~ ESTIMATE •ORTHO H-8 VS OllHEAL'
See p. 217
Natural r:ontrasts
~
I
P SSl;
PROTEIN l -. 5 - • 5 ; ---..J
PROTEII\4 0 l -1;
PROTEIN 13 -6 -7/0IVISOR=l3;
PRCC PLCl;
j) PLC T .?. ES IU* YH AT /VR. EF=O; Residual plot for
Using the CLASS statement to fit the general means model,
) followed by natural an1 orthogonal contrasts, as discussed
in Unit 18.
See p. 219
Ortho Contrasts
'J;}.
- 'O)J-
•
•
•
•
GENERAL MEANS MODEL
@
Y "'PROTEIN INOINT
DEPENDENT VARIABLE: Y
DF
SUM OF SQUARES
MEAN SQUARE
F VALUE
MOnEL
3
16839q7.~3571~29
561332.~78571~3
229.66
ERROR
33
80659.56~28571
2~~~.22922078
UNrQRRECTED TOTAL
36
1764657.0!1000000
R-SQUARE
c.v.
STD DEV
Y MUN
~.954292
23.1656
49.1t391~66/t
213.41666667
DF
TYPr I SS
F VALUE
3
1683997.43571429
229.66
SOURC".:
SOURCE
P~'lTEIN
PARAMETER
PR 'lTE IN
ESTIMATf.
iH
160o20000000 =
218o75000000= lL
2~6.8571'+286 = Ys
H
L
s
PR >
F
0.0001
PR > Ff- Tests:
fl• n
T FOR Hf1!
PARAMETER:O
PR > IT I
10.25
15.33
18.68
o.ooo1
0.0001
0.0!101
J..lH =~-~t. =J..Ls =0
not
J..lH =J..LL =J..Ls =J..L
0111
ST D ERROR OF
EST I MATE
15.63~03000
14.27185231
1 3 • 21316 7 7 3
Contrasts:
VS OILMEAL
LI
ORTHO H-B VS OILMEAL
HO~SEBEAN
~!SttD-VS-SOYPEAN
OBSERVATION
1
2
3
q
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
-72.603571~:'1
-3.94
o.ooo~
-28.10714286
-73.681!6153R
-1.~5
0.1'578
o.nno3
-4.(!1
18.41171677~
19. 4 492 5628
In this case, the ~atural and ORTHO
1 a • 3 9 6 51 ~ 3 0~contrasts give si!lll.lar results.
OBSERVED
VALUE
PREDICTED
VALUE
RESIDUAL
179.00IJOOOOO
136.00000000
161J.OOOOOOOO
227.00!10000(1
217.00000000
168.00000000
1oa.oor.ooooo
124.001100000
1'+3.00(100000
141l.OOOOOOOO
30"'.001'00000
229.00{100000
181.00000000
141.00000000
26n.oooooooo
2 03 .DODO OOiiO
1411.0000 0000
169.00000000
213. OOQO 0000
257.00000001)
160 .200!liJOO"
160.2000il000
160.2001)0000
160.200t10000
lii.P.O[Inonco
-2q .2 000000 0
-0.20!100000
66.80000(100
56.fl0£100000
7 .so (1'}000 0
-52.20(1'!0(!00
-3 6. 2 0 Q0 0 (1 (I 0
160.200'J~il00
160.200:)0000
16().2(101\0000
16'l.2001):J000
160.2000,)o)()0
160.2000~000
218.750~1)0t)0
218. 750'l\l000
211lo750!l'JQOO
218.75000000
218.7500tlOIJO
218.75000000
218 .750'1i)000
218.75000000
218. 7501JO 00
218.7500\IOGO
-17.20~00!!00
-20.20000000
9!'.251'1000(\0
10 .25"00000
-37.75~00000
-77.75('00000
'11.25'1'!0000
•15.75!l!lOC!'O
-70.75!'l'l0000
-49.75000000
-5 • 75r"'HIOOO
3R.25000000
-35-
OBSERVED
VALUE
PREDICTED
VALUE
RESIDUAL
24~ .oooooooo
271.00000000
2q3.00000000
231l.OOOOOOOO
21t8.00(100000
327.01)000000
329 .oooo 0000
251'1.00000000
193.00000000
271.00000000
316.00000000
267.00(100000
l9CI.OOIJOOOCO
177 .oooooooo
158.00000000
248.00000000
218.75000001'1
218.750!lil000
246.85711j286
246.85714286
246.857111286
246.857H286
21j6 .85711t286
246.85714286
2~6 .115714286
2~6 .85711t286
21j6.85714286
24 6.85 71'12 86
25.2511(100(10
52.251100000
-3.85714286
-16.85714286
2~6.85714286
2~6.85714286
246.85711j286
2'16.85714286
SUM OF RESIDUALS
SUM OF SQU~RED RESIDUALS
SUM OF SQUARED RESIDUALS - ERROR SS
FIRST O~DER AUTOCORRELATION
DURBIN-WATSON D
1.14211571~
80.14285714
82.11j285714
3.1~2A571~
-53.857111286
24 .1~28571 ~
69.1428571/j
2Clol~28571'1
-q7.fl5714286
-69.857142e6
-88 .857llj286
1eH285711j
IJ.IJQn(lOOOO
8 0659 o561j 2.8571
-O.IJOl1l1001lO
0 •.~4539716
1.304P.0762
•
•
r
s;·:A.:,lF :;::H :A':.A
•
I
CPTIGNS lS=75 NOCATE;
Sto~Afo'P;
I~PUT lOC
DAU
TYPE TMT Y;
Creates the data set SWAMP.
CAllOS;
Flow Chart of the Analysis
PROC Glfol;
CLASSES LOC TYPE;
10MODEL Y=LCC TYPE LOC*TYPE/P SS1 SS2 SS3 CLM;
O~TPUT OUT=NEW P=YHAT R=RESIOl;
MEANS LGC TYPE LOC*TYPE I OEPONLY;
LSMEANS LOC TYPE lOC*TYPE I STOERR;
1.
':A) Model Sequence for:
a.
2.
PROC
GUI; lOC TYPE;
ClASSES
MCOEL Y=LCC*TYPE/NCINT;
~ESTifiATE 1 CCNTRAST1 IN R0Wjl 1 LOC*TYPE 0
c ESliMATE 1 WEIGHTED CONT2 ROWL' LOC*TYPE
;:. ESTIMATE 1 CGNTRASTl IN ROW2 1 LOC*TYPE 0
fESTH44TE 'kEIGHTEO CONTZ ROW2 1 LOC*TYPE
~
Interac .....i on ...< s
·.,
~:::>-or
composite test of interaction
b. residual evaluation.
Decide if interaction is important.
~Interaction is not important.
t~
an
1 -1 0 0 O;
@ 3,
ll -6 -5 0 0 J/OIVISOR=ll;
0 0 0 1 -1;
4
0 0 0 14 -8 -6/0IVISOR""l4i
'
':: ESTU4ATE 'UNWGHTED CONTZ ROW1 1 LOC*TYPE 2 -1 -1 0 0 0/t>IVISOR=Z;
~ESTIMATE 1 UNWGHTED CONT2 ROWZ' lOC*TYPE 0 0 0 2 -1 -1/DIVISOR,..2;
Make 1st simple effects
contrasts in each row (or col.),
.
. nd ·
~~~~~:s~! ;hou~~!e
weighted or unweighted.
l
©
~
cw
®
~
~
;w
3.
Force interaction into the
error term.
Choose among
Natural main effect contrasts.
Proportional main effect contrasts
2E£ main effect contrast
orthogonal to lst main effect
contrast (adjusted for
unequal nij ),
PROC GLM:
CLASSES LCC TYPE;
lV MCDEL Y=LOC TYPE/SSl ·ssz;
ESTIMATE 1 LOC NAT MAIN EFFECT 1 LCC 1 -1;
ESTI~ATE 1 TYPE NAT ~AIN EfECT1 1 TYPE 0 1 -1;
GV ESTIMATE 1 TYPE NAT MAIN EfECT2 1 TYPE 1 -.5 -.5;
GD
ESTIMATE 'TYPE PRO MAIN EFECT2 1 TYPE 25 -14 -11/DIVISOR=Z5;
GY
ESTIMATE 'TYPE ORTHO MAIN EFF2 1 TYPE 1 -.552577 -.447423;
-:6-
•
General J.Iea.::o ;.!od.el Analysis Using Model Sequence
GENERAl LINEAR MODELS PROCEDURE
J)
DEPENDENT VARIABLE: Y
SOURC!:
OF
SUM OF SQUARES
F VALUE
5
;~- 42538095
2.5")
MODEL
ERROR
29
CORRECTED TOTAL
5.63633333
34
ROOT MSE
0.300852
6.6167
0.44085862
=
=
3.99
2.68
1.56
0.0553
0.0853
0.2266
ss I F VALUE
PR > F
I TYPE
II
1.33577182
(
6.87
2.68
1.56
1.04276977~
0.60773900
I
\
TVPE III SS
F VALUE
1
2
2
1.00971645
0.50903840
0.60173900
5.20
LOG
y
LSMEAN
STO ERR
lSMEAN
19
16
(1)6 .52631579
6.82500000
3)6.47055556
6.85000000
0.10304181
0.13075228
TYPE
N
y
y
LSMEUI
P~
(35)(6.66285) 2
1553.8
STO ERR
LS"'EAIII
LOG
0
1
2
North
Mesic
Shrub
@6.84000000
6.62857143
6.54545455
:0 6.86250000
11
O.Ol3d
6.60833333
6.51000000
North
Mesic
Shrub
North
Mesic
Shrub
N
'(
LSMEAN
STO ERR
l S"'EAN
8
6.82500000
6.46666667
6.12000000
6.90000000
6.75030000
6.90000000
6.8250COOO
6.46666667
6.12000000
6.90000000
6.75000000
6.90000000
0.15586706
0.17997978
0.19715797
0.31173412
0.15586706
0.17997978
6
5
2
8
6
1.31
1.56
PR
>
F
0.0302
0.2854
0.2266
Notice that the cell means agree with the cell least square means.
For the General Means model the predicted values are these cell means.
ANOVA (1)
Source
R(Mea::)
R (LOC)
R(TYPE ILOC)
R(LOC*TYP.E!LOC,TYPE)
Residual
df
ss
1
1
2
1553.8
o. 7749
If interaction is judged important
Lo43
2
29
0.6077
5.636
If interaction is not judged to be important
=> both LOC and TYPE are needed (pg. 230)
=>
@
then
=>
@
or
GV.
W then
@, @,
or
Residual Analysis:
l\NOVJ.. (2)
Source
R (!>lear;.)
R(TYPE)
R (LOCI :YPE.:)
R(TI~Rfl.C:ION)
?.esii'..:.sl
df
1
2
1
2
0.17426467
0.11904543
0.13347658
y
TYPE
OJ
0
0 Near 1
()
2
0
1 Away 1
1
2
0.0853
0.2266
10
14
11
TYPE LOC
OF
TYPE
LOC•TYPE (Inte!'action)
N
I
LOC TYPE
SOURCE
> F
1 1 8176 {0. 77487218
2 °
1.04276977
2
0.60773900
1
2
2
y
LOG
6.66285714~
F VALUE
OF
LEAST SQUARES MEANS
ME~NS
Y Mr::AN
TYPE I SS
OF
LOG
TYPE
LOC*TYPE
[6.757 + 6.391 + 6.319./:- (unweighted average o~ estimf.~ei
cell means)
[6.757 + 7.172=/2
0.0536
R(Mean)
SOURCE
j)
~
0 Near
1 Away
c.v.
lOG
TYPE
LOC*TYPE
~·
[6"825(8) + 6.l,.c?(6) + 6o12(5)]/19- (weighted average o:' c'::ser[6.825(8) + 6"9(2)]/10
vations)
PR > F
0.19435632
8.06171429
R-SQUARE
SOURCE
•
pH UTA
:iJ
Not shown but the magnitude of the residuals is acceptable and no
pattern is e'.'ident
(one or two values s!:ould be checked).
ss
1553.8
1.8176- lo3358
1.335
0.6077
= o.4818
29
-37-
JV.
•
..:2--
SAS
•
Ge!lel,:::
GENEPAL LINEAR MODELS PROCEDURE
.!:Cs:J.s
•
Ee:.:.~r.c:ion
DEPENDENT VARIABLE: Y
SOUPCE
OF
SUM Of SQUARES
MEAN SQUAR!:
MODEL
6
1556.2)366667
259.36727778
1334.49
ERFOP
29
5.63633333
0.19435632
PR > F
UNCORRECTED TOTAL
35
1561.84000000
R-SQUARE
c.v.
POOT MSE
Y MEAN
o. '3<;6391
6.6167
0.44085862
6.66285114
OF
TYPE I SS
F VALUE
PR > F
6
1556.20366667
1334.49
0.0001
OF
TYPE I II SS
F VALUE
p~
6
1556.20366667
1334.49
0.0001
SOURCE
LOC*TYPE
SOURCE
LOC*TYPE
PARAMETER
~ONTRAST1 IN ROW1
~EIGHTEO
CONTZ ROWl
~ONTRASTl IN P.OW2
~EIGHTED CONT2 ROW2
~NWGHTEO CONT2 ROWl
..;,tJNWGHTEO CCPH2 ROW2
ESTIMATE
F
VALUE
0.0001
PR > ITI
STO EI<ROR Of
ESTIMATE
1.30
2.52
-0.63
0.26
2.59
0.22
0.2043
o.o176
0.5336
0.7988
o.ot4a
0.8237
0.26695315
0.34666667
-0.15000000
O.J8571429
I o.53t66667
0.17500000
Interpretation:
Objective:
j~dged
to be important (see text
o.204849~
0.23809087
0.33325779
o.zoszoa5z J
~.33369144
(1) Within the near location, community type North has a higher (0.5) pH
than the average of the other two corr.muni ty types (p = • 02).
(2)
There is some evidence that within the near location, the pH for the
Mesic Community is higher than Shrub Community (p = .20).
(3)
vii thin the away location, the pH for community types does not vary.
-38-
r.
(1) to estimate the cell means from the
general means model;
(2) to estimate column contrasts within
each row (or row contrasts within
each column).
> F
T FOR HO:
PARAMETER=O
r o.sls9o9o9
Interaction is
22C and 229).
•
•
•
@ General Means Est ...... - tion (with No Inte:--c.ction)
SAS
GENERAL LINEAR MODELS PROCEDURE
Situation:
The intercction is judged to be unimportant
but bath LOC and TYPE are needed in the model.
Objective:
To estimate main effects contrasts from the
restricted m0del. The restricted model (without
interacti0n) both adds the interaction SS to the
error SS AND f0rces differences between rows (cols.)
within allC0lumns (rows) to be equal.
DEPENDENT VARIABLE: Y
OF
SUM OF SQUARES
MEAN SQUARE
"*DDEl
3
1.81764195
0.605880&5
3.01
ERROR
31
6.24407234
0.20142169
PR > F
CORRECTED TOTAL
34
8.06171429
SOURCE
R-SQUARE
0.225466
SOURCE
LOC
TYPE
SOURCE
LOC
TYPE
PARAMETER
LOC NAT MAIN EFFECT
TYPE NAT ~AIN EFECT1
~TYPE NAT MAIN EFECT2
~TYPE PRO MAIN EFECT2
&TYPE ORTHO MAIN EFF2
c.v.
ROOT
MSE
We can see these restricted means with Means,
LS Means or the P option.
Community
Y MEAN
0.44880028
OF
TYPE l SS
F VALUE
1
2
0.77487218
1.04276977
3.85
2.?9
OF
TYPE II SS
F VALUE
l
2
1.33577182
1.04276977
6.63
2.59
-0.41500335
0.07233758
0.40174146
0.39740121
0.39793817
VALUE
0.0451
6.7359
ESTIMATE
F
LOC
6.66285714
PR >
F
PR >
6. 757
7-172
Mesic
Shrub
6.391
6.806
6.319
6.734
Note that the difference between rows is the
same for each column (any contrast among
columns is the same for each row).
0.0589
0.0913
F
0.0150
1).0913
T FOR HO:
PARAME'T ER=IJ
PR > ITI
-2.58
0.40
2.26
2.24
0.0150
0.6919
0.0311
0.0326
0.0324
2.24
near
away
North
STD ERROR OF
ESTIMATE
0.16115307 ~
:>.18087522
•).17791409 2
1).17766482
').17765975 4
6.9o4 - 6.489 = o.415
6.599- 6.527 = 0.072
6.965 - (6.599 + 6.527]/2 = 0.4017
((25)(6.965) - (14)(6.599) - (11)(6.527)]/25 = 0.397
6.965- ((.552577)(6.599) + (.447423)(6.527)] = 0.398
These main effect contrasts are contrasts among the restricte0
cell ""-"!ans.
-:9-
OBSERVATION
•
•
•
OBSERVED
PREDICTED
RES l DUAL
LOWER q5:c CUI
UPPER 95lf: CLM
l
6.60000000
2
7.2000JOOO
3
7.200')0000
4
7.00000000
'5
6.80.JJOOOO
6
6.40000000
7
7.0000~000
8
6.40000000
q
6.80000000
10
7.00000000
11
6.20000000
12
6.20000000
13
6.40000000
14
6.2000JOOO
15
6.4000')000
16
5.20000000
17
6.20001)000
18
6.40000000
19
6.40000000
20
6.800001)00
21
7.00000000
22
6.2000!)000
23
5.60000000
24
7.20000'l00
25
7.20000000
26
7.20000000
27
6.20!)1)1)000
28
7.20000000
29
7.20000000
30
7.20'JJOOOO
3l
6.80000000
32
7.00000000
33
6.80000000
34
7.00000000
35
6.6000:)~00
6.82500000
-1). 22500001)
6.82500000
0.37500001)
6.82500000
0.37500000
6.82500000
0.17500000
6.82500000
-0.02500000
6.82500000
-0.42500000
6.82500000
0.17500000
6.82500000
-0.42500000
6.'t6666667
0.33333333
6.46666667
0.'53333333
6.46666667
-0.26666667
6.46666667
-').26666667
6.46666667
-0.06666667
6.46666667
-0.26666667
6.12000000
0.28000000
6.12000000
-0.92000000
6.12000000
o.o8oooooa
6.12000000
0.280001)0·:)
6.12000000
0.28000001)
6.9000001)0
-0.10010000
6.90000000
0.10000000
6.75000000
-0.55000000
6.75'100000
-1.15000000
6.75000000
0.45000000
6.7500000')
0.45000000
6.75000000
').45000000
6.75000000
-0.55000000
6.75000000
0.45000000
6.75000000
1).45000000
6. 90000001)
0.30000000
6.90000000
-0.10000000
6.90000001)
0.1000000()
6.90000000
-0.10000000
6.90000000
0.10000000
6.90000000
-0.30000000
6.50621858
7.14378142
6.50621858
7.14378142
6.50621858
7.14378142
6.50621858
7.14378142
6.50621858
7.14378142
6.50621858
7.14378142
6.50621858
7.14378142
6.50621858
7.14378142
6.09856959
6.83476374
6.09856959
6.83476374
6.09856959
6.83476374
6.09856959
6.83476314
6.09856959
6.83476374
6.09856959
6.83476314
5. 71676985
6.52323015
5. 71676985
6.52323015
5. 716 76985
6.52323015
5.71676985
6.52323015
5. 71676985
6.52323015
6.26243716
7.53756284
6.26243716
7.53156284
6.43121R58
7.06878142
6.4H21858
7.06878142
6.4.H21858
7.0667tH42
6.43121858
7.06878142
6.43121858
7.06878142
6.43121858
7.06878142
6.43121858
7.06878142
6.43121858
7.06878142
6.53190292
7.26809708
6.53190292
7.26809708
6. 53190292
7.26809708
6.531()0292
7.26809708
6.53190292
7.26809708
6.531<J0292
7.26809708
SUM OF RESIDUALS
SUM OF SQUARED RESIDUALS
SUM OF SQUARED RESIDUALS - ERROR
PRESS STAll STIC
FIRST ORDER AUTOCORRELATION
OURBIN-kATSON D
ss
0.00000000
5. 63633333
0.00000001)
7.80612245
-0.02583880
2.02672788
+--
~
•
•
SWAMP DATA - Unweighted Analysis of Cell Means
-- -see Snedecor & Cochran, 7 ed., p. 418
OATA SwAMP;
INPUT LOC TYPE TMT Y;
CARDS;
~
PKUC ANOVA; CLASS TMT;
MODEL Y -= TMT;
MEANS TMT I DEPONLY;
-::;:'\ The six treatment combinations are indicated in the CLASS variable ThlT. ·
-6' The residual !-13 is an estimate of cr 2 •
PRUC SOKT; BY TYPE LOG;
~
!;.
/,:\ The six cell means are computed and placed
in the data set NEW.
PROC MEANS MEAN NGPRINT; oY TYPE LUC;
OUTPUT OUT=NEW MEAN=MY; VAR Y;
-.ii.J
PROC ANOVA; CLASS TYPE LuC;
MUUEL MY -= LOC TY~E LUC*TYPE;
MEANS LOC TYPE LOC*TYPE I DEPONLY;
·JD
The main effect SS and interaction SS are determined at this step.
-41-
•
•
j[
•
•
One-way ANOVA on the six treatment combinations.
ANALYSIS OF VARIANCE PROGEDURE
CLASS
INFJRMATluN
LEV~L
VALut:~
LEVELS
CLASS
TMT
2
6
j
4 '> 6
NUMBER Of OdSERVATlDNS IN DATA SET = 35
DEPENDENT
V~RIABLE:
SOURCE
Y
OF
SUM OF
SI.JUARES
1'1EAI'< Sl.iUAt<.E:
f
MODEL
5
2.42538095
0.4tJ.5076U
ERROR
29
5.63o333.H
I Ool'1'1-.h632]
CORRECTEu TuTAL
R-SQUARE
c.v.
0.300852
SOURCE
TMT
Y MEAN
6.6167
0.440851362
6.6o2tJ51l4
OF
AN0VA SS
5
2.42538095
VALUE
F
I'R
2.50
i)j.;
>
f
Note:
s2 is all that is to be used from this
ANOVA table along with the associated
error df = 29 .
o.053o
Dt:V
STD
2.50
= s2
8.06171429
34
1/'ALU(
>
f
0.0536
MEANS are the cell means
TI'1T
N
y
l
2
3
8
6.82500000
6.46oo6667
6.12000000
6.90000000
6.75000000
6.90000000
6
5
2
4
5
6
Calculate:
1
~
1
d
6
(1
1
1
1
1
1\
= 2ffi )3"+0'+5+2+-s+"b;
=
0.21389.
Note:
Thus, ~
-42-
= 4.675
max(nij)
.
8
SJ.nce i (
) =2 > 2
m n nij
the analysis of unweighted
cell means is of dubious worth.
•
:!,
'l'here is no output from
ANALYSIS OF VARIANCE
J:
PROCEOU~E
•
•
DEPENDENT VARIABLE: MY
SOURCE
uf
SUM
OF
S~UARES
MEAN
S-1\JAr<.i:
MODEL
5
0.47950231
0.095'10046
ERROK.
0
O.JOJJOOOO
O.OOOO.JOOJ
CORRECT!:!) TOTAL
5
v.H9S0231
ANALYSIS Of VARIANCE PROCEDURE
CLASS LEVEL
CLASS
R-SQUARE
c.v.
STu OEV
1.000000
0.00·)0
O.OOOOJ·JOO
lilY
MEAN
LOC
TYPE
TYPE*LOC
l)f
ANOVA SS
1
2
2
0.21596713
0.13235093
0.13118426
LEVELS
3
1 2 3
LCC
2
l 2
6.6602171d
F VALUE
PK
>
08SERVAfiO~S
TYP~LOC
ERROR
F.05
1,29
F.Ol
1,29
df
ss
MS
"!:,
1
2
2
29
1.00965
0.151874
0.61329
5.63633
1.00965
0.30937
0.3o664
0.19436
5-19
1.59
1.58
= 4.18
= 7.60
.
F.05
2,29
F.25
.
(N JATA SET
n
where:
LOC SS = 4.675(0.21596713) = 1.00965
TYPE SS = 4.675(0.132:;093) = 0.61874
TYPE*LOC SS = 4.675(0.1311E426) = 0.61329
Error SS from part :!)
These are only approximate F ratios because
given equal weight in this analysis. ·
-43-
t~e
cell means are
Loc 1 =Near
2 =Away
3 =Shrub
=o
the number of cell means.
These are the desired SS which need to be multiplied by nh = 4. 675,
the harmonic mean number of observations per cell.
= 3-33
2,29 = 1.45
2 =Mesic
f
ANOVA of Unweigl1ted Cell Means
Source
LOC
TYPE
Type 1 = North
VALUES
TYPE
NUMBEK OF
SOURCE
lNFO~MATJON
•
•
:K) continued
•
ANALYSIS OF VARIANCE PKOCEDURE
MEANS
N
1
2
I
TYPE
3
TYPE
LOC
l
1
1
2
2
3
2
I
I
MY
I
\
..
,.
These are unweighted means, e.g.
6.86250000
6.60833333
6.51000000· .. '
6.471
1
= 316.825
+ 6.467 + 6.120) .
Thus, they correspond to the LSMEANS from the model which incluoes LOC,
TYPE and LO~TYPE.
Note: The N are not appropriate on this page.
/'.
MY
6.8.2500000
6.90000000
6.46666667
6.75000000
6.12000000
6.90000000)
l
2
1
2
The standard error of any location
'
6.47055556
6.85000000
J
1
2
3
MY
LOC
mean~is
The standard error of any type mean is
/
.J
These are the six cell means -- compare with part 0).
- They are in different order because we list
TYPE LOC here and LOC TYPE in~.
s2
3(~)
0.1~436
3(4. 75)
0.19436
0.1442
2(4.675)
= 0.1177
Seep. 419 of Snedecor and Cochran (7 ed.) for a discussion of calculating the correct standard errors
of comparisons among row means, column means and individual cell means.
-44-
•
r-------~----·~ -~------------------.I
SOYBEAN DATA- 1..::c.i"'; 19; ACO, p. 273 (J.liNITAB)
DATA SOY8EA~;
TITLE SOY~EAN CATA;
I~P~T
LIG~T
$
•
Create the data set SOYBEAN.
YIELD
~EIG~T
~~;
fJ"'V=I-F:lGHT;
X1 = ((L!GHT='L');r.e~e?re
L I GHT = 1 C 1 I ; ) Th
"1 og~~a
· 1 ~· f" saemens.
t t
t
If th esaemen
t t
t ~ns~e
. . d th e:;;r,ren th es~s~s
. . t rue, th en th eparen. th es~s
. h esavaueor;
l
' 1
XZ=
Xl = 1 _ x1 _ xz;' ~f ~t ~s false ~t has a value of zero.
c
c
CA~DS;
c
52 12.4
50 12.4
L 63 16.6
l 4J 15.8
l <;Z 15.9
s 52 9.1
s 66 10.2
48 12.2
61 12.7
c 51 12.3
L 5) 15.8
L 4'il 15.8
s 62 9.8
s 5'5 9.4
c
c 42 ll.<J
33 11.4
L 50 15.8
l 50 16.()
s 52 9.5
s 67 10.3
s 56 9.3
c
c 35 ll.3
c 4d 12.3
L 63 16.5
L 49 15.8
s 54 9.5
s 55 9.5
-Sets mea.t'l of DEV
@PROC STANCARO MEAN=O;
= 0.
C 40 llo B c 4812.1
c 51 12.2 c 56 12.6
L 33 15.·) L 38 15.4
L 35 ts.v L '51) 16.2
s 58 9.6 s 45 tl.8
s 40 8.5 s 41 8.6
c oo
c o5
L 45
L 62
s 57
s 67
u.1
13.2
15.6
16. 1
9.5
10.4
I t is equivalent to Height- Height.
VAR OEV;
'ID PROC
Prints the ~ matrix plus height and Y (Yield) :'or
PRl~T;
"C".
VAR X1 X2 X3 DEV HEIGHT YIELD;
f0PROC REG;
MODEL YIELO=Xl X2 X3 OEVINOINT SEQB SS1 SS2;
CLTPLT OLT=TRY P=Y~AT R=RESlO;
C_VS_TRT: TEST Xl-.5*X2-.5*X3=0;
L_VS_S : TEST X2-X3=0i
@
PROC PLOT;
PLOT RESID*YHAT=LlGHT/VREF=O;
PLCT YlELD*HEIGHT=LIGHT;
Model fitting the cevariate deviations last.
Use TEST statements with PROC REG to test contrasts. Instead of specifying the
coefficients as with EST~~TE, use the equation that represents the contrasts
under the null hypothesis.
Residual plot for'~·
Plot o~ the response variable vs. the covariate.
@PROC GLM;
CLASS LIGHT;
MODEL VIELD=LIGHT HEIGHT LIGHT*HEIGHT;
Model fitting
sepa-a~e
slopes
~~ter
a common slope.
'l)P~OC GLI'!;
CLASS LIGHT;
~OCEL
YlELC=LIGHT
H~IGHT;
L SME llNS Ll GHT IS TDER.fl. i
+ - Adjusted treatment means.
MEA,_S
LIGHT;
ESTIMATE •CilNTRCL \IS TMT' HEIGHT J LIGHT Z -1
ESTIMATE 'LIGHT \IS SHADE' LIGHT 0 l -1;
ESTT~ATE
1 CO~MCN
SLOPE'
HEIGHT 1;
-li01'/ISOR=2;
'Jnadjuste:i trest~cnt means AND means of the covariate (Height) in
each :!.eve::. of light.
•
•
•
SUYIJEAN DATA
UI3S
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
21
28
29
30
31
32
33
34
35
36
31
38
39
41)
41
42
43
44
45
~
Control
treatment
INDicator
X1
X2
X3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
;)
0
0
I)
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
1
1
1
fJ
1
1
1
1
1
1
1
0
0
0
0
()
0
0
0
I}
0
')
0
()
0
')
0
0
I]
a
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
1
1
1
'J
1
1
1
0
1.
0
0
HEIGHT
UEV
-3.2
o.8
-9.2
-16.2
-11.2
-3.2
8.a
9.6
-1.2
-18.2
-3.2
-0.2
4.8
13.8
-0.2
11.8
-1.2
11.8
-18.2
-13.2
-6.2
-1.2
-3.2
-1.2
-2.2
-16.2
-1.2
10.8
-2.2
0.8
o.a
2.8
6 .. 8
":'6.2
. 5.8
' 10.8
o.a
15.8
3.8
-11.2
-10.2
15.8
3.8
14.8
4.8
J
Light
\
Shade
treatment
INDicator
treatment
INDicator
'
-46-
4U
52
42
35
40
4fl
60
61
50
33
46
51
5o
65
51
63
50
63
I
\
33
38
45
50
48
50
49
35
50
62
49
52
52
54
58
I
YIELD
12.2
12.4
11.9
11.3
11.8
12.1
13.1
12.7
12.4
11.4
12.3
12.2
12.6
13.2
12.3
16.b
15.8
16.5
15.0
1.5 .4
1'5.6
15.8 ·~~
1i5.8 :
1'6. 0 '
15. ai
15.0
16.2
16.7
15.8
1'>.9
9.5
9.5
9.6
a.a
45
57
62
52
67
55
4J
41
67
<~.5
<).8
9.1
1=1. 3
9.5
8.5
8.6
10.4
9.4
10.2
9.3
55
66
56
Height - Height
(deviation of the
covariate from
its mean)
-
@ The
~ matrix plus Height and
Yield for part@ •
.......
_j
•
s•GUC:'ITIAL
P~~!~ET£R
1 2 • 26 = Yc
12 .26
1•
X3
12.26
1~o&E'
12.3 69
15.780€:
DEP VARIAELE:
.a f
=
.YL
9o4E-6E'7 =Ys
9.23709 .0583E8:0=canmon slope
oF
MEAN
DF
SQUARES
SQU~QE
1-lODEL
4
41
45
7383.377
0.683301
lf-45.844
0.016!'o66
su~
ROOT MSE
[lEP ME:A•!
c .v.
NOTE: NO
VARIABLE
Xl
X2
X3
DEV
VI\RIA8LE
X1
X2
X3
DEV
Vol.LUF.
F
TER~
¥9
D-SQUAPE
~OJ P-SQ
0.129C%
12 .52':<-':189
1.03039
0/{9
IS USED. R-SGUARE
IS
R~DEFINEC.
T FOR
nO:
STA~JoAr<o
i::STI~"-TE
ERR"R
PARAME.ER=O
1
12.368"'54
1
15o9BOE28
9o237085
1
1 slope=O. 0 58368
Co0335"'2
0.033650
0.034469
OoOC22315l3
3f8.213
474.906
267.9£4
26.1Sf.
OF
TYPE. II SS
1
1
1
1
2259.578
3758.754
119fo866
11.402032
NUMERnoP.:
JENOM~t~o.TCR:
TEST: L_Vs_s
)~'"
0.0('01
110155 oR12
P -'RAM""TER
TF.'ST: C_VS_TRT
PR 0'-
7384.~60
INTERCEPT
OF
~The first three partials are the adjusted treatment means (see P• 237).
YI(Lu
SOIJRCE
E:RROR
u TOTAL
I
YIELD= Treatment indicators covariate deviations
E"~Tll"ATfS
Xl
X2
DEV
•
GENERAL MEANS MODEL
:g)
NUM~RqOR:
ilUJCM•tJATCR:
PROE )
D~:
~
D~=':
'+1
c VALUE:
Ppcc )F :
315.f:04
.OH6f:'59
')F :
1
41
"' vaLu(:
rpop )I'"
~~:
I
OoOOOl
OoOOOl
GoOGOl
O.OCOl
0.5623!'8
.01£:6659
'
IT
TYF E.
ss
2254.614
3773.094
1::'44.2f-7
11.402032
33.7431
c.ooo1
8°37.1324
:
I
n.oool
Yc ( adj) = 12. 37
YL ( adj) = 15. 98
Ys (adj) = 9.24
TESTS of contrasts
These contrasts test differences between adjusted means.
The ESTIMATE option in GLM would provide the estimate
and standard error (see ]) ) .
-L7_
•
•
])
rL-~T
GF
SY~BDL
YlfL:·~~!G~T
IS VALUl :F
YT""LD
See plot, p.
17
236
+
I
I
I
II
CX.,Y,)
I
H
+
15
.
--L
L~
/x,YL,ad)
L
---.,. L~L!'-
L-----
Supplemental
Light
~L-q-c- '
'I
L
1
•
•
LI~~T
I
L
I
I
I
I
I
I
I
14
I
+
I
I
I
I
1~
+
-
I
12
1
~c
l_.c
c
____-c
-----
r
I
I
I
i ,~,-- ~
c~J:.--
(X, ,y,
•
I
I
I
11
il
"
II
<'
II
•
C • ad
J
)
-
r
I
I:
I
11
I
II
I
I
s--
:I I
10
1l
+
I
II
Control
I1I
J
I
It
---
__.-
c(
I'
I I
11
x, y,
lrl" " (' -- C
I
I
I"
IJ
s
shading
s
sis
I
I
9
+
I
I
I
I
I
I
I
8
I
+
I
I'I
II
I
II
!--·---··--·---·---·---·---·---·-~!~--·~--·---·1--·---·---·---·---·---·-:-:
3~
~:; 41 4::'- 4!: 47~4S'Xc!:lx5::'- 5!:Xs57 5" €-1 €<:
65
67
:q
rlE! Go-JT
'J 'J T :-::
r- :-- (
rl
I:·~!~
(Covariate)
·-~~-
•
•
•
snvr.--AN DATA
G~~EPAL
LJN~AR
CLESS
CLA
L~V~L
~OCELS
l~FCRM~TION
Lc-v;::Ls
~~
Liff<T
~ Treatments/common slope/separate slopes medel
~~OCE~URF
VALU::S
:!-
·: L S
hUMPER 0F 0PSERVATICNS
I~
J~TA
SFT :
4~
SOYBEAN DATA
GENERAL
DEPENDENT VARIAELE:
SOURCE
LIN~aR
~ODELS
P~OCEDURE
YT~LD
MF
SUr-' OF
SGU~RE:;
~~EAN
SGUARf
F VALUE.
4110.01
MOnEL
!5
::'19.6657E021
6::'.93::'1=1S04
ERROR
39
0.601:66423
0.01~5:;54?
CORRECTED TOTAL
44
320.27244'144
R-%lUARE
c.v.
STIJ Dt:V
YIELt' VEAN
o.93.q1o6
0.99"'5
0.1247216&
12 .521<8!'!'P'?
SOURCE
!"F
L TGHT
HEIGHT
2
1
HEIG~T•LIGHT
2
SOURCE
LISHT
Hr::IGHT
Hr::IGHT•LIGHT
r:>F
<.
1
;:
F VALUE
FR > F
308.18711111
11.40203184
0 .OHIS~726
9906.05
732.99
2.46
c.ooo1
c.c9e:
ss
F VALUE'
FP
>
c•
0 01
(·.
C::P:'-
TYP"' IV
10.53C<.771
11.47CE494
O.OHE:::'72
--?-
> F
0.0001
ss
TYP'" I
P~
338.47
7 3 7.41
2o4f.
G.CCCl
F
:J. 0(11
this line tests H0 : t~1 "' t~2 , t~ 3 ( =tl)
vs. Ha : different slopes needed.
•
•
Sl.iYdEAN i.lATA
GE~ERAL
LINEAR MODELS
PRULEuJ~E
L
•
Treatments/cor!'lnon slope model
OEPENuENT VARIABLE: YIELD
JF
SUM OF Sl.it.JARES
MEAN 5-iuA"-E:
MOllEl
3
319.58914296
lJtJ.)2'oill .. 32
ERROR
41
0.68330149
0.016;)6:)3;;
CORRECTED TOTAL
44
320.27244444
R-SQUAk£
c.v.
STO IJEY
YIELiJ "'EAN
0.997866
1.0304
0.12909644
12.52b8odo~
Of
TYPE I SS
2
1
308.18711111
11.4020318ft.
9246.C.4
684.15
o.ooo1
O.J001
OF-
TYPE IV SS
F VALUE
?K
2
1
311.810961rd9
lloit-0203184
9534.71
684.15
O.OJ01
0.0001
SOURCE
SOURCE
LluHT
HEIGHT
= R(Lj!-L)
= R(l3
L,c:)
SOURCE
LIGHT
HEIGHT
= R(LIS,!l)
PARAMETER
CONTROL liS TMT (1)
LIGHT VS SHADE (2)
COMMON SLOPE
(3)
f
VALUE
o?':l2.0o
I"K
> r
0.0001
F
VALUE
l-'r\
>
>
f
R(~l!!)
a common slope
before the treatments.
F
1 fOR HO:
PARAMETER=O
PR > IT I
STO f:I\KOk Uf
ESTIMATE
-o. 23990239
6.74354249
o. 05836!U9
-5.81
137.b1
26.16
0.0001
u.OOJ1
0.0001
J.04129927
o.u .. 9J0394
0.00223151
E5TIMATE
MEANS = unadjusted treatment means
LIGHT
c
s
L
N
YIELD
;;::I.:;tiT
15
15
15
12.2oOOuOJ
15. 86000·)1)
9.46o6667
49.3333331
4J.lJ.B3B
5'>.1333J;;
= R(L,Sju) -R(LjS,!J.)
= 319. 58914 - 317. 81096
= 1.77818 = SS due to fitting
(1) and (2) are the
treatment means
in the TESTs of
(3) is the estimate
covariate.
contrasts among adjusted
fsame as the contrasts used
part ,9 ) .
of the common slope of the
Note that the F-value output for (2) in PROC REG
is not correct.
LEAST SQUARES MEANS= adjusted treatment means and their standard errors.
LIGHT
c
L
s
LSMEAN
STu ERR
LS11EAN
PROB > ITI
HO:LSMEAN=·)
12,;3o89540
15. 9d0627b
9.2370851
o.o33591o
O.OH6501
0.0344688
0.0001
0.0001
0.0001
YIELD
Compare the MEANS and LSMEANS with the SEQB output of PFOC REG in ;f) .
-50-
•
•
•
POTATO SCA::> DA:A - Comparison of regression lines in a 2 X 3 factorial
- - - - - - - experiment (two qualitative levels X three quantitative levels). P. 97, Cochran and Cox, 1957.
DATA SCAB;
INPUT YIELD TMT S LEVEL XO XOl X02 Xl Xll Xl2 X2 X2l X22;
CARDS;
};
PROC PRINT N;
b
PROC RFG;
c'
PR~C
'-C./
~ODEL
@
YIELD = XO XOl X02 Xl Xl1 X12 X2 X21 X22 I
NOINT P SEQB SS1 CLM;
and
@ correspond to fitting a sequence of
regression models
REG;
~ODEL
YIELD = X01 X02 X1 X2 I NOINT P SEQB SSl CLM;
OUTPUT OUT=NEW P=YHAT R=RES U95M=UPPER L95M=LOWER;
~
PRrC PLOT DATA=NEW;
PLOT VIELD*LEVEL=~T;
PLOT RES*VHAT I VREF=O;
PLOT VHAT*LEVEL='P' UPPER*LEVEL='U' LJWER*LEVEL='l' I OVERLAY;
A plot of the raw data as well as a residual plot
and plot of predicted values for the
model in part :E) .
"
PROC UNIVARIATE NORMAL PLOT DATA=NEW; VAR RES;
More analysis of residuals from the model in part ]:, .
l
PRJC
~
~
GL~ OATA=SCAB;
CLASS TMT LEVEL;
MODEL YIELD = TMT*LEVEL I NOINT P;
FSTI~ATE 1 T~T'
T~T*LEVEL 1 1 1 -1 -1 -1
ESTIMATE 1 8 LIN'
TMT*LEVEL -4 -1 5 -4 -1 5
ESTIMATE 'T*B LIN' T~T*LEVEL -4 -1 5 4 1 -5
[STIMATE 'B QUAD'
TMT*LEVEL 2 -3 1 2 -3 1
ESTIMATE 1 T*B QUAD' TMT*LEVEL 2 -3 l -2 3 -1
OIVISOR=3;
DIVISOR=S•;
I DIVISOR=42;
I DIVISOR=l08;
I OIVISOR=54;
I
I
Recall that b2 01 = ~tiy. where the J,. 's may be computed from, say, the ORTHO
.
~
2 ~
-3
1
algorithm. In this example t 1 =54'' t 2 =5Ji: and t 3 =54. I f the levels of
the quantitative factor had been equally spaced, then the J,i's could have
been obtained from a table of orthogonal polynomial coefficients.
-51-·
Fitting the cell means model and examining single
degree-of-freedom contrasts which correspond to linear, quadratic, treatment and
the respective interaction terms. The
results are identical to those of part ~.
•
J~S
2
3
4
~
6
7
2
9
10
11
12
1'3
YJHO
TMT
LEVEL
')
F
F
F
F
3
9
16
4
30
7
21
9
16
to
22
18
18
18
24
12
19
10
4
4
5
17
7
23
16
2lt
17
l.r.
15
16
l7
18
19
20
21
:})
3
3
3
s
3
s
c;
s
3
3
F
3
6
6
F
F
6
6
f
s
s
s
6
6
6
s
6
12
12
12
12
12
12
12
12
F
F
F
F
s
s
s
s
•
The data and indicator variables
xo
L
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
X01
X02
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
0
0
0
0
1
1
1
1
X1
Xll
X12
X2
X21
X22
3
3
3
3
3
3
3
3
3
0
0
0
0
3
3
3
3
0
0
0
0
9
9
9
9
9
9
9
9
9
9
9
9
0
0
0
0
0
0
0
0
9
36
36
36
36
36
36
36
36
144
1'.4
144
144
144
144
144
144
36
36
36
36
3
3
3
0
0
0
0
6
6
6
6
6
6
6
0
0
6
6
6
6
6
12
12
12
12
12
12
12
12
0
0
. 12
12
12
12
0
0
0
0
6
6
6
6
0
0
0
0
12
12
12
12
~=24
-52-
.-l
•
0
0
0
0
144
144
144
144
0
0
0
0
q
9
9
0
0
0
0
36
36
36
36
0
0
0
0
144
144
llt4
144
•
~
SEf)lJENTl AL PARAMETER ESTIMATES
13."''33:"
16.4167
16.4167
19.64'58
18.7'5
18.7'5
'>.77083
12.9167
12.9167
X'.l
XOl
X02
X1
Xll
X12
X2
X21
X22
OEP
VARIABL~:
= y
XOjXOl X02\X1\Xll Xl2\X2\X21 X22
SUM OF
SQUARES
MODEL
ERROR
U TOTAL
6
18
24
ROOT MSE
DEP MEA~l
common mean\separate means\common linear\separate linear\common quadratic\separate quadratic
- -
"'EA~
SQUARE
F VALUE
PROB>F
4721.000
633.000
5354.000
786.833
35.166667
22.374
0.0001
5.930149
13.333333
44.47612
!;~Q~'!~@
g_:::t
I~TERCEPT
Standard errors and hypothesis tests are most
easily determined from part ~ .
TERM IS USED. R-SQUARE IS REDEFINED.
NOTE: MODEL IS NOT FULL RANK. LEAST SQUARES SOLUTIONS FOR THE
PARA~ETEPS ARE NOT UNIQUE. SOME STATISTICS WILL BE
MISLEADI~G. A REPORTED OF OF 0 8R B MEANS THAT THE
ESTI~ATf IS BIASED. THE FOLLOWI~G PARAMETERS HAVE BEEN
SET TO ~. SINCE THE VARIABLES ARE A LINEAR 'OMBINATION
OF OTHF~ VARIABLES AS SHOWN.
X02
Xl2
X22
VARIABLE
xo
X01
X02
Xl
Xll
Xl2
'X?
X21
=+XO
=+Xl
=+X2
-l*X01
-l*Xll
-l:OCX21
~not of use.
PARAMETER
ESTIMATE
STANDARD
ERROR
T FOR HO:
PARAMETER=O
9. 932877
14.04 7209
q
12.916667
-16.666667
0
1.666667
8
"~.958333
3. 202646
4. 5292?6
')
0
-0.129630
-0.273148
0.205450
0.290550
OF
q
B
0
g
I'
•
YIELD
·1F
NOTE: NO
which is:
•
-6.16667 = YF- Ys
-6.16667 1.4E-14 = 0
-6.16667 1.7E-14 -0.46131 = bl.O (common linear)
-4.375 1.7E-14 -.333333 -. 255952 = bFl.O- bsl. o
-4.375 1.7E-14 -. 333333 -.255952 1.1E-13 = 0
-4.3 75 1.8E-14 3'.77381 -.255952
1.6E-13 -.266204 = b2.0l (common quadratic)
-16.6667 3.3E-14 1.66667 3.95833 -2.2E-13 -0.12963 -.2131 48 = ~2.o1 -bs2.o1
-16.6667 3.3E-14 1.66667 3.95833 -2.2E-13 -0.12963 -.273148 1.2E-l2 = 0
SOURCE
c.v.
Fitting the model sequence
.
.
>
ITI
TYPE I SS
1.3()0
-1.186
0.2099
0.2509
0.520
0.874
0.6091
0.3937
-0.940
0.5360
0.3596
4266.667
228.167
0
11.502976
5.502976
0
118.080
31.080357
.
.
-0.631
PROB
.
.
-53-
•
•
]:
OBS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ACTUAL
•.• ,
9.000
16.000
4.000
?0.000
7.0(10
21.000
9.001)
16.000
10.000
19.000
18.000
18.000
24.000
12.000
19.000
10.000
4.000
4.000
5.ooo
17.000
7.000
1o.IJOO
17.000
Results of the P and CIM option
PREDICT
VALUE
STO ERR LOWER951 UPPER951
MEAN RESIDUAL
PREDICT
ltEAN
(Cell Means)
•.•oi1
9.500
9.500
9.500
16.1501
16.750
16.750
16.750
15.50
15.500
15.500
15.500
B.
18.250
18.250
18.250
5. 750
5.750
5. 750
5.750
14.
,.~
14.250
14.250
14.250
SUM Of RESIDUALS
SUM Of SQUARED RESIDUALS
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
2.965
3.271
3.271
3.211
3.271
10.521
10.521
10.521
10.521
9.271
9.271
9.271
9.271
12.021
12.021
12.021
12.021
-.479346
-.479346
-.479346
-.479346
8.021
8.021
8.021
8.021
15.729
15.729
15.729
15.729
22.979
22.979
22.979
22.979
21.729
21.729
21.729
21.729
24.479
24.479
24.479
24.479
11.979
11.979
11.979
11.979
20.479
20.479
20.479
20.479
-.500000
-.500000
6.500
-5.500
13.250
-9.750
4.250
-7.750
0.500000
-5.500
2.500
2.500
-.250000
5.750
-6.250
0.750000
4.250
-1.750
-1.750
-. 750000
2.750
-7.250
1.750
2.750
2.34479E-13
633
-~-
•
:e
&
SEO!~NT!AL
Fitting the model sequence
which is:
PARAMETER ESTIMATES
•
•
XOl X02\Xl\X2
separate :neansicommon linear!common quadratic
10.25 = YF
1:!.25 16.4167 = Ys
13.4 792
19.6458 -0.46131 = b1.o
1.5 7.66667 3.64583 -.266204 = b 2 . 01
XOl
xo::
x1
X2
OEP H•IABLE: YIELD
SOUl::::
MOO'",_
4
ERR:c<
20
24
U r,.AL
;IJCT "1SE
:JEP "1EAN
:.v.
NOT~:
~J
VARl•BL!'
DF
xoz
1
1
Xl
X2
1
1
oos
ACTUAL
1
9.00:>
9.000
16.000
4.000
30.00')
7.000
21.000
9.000
16.000
10.00:>
18.00')
18.000
U!. 000
24.00J
12.0 00
3
4
5
6
1
B
9
to
11
12
13
14
15
MEAN
SQUARE
4684.417
669.583
5354.000
5.786118
13.333333
43.39589
I~TERCEPT
XOl
z
SUM OF
SQUARES
JF
F VALUE
PROB>F
1171.104
33.479167
34.980
0.0001
~~Q~!:~
c.:~::
TERM IS USED. R-SQUARE IS REDEFINED.
PARANIETER
ESTIMATE
STANDARD
ERROR
T FOR· HO:
PARAMETER=O
PROS > ITI
1.500000
7.666667
3.645833
-0.266204
6.954049
6.954049
2.209610
0.141747
0.216
1.102
1.650
-1.878
0.6314
0.2833
0.1146
0.0750
PREDICT STO ERR LOWER95t
MEAN
VALUE PREDICT
,=res":ric"';ed cell means)
5.\14
10.042
2.362
5.114
10.042
2.362
5.114
10.042
2.362
2.362
5.114
10.042
11. 281
16.208
2.362
2.362
11.281
16.208
16.208
2.362
11.281
16.208
11.281
2.362
13.792
2.362
8.864
13.792
2.362
8.864
8.864
13.792
2.362
13.792
2.362
8.864
19.958
2.362
15.031
15.031
19.958
2.362
19.958
2.362
15.031
TYPE I 55)
1260.750
3234.083
71.502976
118.080
not useful
MEAN RESIDUAL
OBS
ACTUAL
PREDICT
VALUE
-1.042
-1.042
5.958
-6.042
13.792
-9.208
4.792
-7.208
2.208
-3.792
4.208
4.208
-1.958
4.042
-7.958
16
17
18
19
20
21
22
23
19.000
10.000
4.001)
4.000
5.000
17.000
7.000
16.00:>
17.001
19.958
6.917
6.917
6.917
6.917
13.083
13.083
1?.083
13.083
UPPER95~
14.969
14.969
14.969
14.969
21.136
21.136
21.136
21.136
18.719
18.719
18.719
18.719
24.886
24.886
24.886
24
SUM OF RFSIDUALS
SUM OF SQUARED RESIDUALS
-55-
STO ERR LOWER951 UPPER951
PREDICT
MEAN
HEAN RESIDUAL
2. 362
2.362
2.362
2.362
2.?62
2.362
2.362
2.362
2.362
ts. o:n
1.989
1.989
1.989
1.989
8.156
8.156
8.156
8.156
1.34115E-13
669.5833
24.886 -.958333
11.844
3.083
ll.844
-2.917
11.844
-2.917
11.844
-1.917
18.011
3.917
18.011
-6.083
18.011
2.917
18.011
3.917
•
~·
GENERAL
DEPENOE~T
V~~fA~LE:
~OOELS
General Means Model
•
GENERAL LINEAR MODELS PROCEDURE
PROCEDURE
CLASS LEVEL INFORMATION
YIELD
JF
SOURCE
LINEA~
:.,V
SUM OF
SQUA~ES
MEAN SQUARE
F VALUe
!o!ODEL
6
4 721.00000000
786.83333333
2 2. 37
E~RDR
18
633.00000000
35.16666667
PR > F
UNCORRECTED rnTAL
24
5354.00000000
R-SQUARE
c.v.
STD OEV
YIELD MEAN
0.88l77l
44.4761
5.93014896
13.33333333
OF
TYPE I SS
F VALUE
6
4721.00000000
22.37
0.0001
OF
TYPE IV SS
VALUE
PR
6
4721.00000000
22.37
0.0001
0.0001
CLASS
LEVELS
VALUES
PH
2
F S
LEVEL
3
3 6 12
NUMBER OF OBSERVATIONS IN DATA SET
=
Note that the parameter estimates are the same
as those given in part
under the SEQE
output. Here we also have the standard
errors and t-tests; however, we had to calculate the ~. 's for each cohtrast.
JD
SOURCE
T~T*LEVEL
SOURCE
T~T*
LEVEL
PARAMETER
HIT
B LIN
T*B LIN
B QUAD
T*B QUIW
ESTIMATE
T FOR HO:
PARAMETER=O
-6.16666667
-0.46130952
-0.25595238
-0.26620370
-0.27314815
-2.55
-1.43
-0.40
-1.83
-0.94
F
PR
PR
>
F
~
> F
> ITI
STO ERROR OF
ESTIMATE
0.0202
0.1710
0.6971
0.0835
0.3596
2.42097317
0.32351615
0.647')3230
0.14527499
0.29054999
( Ce 11 means)
LEVEL
08SERVATIC1N
l
2
3
4
5
6
1
8
9
10
l.l
~2
OBSERVED
VALUE
9.00000000
9.00000000
16.00000000
4.00000000
30.00000000
7.00000000
21.')0000000
9.00000000
16.00000000
10.00000000
18.00000000
18.00000000
PREDICTED
VALUE ( = cell means)
9.50000000
{ 9.5000.JOOO
9.500000')0
9.50000000
16.75000000
{ 16.75000000
16.75000000
16.75000000
15.50000000
{ 15.50000000
15.50000000
15.50000000
RESIDUAL
-0.50000000
-0.50000000
6.50000000
-5.50000000
13.25000000
-9.75000000
4.25000000
-7.75000000
0.50000000
-5.50000000
2.5')000000
2.50000000
-56-
....-;._:·
24
'IM'r
3
6
12
F
9.50
l5.50
5.75
s
16.75
18.25
14.25
The standard error of each cell mean is
.; --·<5.1667
,
=2.965.
The cell means and
standard errors could have been printed
by using the option:
LSMEANS TMT#LEVEL/STDERR;
:e
•
®
continued
GENERAL LINEAR MODELS PROCEDURE
DEPENDENT VARIABLE: YIELD
OBSERVATION
13
14
15
16
17
18
19
20
21
22
23
24
OBSERVED
VALUE
PREDICTED
VALUE
RESIDUAL
18.00000000
24.00000000
12.00000000
19.00000000
10.00000000
4.00000000
4.00000000
5.00000000
17.00000000
7.00000000
16.00000000
17.00000000
{18. 25 000000
18.25000000
18.25000000
18.25000000
r-75000000
5.75000000
5.75000000
5.7'5000000
-0.25000000
5.75000000
-6.25000000
0.75000000
4.25000000
-1.75000000
-1.75000000
-0.75000000
2.75000000
-7.25000000
1.75000000
2.75000000
~4-25000000
4.25000000
fto25000000
_4.25000000
SUM OF RESIDUALS
SUM OF SQUAllED RESIDUALS
SIH1 OF SQUARED RES I DUALS - ERROR SS
FIRST ORDER AUTOCORRELATION
DURBIN-WATSON D
Note:
----
o.oooooooo
633.00000000
0.00000000
-0.63467615
3.25701027
In order to get the classical ANOVA table as well as the single
degree-of-freedom contrasts and means with standard errors we
could have used the statements:
PROC GIM; CLASS 'lMT LEVEL;
MODEL YIELD= 'lMT LEVEL 'lMT*LEVEL/P CIM;
[ same ESTIMATE statements]
LSMEANS 'lMT LEVEL 'lMT4tLEVEL/STDERR;
Note:
To obtain the same results as in @we woulC' fit the morel with
interaction restricted to be zero
That is,
PROC GIM) CLASS TMl' LEVEL:
IDDEL YIELD '" TMT LEVEL /P CIM;
-57-
•
:e
•
ALCOHOL-DRUG
uATA WHULC;
!~PUT Yl Y2 Y3i
S·JdJECT = _N_i
ALC.LiHOL = •vES';
Analysis of a
IF-~-> b THE~ ALCOHOL='NU'i
YS
!Yl+YZ+Y31/SI.iKTI31;
XG = 1;
C.At<.JS i
=
~KUC
SOkT; 8Y ALCOHOL;
Pri.i.JC. P~INT N;
®
t>ii.uC GLM; CLASS ALCOHOL;
MODEL YS = XO ALCOHOL I NOINT;
LS~EANS ALCOHOL I
STOERR;
ESTIMATE 'DIFFERENCE' ALCUHOL l -l;
©
DATA SPLif; SET WHOLE;
Y=Yl; ORUG• 1 A1 ; OUTPUT;
i=Y2; DRUG= 1 8 1 i OUTPUT;
Y=Y3i DRUG= 1 C1 i OUTPUT;
OKOP Vl-Y3 YS;
QD
P~u(. PKl~T Ni
i.IY
PKOC
®
Pi-f.(.
Y3
= Control
response
B response
A
res~onse
Yl+Y2+Y3
13
ALCOHOL;
PRGC SURTi BY AlCOHOL SUBJECT;
®
= Drug
= Drug
=
p. 280.
Spli~-Unit ~xperiment
Yl
Y2
YS
h
DA~,
Rearranging the data to enable analysis
of the subplot factor.
PROC SORT must be used on the CLASS variables
used in the ABSORB statement below. ABSORBing
the whole plot factors reduces the storage
requirements and hence the time and cost of
the analysis.
GLM;
~oSORB ~LCOHOL SUBJECT;
CLASS JKUG ALCOHOL;
I'IOuEL Y = DRUG ALCUHOL*DRUG; Effects model for the subplot factor and main effects contrasts.
lSTIMATE 'MAIN EfFECT: AB VS ~· JRUG -1 -1 2 I DIVISOR=2;
FSTI"''ATE 'MAli~ EfFEC.T: A VS 13 1 uRU" l -1 J;
l;L
·~;
A~SURu
ALCUHCL SUBJECT;
-;G-
•
•
•
CLASSES ALCuHOl DRUG;
MODEL Y = ALCOHOL*DRUG I NOINT SSl SS2;
E~TIMATE 'AB VS CONTRuL @ ~0 1
ALCOHOL*DRUG -l -1 2 0 0 0 I DIVISOK=L E;
~STIMATE 'A VS B ~ NU ALCUHuL 1
ALCOrlOL*DRUG l -1 J 0 0 O;
t~TlMATc 1 AB VS CONTKOL ~ VES'
ALCOHOL*DRUG 0 0 0 -l -1 2 I DIVISOk=2;
~STI~AIE 'A VS B @ YES ALCOHOL'
ALCGHOL*DRUG 0 0 0 1 -1 O;
®
General
®
~eans
model and simple effects contrasts.
PkOC GLM; CLASSES SUBJECT ALCOHOL DRUG;
Y
= XO
ALCOHOL SvBJECTlALCOHOLI
ALCOHOl*DRUG I SSl SS2 NOINT;
TEST H=ALCUHOL E=SUBJECT(ALCOHOLJ I HTYPE=l ETYPt=l;
CuNTRAST 'ALCOHOL OIFFtkENCl' ALCOHOL 1 -1 I
E=SUBJECTIALCOHOLJ ETYPE=l;
eSTIMATE 1 Ad VS CONTROL ~ NO' URUG -1 -1 l
ALCOHOL*DkUG -1 -l 2 0 0 0 I DIVISOR=2 E;
ESTIMATE 'A VS B i NO ALCOHUL 1 JRUG 1 -1 0
ALCOHOL*DRUG 1 -1 0 0 0 O;
ESTIMATE 1 AB VS COhTRUL ~ YES' JRUG -1 -1 2
ALCOHOL*DRUG 0 0 0 -1 -1 2 I UIVISGR=Z;
ESTIMATE 1 A VS 6 ~ YES ALCOHOL' DRUG 1 -1 0
ALCOHOL*DRUG 0 0 0 1 -1 O;
GJTP~T OUT=NEW2 P=P R=R;
~u)EL
This analysis perforos both the whole-plot and sub-plot analyses
all at one time. The simple effects contrasts are more difficult to speci~, and the computing costs are much steeper.
DRU~
JD
•
~~OC
PLGf; PLuf K*P='*' I V~EF=O;
Analysis of residuals
PROC ANOVA may 'te '.lsed since this experiment is balanced. The
PROC 4NOVA; CLASSES SUBJECT ALCOHOl DRUG;
EST1MATE option is not available, but the cell means and SS
MODEL Y = ALCOHOL SU8JECT(ALCOHOL) DRUG ALCOHOL*DIWG;
for the ANOVA table are computed and F-tests made.
TEST HzALCOHOL E=S~BJECT(ALCOHOL);
MEANS ALCOHOL SUBJECT(ALCOHOL) DRUG ALCOHOL•DRUG I DEPONLY;
-S"J--
:.
•
•
---------------------------------- ALCOrlOL=NO ----------------------------------
oes
Y1
Y2
Y3
2.5~
2.63
2.7"3
3.3d
2.ld
2.12
2.53
~
2.d3
2.93
3.58
4
L.':fti
5
2.32
2. 73
.,
0
2.42
.3.99
3. u7
2.15
3.23
:.i.JBJECT
YS
7
4.o24!HI
4.o6499
6. 32199
5.09800
3. 8041<t
4.90170
8
9
10
ll
12
xu
l
l
1
1
1
1
N=6
--------------------------------- ALCOHUL=YES ---------------------------------CJ:3S
7
&
9
10
11
12
Yl
Y2
Y3
SUAJECT
YS
3. 5o
3. 79
4.J4
J.dS
5.32
4.38
3 .o 3
3.o3
3.26
3.49
3.79
1
2
3
3.03
3.05
4
5
6
6.270J2
6.44323
7.62102
5.93516
5.76773
5. NOU2
4.09
3.1C
3. 33
3.35
z.so
xo
1
l
l
l
. l
1
N=6
-60-
®
See p. 283 of Allen and Cady for a
discussion of the assumed model.
;.
•
LINEAR MODELS PROCEDURE
~ENERAL
CLASS LEVEL lNFJKMATlON
LlVELS
C. LASS
ALCOHOL
~
•
.c.nalysis of s•.1ms to test for .,:hole--plot I alcohol~ ::.::.:=-:=-erences.
VALUES
NO YE:S
2
NUMBtR uF OBSERVATIONS IN DATA SET
=
12
DEPENDENT VARIABLE: YS
SOURCE
')f
SUM QF SQUARES
MEAN :)IJUAkE
MODEL
2
382.70960556
191.35480278
328.0J
ERROl<.
LO
0.58339611
PK > F
UNCORRE~TEJ
TOTAL
~4=ss
12
due to SUBJECT(P~COHOL).
3od.54356667
1-
:p)
OBS
0.0001
ALCOHOL
xo
7
NU
1
NO
Nu
1
3
7
7
1
4
8
1
z.·n
9
1
l
2.42
2.13
3.513
3.99
3.38
2.98
3. J I
2.7tl
YS MEAN
1.3.6304
0.76380371
5. 603C>o 54'>
5
9
PR > F
1
8
9
NO
NLl
NO
NO
NO
·)
9
~0
1
1)
10
l~u
l
11
1C
12
13
10
.11
NO
NO
r~o
14
11
~0
15
L1
lo
l7
12
NO
NG
TYPE I SS
OF
xo
1
1
ALCOtiG.L
SOUKCE
.)f-
xo
ALCOHOL
F VALUE
376.81280278
5.89680278
645.90
O.OJOl
10.11
0.009ti
TYPE IV SS
F VALUt:
>
f
O.JOOOOOOO
0
5.89bci0278
E ::> T I o-IA TE
T FuR HO:
PARAMEHR=J
-1.40199890
-3.18
PARAI-IETE~
i>K
10.11
PR
O.UO'id
STJ t:t\«.uR lJF
b T !MATE
0.0098
J.'t<t0'>1ts22!i
LEAST SQUARES MEANS
ALCOrlCL
NO
YES
4.
YS
LSME:AN
STO E RK
LSMEAN
PROB > JT I
HJ:LSMEAN=O
~0266604
J. 3ll82l!l6
0.31182156
0.0001
0.0001
b. 30't66494
13
> lT I
1'1
20
a
12
12
1
1
~-=
24
25
1
2
2
2
3
26
3
21
2d
3
4
29
'+
::lJ
H
4
32
5
21
> '
"-~
u
~
5
NO
NO
YES
YES
YES
YES
Yi:S
YES
Y[S
YES
YES
YES
YES
YES
YES
YES
YES
YtS
1
1
'
.L
l
1
1
1
1
1
l
1
2.:33
2.55
2.o 3
~.32
l
2.15
2.12
2.73
3.23
2.53
3.56
4.04
3.26
3.79
3.88
3.4<i
4.09
5.32
3. 79
3.10
4.38
2.80
3.33
3.o3
1
3.J3
1
1
1
1
l
1 .
l
1
1
1
l
1
DRUG
A
B
c
A
B
c
A
8
c
A
B
c
A
B
c
A
b
c
A
8
c
A
~
c
A
B
c
A
B
c
A
B
(.
A
()
Yi:S
l
l
3.35
35
3.63
i::l
jt,
::,
'l't.)
1
3.:;::;
34
"'
y
1
z
0
01 FF t:RENCE
SUBJECl
STU i.JEV
SOURC.E
®.
Com-pare SS found on this -page with those in. say.. analysis
vALUE
c.v.
R-SQUA>..E
0.984'1:!5
~
t-
"
...r
•
•
GENERAL LINEAR MODELS PRuLEOliRE
CLASS LEVtL 1NfuKMATION
CLAS:>
NU~dER
VALUES
ORJG
3
A B C
HCOHGL
2
NO YES
OF GBSERVATIUNS IN DATA SET
~ENERAL
DEPENDt~~
LEVELS
= 36
LINEAR MODELS PROCEDURE
VAR!AdLE: Y
SUM
SQUARES
SOURCE
Jf
MODEL
15
14.47667500
0.96511167
ERROR
20
1.41262222
J.J70o3lL1
CORRE:CT:OJ TwTAL
35
15.88929722
R-SQlJA?::
c.v.
STO OEV
Y 1'1E:AN
o. 911-J·l•,
8.2146
0.26576514
3.2352T77d
JF
SOURCE
SUBJECTI~LCLHCLJ
DKUG
DRUG*AL C <jr1i.JL
SOUHLt.
DRUG
DRUG>I<L\L ', CrlOL
UF
fYt>E
I SS
2
2
5.s9oaoz7o
5.ti33961ll
1.87722222
0.868688!l9
OF
TYPE i.V SS
2
2
l.d17 Z2222
o.S6do8il89
1
ALCOHOL
10
MEA1~
l[
t<
11Alt'i t:.HEC.T: !\o V:) C
HA IN E: Ff £ C T; A VS B
f
VALUE:
f
VALUt
l3.oo
PR
>
f
PR
> F
~
F
13.2':1
J.JC02
o-15
J.JJSJ
VALUE
,>K
13.29
6.15
o.oao2
ESTIMATE
PARA liE TER=O
-).40416667
-4.30
-2.64
-o. 30833333
5-.IUAI\E
0.0001
T hJK HO:
PARA:~E
•
> F
Note that ALCOHOL and SUEJ~CTfAtCOHOL) are not
included in the Type IV SS.
J.OO.H
P~<.
>Ill
STu EI<KOii 01'
t:~ f l MATE
J.JJJ~
0.0'1Bo2ll
0.0101
0.108~9817
-62-
These contrasts ar~ Qf l~ttle interest since the
DRUG*ALCOHOL interaction is clearly important.
,.
~
OEPENDE~l
GENERAL LINEAR MOUELS
•
PROCE~URE
General :r.ea11s model with whcle-plot factor ABSO?.:::ed.
V4RIABLt: Y
SOURCE
(JF
SUI-I OF SQUARES
MODEL
15
14.47667500
0.96511167
13.66
ERROR.
20
1.41.262222
0.07063111
PK > F
CORRECTEC TJTAL
35
15.88929722
R-S~uAki:
c.v.
sro oEv
0.91.1096
d.2l46
o.2o5765l't
SOURCE:
JF-
ALCO rlDL.
SUBJECT(ALCC.HGL)
AlCOHOL*DI<uu
l
10
SOURCE
DF
AlCOHOl*JRuG
PARAMETER
AB VS CUNTKUL ~ ~~
~ NO ALCOHOL
AB VS ~uNTkUL ~ YeS
A VS d ~ YES ALCOHOL
A VS B
•
4
'+
:'iEAN
Y
VALul
MEAt~
3.23527778
F VALJE
5 .!!96602 76
5.83396111
2. 74591111
83.49
13.26
Pk.
>
F
0. J JO l
~.72
0.0001
0.0002
II SS
F VALUI:
PK > F
2. 745'llll.l
9.72
0.0002
TYPE:
F
0.0001.
1 SS
TYPE
S~uArd:::
T FOR HO:
PR > ITJ
STU ERROR OF
EST I MATE
PARAMHER=O
ESTIMATE
·-------- ----------·- ------------------
-().20333333
-0.00666667
-0.60500000
-0.61000000
---------
-I..SJ
-0.04
-4.5::>
-3.98
0.1416
0.9o5o
J.JI)OL
0.0007
-6:3-
J. U2od25/
o.l53<+395b
J.l3288257
o. l531t-39!18
This is a set of simple ef:'ects contrasts
(see Table 22.3, p. 2Cl - ~llen and Cady).
•
Dt:t-'ENU.CNT
·~
Comcined whole-plot and split-plot analysis with
\itNERAL Ll~EAR MODELS PROCEDURE
vA·< 1 •<tL:O:
si~pl~ects
~
SOU'<CE
:JF
Su."\ OF SI./UAr\ES
MOuEL
lo
3'il.28'J47U8
24.4555'/236
ERROR
20
lo4l2o22l2
J.J7Qo3lll
3b
392.70210000
R-SQUM~E
c.v.
STU JE:V
Y Mt:Af'<
0.946-'>03
il.21H
0.2657o514
3.2352711b
TOTlL
UNCOR~ECT~J
SOUKCi:
OF
xu
TYPE I
ss
ri,£.\N
Si.OJAF<.t
F
VALUe
>
Pk
~0.0001
ALCOHCL~Ot'.JG
SOURCE
JF
TYPE II SS
F VALUE:
PR
xo
0
1
10
2
2
0.00000000.
5.89680278
5. 83396111
1.87722222
o.8o8o8d89
DRUG
ALCOHOL*OR.J.>
Of
HYPOfHE:~~S
TYPt l SS
JF
ALCOHOL
USINC THE TYPE 1
CONTRAST
ALCuHGL
JIFfE~ENCE
PARAMETER
AS
(..'Ji~T.J
,,5
A 1/)
AB VS
A Vi
..
13 a• "l'J
t
CuNr~UL
~
~
Y£~
Ql
Nu
.\ICJdJl.
JJ
YES
~LCOHGL
~S
~:;
1
~.89680278
f-
o.ovo2
0.0083
>
F
~
O.OJJl
0.0002
0.JOd3
F VALUE
PK )
10.11.
f
f
A~
AN
VALLlt
PR
>
lO.ll
0 .o 09(i
T FOK HO:
Pk.
TE~M
Compare with the analysis in part 0•
""'
J.009o
FGA 5USJECTIALCJHOLl
JF
>
.
8J.49
d.2o
u. 29
6.15
'>.89680278
HYP~lHE~ES
Pr\
USING THE TYPE l MS FOR SUBJECT(ALCOHULI AS AN tRr\WK
SOU!< C.t
TESTS GF
.; ... b.L't
~
5334.94
83.4'7
8.26
13.2'1
o.15
ALCOHOL
SUBJECT(ALCUHULl
VALJc
f
376.d1280278
5.896d0278
5.83346111
l • b 77 22 2 2l.
O.d6868d89
l
f
J.OOOl
l
10
2
2
ALCDHCL
SUBJEC J( ALCC..Hl.'ll
ORU&
TE~T~
•
·:cntrs.sts.
> ITJ
E~KuK
TE~M
t
STD EKii.l..lK Uf
E:STIMATE
PARAME TER=O
-0.2033333.3
-1.~3
J.l~l6
-O.JOo66:.C:. 7
vol.32otl2~/
-0.04
o.~o5d
-0.60500000
-0.61000000
J.l:>!>'t395b
-4.55
J.0002
-3.98
O.JJ07
0. U2ocl257
J. 1 '>343'158
tSTIMATE
Gimple effects as :in
®.
•
k
0.4
SYMBOL uSED IS
PLOT OF R*P
I
I
•
*
*
+
@
NO
YES
0.2 +
+
*
*
*
*
*
*
y
7
8
NO
NO
NO
NO
NO
NO
YES
YES
3
2.67000000
2.69333333
3.65000000
2.94333333
2.19666667
2.8300000()
3.62000000
3.72Jil00J;)
4.40:JOOOOO
3.42666657
3.33000000
3.34333333
6
-o.z
A
~
+
*
I
I
I
I
*
*
*
c
*
* *
*
*
*
-0.3 +
3
3
3
3
N
y
12
12
12
3.21583333
3.52416667
2. 96583333
ALCOHOL
DRUG
N
'(
NO
NO
NO
YES
YES
A
6
6
z. !l950000()
2.90166667
2. 6950000()
3.53666667
4.14666667
3.23666667
res
*
>l<
3
3
YES
YES
l'ES
*
*
3
3
3
3
3
res
3
4
5
*
-0.1 +
*
2.83055556
3.64000000
N
DRUG
I
I
I
18
18
ALCOH:>L
10
11
12
1
2
0. 0 +- -·- --------------:- --:---------------------------------------------------
l
y
SUBJECT
9
*
*
*
*
*
*
N
ALCOHOL
*
*
~ROCEOURE
HEANS
*
*
•
OF VARIANCE
*
Residual plot
O.J +
o. l
b
A~ALYSIS
B
c
A
s
c
6
6
6
6
-O.'t +
--+---------+---------+---------·---------·---------+---------+---------·2.0
3.o
3.5
4.u
s.s
z.~
~.s
~.J
p
-65--
Note:
Only the ME.~~2 output is included from the
PROC ANOVA output. Although all the appropriate SS have t-een obtained via PROC GLM,
PROC ANOVA Kould be less costly.
~·
~RUC
(Brogan
&
Kutner,
:cs-:::c.
The Americ_an Statistician
~:+:22')-232)
These statements calculate the sums and differences re~uired for the
appropriate t-tests. See printout in ~art '];) and JV.
SORT; BY GRUUP;
~
PkwC PRINT; BY GKOUP;
!,
PROC TTEST; CLASS ~ROUP;
VAR TMT PREPCST TMT_X_PP;
~
PKuC GLM; CLASS GROUP;
MJOEL TMT PREPJST TMT_X_PP
LSMEA~S ~ROUP I
STOERR;
ESTIMATE 'NE~ VS STU' GROUP
@
•
UREA SYNTHESIS IJATA - Ana::.::sis of a repeated measures experiment
DoHA SHUNT;
INPUT P~E PUST ~~;
SULiJt:C T = -~~-;
IF _N_ LE 8 TnEN GROUP='NEri 1 i
ELSE GROUP='Ol0';
XO=l;
PREPGST = PUST - PKE;
TMT
= PGST + PRE;
TMT_X_PP= PKEPGST;
IF GROUP= 1 0LD 1 THEN PREPUST=-PREPUSI;
lAr<JS;
This gives the three appropriate t-tests for treatment effects,
time effects and interaction.
XU GROUP I NOINT;
-1 i
DATA REPEAT; SEI SHUNT;
Y= PRE; TIME=l; OUTPUT;
Y=PUST; TIMt=2; UUTPUT;
DRJP PKt POST TMT PkEPOST TMT_X_PP;
Same analysis as in @ except the analyses are performed
using 1-way Al!!OVA. Compare with tEl. Note that more than
one dependent variable may appear i;o the left of the equal
sign in the MODEL statement.
Rearrange data for a "split-plot"
tYIJe analysis.
PkuC PRINT; VAR SUBJt:CT XO GROUP TIME Y;
6
PRUC GLM; CLASS GRuUP TIME SUBJECT;
MODEL Y = XC GROUP SUBJECTIGRJUP)
TIME TIME*G~OUP I ~~INT SSl SS2 SS3 ~54 P;
M~ANS G~UUP SUBJECTIGK0JP) TIM[ TIME*G~OJP I
JEPON~Y;
lEST H=~kUUP E=SUBJECTIGKOUPI I HTYPc:l cTYPt:l;
OUTPUT OUT=PluT RESIOUAL=KcS ~k~uiCIEu=P;
J:
P~UC
PLOT; PLOT RES*P='*' I VREF=O;
Residual plot.
-66-
Combined ANOVA :able with two error terms.
•
~
---------------------------------JbS
•
•
•
i>f< E
GRuJP=~~n
r'UST
:.i.JdJECT
4il
1
1
XCJ
----------------------------------Pi'-EPU:)T
r-.. r
fMT_X_Pt'
'>19
-3
20
Tl:e assumed model
yijk =
1
2
51
35
:J'j
c:
1
3
4
61)
60
'TO
39
46
52
36
43
46
3
4
5
6
1
1
1
1
7
i
't2
54
8
1
5
6
7
6
3~
-3
20
'>J
-5
-3
-3
-6
12
i
-5
-3
uib:
12
~
---------------------------------- ~ROUP:OLu ----------------------------------JbS
9
lJ
11
PkE
i>GST
34
16
3o
lo
ld
32
'tJ
34
36
15
.;a
14
15
16
17
j2
44
50
u:J
ld
63
2J
43
45
0 7
50
36
11
12
13
14
15
16
17
1d
19
't2
:.3
34
20
32
21
21
14
PR&
1
1
1
't
10
12
19
20
xu
SudJECT
1
1
1
l
l
1
1
1
1
1
f'kEPUS T
18
:)J
-18
4
7o
-4
1d
1B
:)0
-1o
54
b
70
18
24
4o
64
7
'13
15
-4
14
105
-18
-6
-18
-24
-7
-15
130
4
do
-14
8
l1
7o
-a
75
-11
1, 2;
1,.- ·, n 1 ;
ith treatment effect
'rk
kth time effect
(cc:·\k
c.:'(i)
€ij'l1
treatment by time interaction
effect of subject j nested within ith treatment
group
random error
Eij'H- N(O, 0'~)
0.J (.~ ) -
-2'
N( 0 -~ ~ ')'
Yijk ~ N(u,~,~;+~2)
---
POST = postoperative response
Pre
Post
New (n:8)
~11
~12
Old 'n=l:O)
~21
~22
Treatmf'~t
:Iote the.t:
il>i'I'_):_?P
PP~POST
=
= {
.
- y ij1 = d~J
..
~ij2
dij
-dij
if
if
(=within subject differences)
group =NEW
group= OLD
P?'F?-'ST
~
:_: ; ;_eer1 Er
'Fe
-·)Wr:
'r'PEST
a•.-:.c~!la""
-'-:'!'":,_~
'IMT = Yij1 + Yij2
z1 ~
( = within sub,ject :o·..t.'!l~'
1.2
overall mean
preoperative response
c
k
cell mean of ith treatment, kth time combination
.yi
TMT_X_PP
T/oiT
-'- :; :: i) + Eijk
where:
-3
-6
'Hl
'16
be written as:
~ik = u-'-~'i +-:k+(a-r)ik
-6
12o
75
75
d9
-6
11 ik
~ay
s
·~n:
1:·
~-=:}~ec
r\- r-=-.2\
-;
•'
:"f'~rer1r.:e.2
2
•
E
•
\IAI{l ABLE:
-b
t-test uses
TMT
zl- z2
"difference of sums"
r..
;~EAI~
STu OE V
NE:Io
0
13
':13.:>i:JOL000
75.CJCOC.JOJ
lo.1o87~2'13
OLO
2't.LJd3<j929
GROuP
VARIANCES
I
DF
UNEo~UAL
2.0'~04
EQUAL
l.'1J44
18. 8
19.0
•
TT EST PtWC EUURL
50
"1Ii'li1'1UM
1-IAXlMJM
:).71oSl742
7~.0JJOJOJJ
6. 122.5U 42.
'tt..JJJJJJJO
12o.uJuJJOu
UJ.uOJJJJJ
STu tRKuR
y
.
~
r
:.o ~
~
u l l o - - fl12
"'21)( .
"""
> IT I
PROB
FOR HJ:
VARIA~LES
A~t
VAKIA8LE: PKEPOST
GROUt>
t-test uses
N
NE<I
OLD
8
13
EJUAL, F'=
~ITH
12 ANO 1
PKub
J~
pre
> F'= o.Zo'Jl
"sum of differences"
"'EAN
STtJ OEV
STu ci{RUK
MI NU4UI'I
MAXIMUM
0.75JOOOOO
12. J76923Jd
9.13579551
7.63174db0
3 ... 4212351
2.l1oo6628
-t>.JJOOJOOJ
-4.0JOOOJOO
2.0.000JOOOO
24.00000000
Df
PROB > IT I
-2. dJJl
-2.9767
12.3
J .Jl57
l~.O
0.007o
\'
J
~
UNEQUAL
EQUAL
FOR HO: VA.<.lfHL[S AKE EJUAL,
F 1 -=
1.63 wiTH 7 ANO 12. Uf
PR.uB
> f'-=
0.4375
-----------------------------------------------------------------------------VARIABLE: TMT X PP
GROuP
d
0.75CJOOJ0
11 -L2.J76923u:3
VARIANCES
UNEIJUAL
E.JUAL
fOR HO:
MEAN
,''4
NEw
OLu
t-test uses
T
Jf
3.1743
3.3{01
12. 3
H.O
V4KIA'll.. cS AKI: ::.QUJ\L,
~
-~
STLl OE
"difference of differences"
v
9.1357'>551
/.6.31 74ooJ
PROB
STtJ tKROk
:'-l HI U.'1
MAXiMlM
3.4<t212J51
-o.OOJJJJJO
2.11666628 -24.JJJOJOJJ
ZO.OOJOOOJO
~H
~.00000000
> IT I
J.007&
0.0032
F'=
post
These are not helpful due to the significant interaction.
(\ + d.2
T
VARIANCES
II
2.25
·~
. '/..~22
30 ..
J.0498
0.072.l
•
Since the interaction is clearly important
we need to consider simple effects
l.6j WITH 7 ANu 12 Jf
PkOB > F'=
-68-
J.~375
•
•
•
GENERAL LINEAR MODELS PROCEDURE
_£
CLASS LEVEL
CLASS
vt<.uuP
An alt~~ative ~roach to finding the same information
as::.~ :;:arts (!;) or@.
INFO~~ATION
LtVtLS
VALUES
NErl OLJ
2
hiJMdi:R Of OdSEkVATIUNS 1N
SET
~ATA
=
l1
DEPENDENT VARIABlE: H4T
SOUkCE
01-
SUM OF S..,jUARES
MEAN Si.IUARI::
JOO 00000
71 ,31. 5 0000000
467.36::1421()5
MODEL
2
ERROR
19
68d ..). 00000000
21
bl943.ovoooooo
R-SCJUAkE
c.v.
STiJ DI::V
HH MEAN
0.941557
26.3490
n.o187J5H
d2.047o1905
JF
TYt'E: I SS
l
l
l4l3oti.047ol905
lo.;.4.9523d095
UNCOkRECTEJ
SOURCE
xo
GROUP
T~TAl
Jf
SoURCE
xo
()
GROUP
l
l<t 3063.
TYI'f
IV SS
0.00000000
lo94.'15l3H095
T fLR HO:
PARA~IE
NElli \IS
TE R
STJ
ESTIMATE
PAKAMETE R=0
lo.,JJJCJOO
l. iO
f
VALuE
153.05
PK
)
f
O.uOOl
f
>JALIJI:
PK
3 02.4 8
VALUE
t>R
3.o3
PK
F
o.uOOl
0.0721
3.o3
f
>
>
F
J.07ll
>
llj
.)f.; I:RRUK Gf
E;,fiMAit
0.0721
9.
-69-
7145~'Hb
•
•
©
•
GENERAL LINEAR MOL>ELS PROCEOUitE
DEPENDENT VARIABLE: PREPUST
OF
SUM OF SI.IUARES
MEAN SUUARE
F VALUE
MODEL
2
1900.5 76923011
950.2111146154
13.2!;
ERROR
19
1362.42307692
11.101>4111 J
PR > F
UNCORRECTED TUTAL
21
3263.00000000
R-SQUARE
c.v.
STD DEV
PREPOST MEAN
o.5B24113
109.0965
8.46796775
7.761904711
SOURCE
SOURCE
XO
GROUP
SOURCE
xo
GROUP
PARAMETER
NEW VS STD
O. OOO.i!
>
L>f
TYPE I SS
VALUE
PR
1
1
1265.19047619
635.311644689
17.64
8.86·
0.0005
0.0078
OF
TYPE 1V SS
F VALUE
PR > F
0
1
o.oooooooo
635.3 B644689
ESTlMAIE
T FOR HO:
PARAMETER=O
-11.32692308
-2.98
f
.
II.B6
GROUP
f
I
.
GROUP
0.0078
> Ill
STD ERROR OF
ESTIMATE
0.00711
3.80515341
PR
NEW
OLD
GROUP
DEPENDENT VARIABLE: 1111 X PP
Df
SUM Uf SQUARES
MEAN SI:IUARE
F VALUE
MODEL
2
1900.5 7692308
950.28846154
U.25
ERROR
19
1362.42307692
11.70647173
PR > F
UNCORRECTED TOTAL
21
3263.00000000
R-SI.IUARE
c.v.
STU DEV
TMT_X_I'P t4EAN
o. 5112463
117.7664
8.46796715
-7.19047619
Uf
TYPE I SS
F VALUE
PR > F
1
1
1085.71>190476
B14.1l1501832
15.14
11.36
0.0010
0.0032
Df
TYI'E IV SS
F VALUE
0
1
o.oooooooo
814.111501832
11.31>
SOURCE
SOURCE
XO
GROUP
SOURI:E
xo
GROUP
PARAMETER
NEW YS STU
NEW
DLO
NEW
OLD
0.0002
PR >
f
0.0032
T FOR HO:
PARAMETER=O
PK > Ill
ES HMATE
STO ERROR UF
ESTIMATe
12.826'12308
3.'31
0.0032
3.Bv515343
I
-70-
LEAST
SQ~AR~~ HE4~~
JMT
LSMEAN
STO ERR
LSMEAN
PROB > III
HO:LSMEAN=O
93.5000000
75.0000000
7.6433666
5.9959501
0.0001
0.0001
PREPOST
LSMEAN
STD ERR
LSME:AN
PROB > Ill
HO:LSMEAN=O
o. 7500000
12.0769231
2.9938787
2.3485917
0.8049
0.0001
TMT_X_PP
LSMEAN
STU EH.R
LSMEAN
PRUil > I Tl
HO: LSME:AN=O
o. 7500000
-12.07119231
2.9938787
2.3485917
0.8049
0.0001
•
SuBJECT
xo
GI\OUP
1
2
1
1
3
2
2
l
1
1
1
1
l
1
1
1
l
l
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
NEw
NEW
NEw
NEW
NEW
NEw
GB.:i
:R)
,'*
3
6
7
3
4
4
5
9
9
10
11
5
6
6
12
1
13
14
15
16
11
1::3
19
2J
.21
22
23
24
25
26
27
7
8
0
'I
9
10
10
11
ll
12
12
13
13
14
14
15
15
16
16
17
17
18
18
19
19
20
20
21
21
28
29
3::J
31
32
33
34
35
36
37
3d
3'1
40
41
42
1
2
1
2
1
2
1
2
1
2
1
NEW
NEw
NEw
NEW
OLD
ULD
OLD
OLD
1
1
1
1
1
1
1
l
1
1
1
36
34
16
36
18
38
32
32
14
44
20
50
43
60
45
1
2
1
2
OLD
OLD
OLD
ULO
LlLO
OLU
OLD
OLO
OLD
OlD
OlD
OLD
UL!J
OLO
OLD
OLD
OLD
OLD
OLD
llLtJ
OLD
l
<tO
2
(JltJ
1
1
]5
55
o6
60
40
35
3'1
36
46
43
52
46
42
!14
34
16
2
NEW
l
51
4b
1
2
l
NEW
NEw
NEw
NEW
•
y
l
2
1\I.EW
CLASS LEVEL
LEVeLS
l
2
1
2
l
2
1
2.
1
2.
1
2
1
2.
l
2
63
67
50
36
42.
34
1
43
2
32
2
~E.w
TIMt
2
l 2
Ll
l~FuRMATIO~
VALUES
GkOUP
SU!:lJlCT
1
2
•
GENERAL LINEAk HOOELS PROCEDURE
®
CLASS
TIME
lJLO
1 2. 3 4 5 6 7 8 'I lJ ll 12. lj 14
1~
16 17 J.blJ202l
-71-
\'..) M :-}
f ;',
(l
F Ut_j -~ -:-_
1•· 1·/
~ T
I
1\j'
.
~-
;
')
.)
~ +~
-..'
•
""
.2/
DEPENDENT
VA~!ABLE:
uENERAL LINEAR MODELS
•
~ROCtDURE
Y
S~o~UARE
t- \1 AlUc
76'i21.78tl4o154
33H.4255d528
93.2o
19
681.21153840
37.d5J23d87
42
17603.00000000
R-SIJUARE
(:.>/.
STu iJE\1
0.991222
l4.~95tl
5.98775142
JF
T't'PE l SS
1
1
70oU4.023ti0952
847.47619048
4440.00000000
542.8809523ti
407.40750916
SOURCt:
JF
SUM OF SoiUARLS .
HODEL
23
ERROR
UNCOkRECTED TuTAL
SOURCE
xo
GROUP
SU6JEC:T L Gk.l.JUP I
TIME
GKO\JP*T l Mt:
19
1
1
MEAN
Pi<.
>
•
F
J.OJ01
Y
MEAN
41.02380952
I'
VALUE
1971.48
23.64
o.sz
15.14
11.36
?R
>
f
t
~
1
0
0.0010
0.0032
=
(-A)< -0."5) + (M)(l2.0769)
{2(35.8532h'[(281)2 (~)+(~i)2 (l~)]}i
= 3.89
SOURCE
OF
TVPE 11 SS
xo
0
1
19
O.JOOOOOOO
847.47619048
4440.00000000
54.2.88095238
;.PtLoOOU,:.>L.:>O
407.40750916
GROUP
SUBJECT I GKi.JUP I
Tl ME
GROUP*TIME
SOURCE
xo
.
L
i
JF
TYPE I l l SS
0
1
&ROUP
SU6JECTIGKUUPI
TIME
GROUP*TIME
19
1
1
0.00000000
847.47()19048
4440.00000000
317.69322344
407.407 50916
SOURCE
Uf
TYPE IV SS
xo
GROU!l
SUBJ EC Tl GfWuP I
T I ltf:
GROUP* TIME
0
1
19
l
1
GROUP
F
f
VALUE
•. L----/
23.o4
6.52
15.14
A.:.>eL't
ll.3o
~
VALUE
PR > f
23.64
o.52
S.l:l6
ll. 36
0.0001
0.0001
0.0078
0.0032
VALUE
PR > F
23.o4
o.52
0.0001
0.0001
~
0.001
o.u032
t:lo86
u.oo1a
11.36
().0032
SU~JECT(GROUP)
l)f
TYPE I SS
1
847.47619048
f
VALUE
3.o3
F
= (3.89) 2 = 15.14 ,
PR > F
o.oooooooo
847.47619048
4440.00000000
317.69322344
407.407 50916
TfSlS Of HYPOTHESES USING THE TYPE l MS FOR
SOuRCE
f
~
l
~
AS AN tRROR TERM
PR >
f
o.o 721
The T,ype I and II SS for TIME test equality of the
weighted means -- weighted according to sample size.
This is probably not desired and the Type III or IV
should be used as they test equality of unweighted
!!leanS,
j
-"2-
C=pare with the results of
®
and
@.
•
•
GENERAL LINEAR MODELS PROCEDURE
~
•
11EANS
t.ROUP
;H:w
ULD
N
'(
lo
2b
46.7500000
37.5000000
SUdJ ll.. T
GKUUP
N
'(
l
NEoi
NEW
NEw
NEW
NEw
NEW
NEw
NEW
OLD
OLD
l.JLD
OlD
OLD
uLD
OLU
OLD
OLD
OLD
OLD
ULD
OLD
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
49.5vOOOJO
45.0000000
o3.0Jvooou
37.5000000
37.5000000
44.5000000
49.0000000
43.0000000
25.0000000
33.0000000
25.0000000
27.0000000
35.0000COO
23.0000000
32.0000000
46.5000000
52.5000000
65.0000000
43.0000000
33.0000000
37.5Jil0000
2
3
4
5
6
7
8
"10
11
12
13
14
15
16
17
1.8
1';1
20
21
2
2
2
y
N
TIME
1
21
2
21
44.619047o
37.42d57l4
GROuP
Tl Mt
N
'(
NEw
NEW
1
2
8
~LiJ
1
2
13
13
46.3750000
47.1250000
43.533't615
3l.4615j85
CLD
a
l
~
These means are plotted in part
@.
j
-73-
:~' ·" ·~·
·.·
•
+
I
I
I
I
I
*
•
I
I
II
I
+
*
I
I
I
I
I
+
I
I
I
I
I
*
*
'.I)
*
* *
*
*
•JJ
*
1.1)
::::)
_,
0
·"'>-::!:
*
*
*
**
*
*
*
*
*
*
*
UJ
"X
u.
0
....
_,
(J
0..
•
.j.l
0
rl
*
PI
rl
*
+0
*
I
I
+
I
I
I
I
*
"'
+"'
I"'
1
I
1
1
*
1"'
1
1
*
+----·----·----·----i----·----+-~=~+----+
0
0
~
....
·rl
.
l.t'l
~--
l.t'l
0
"'
0
•
.
.
l.t'l
0
"'
l.t'l
.....
I
I
•
I
z.
.i.J
0
'::l
T
V'l
.,...
+O
*
.
"'"'
I
I
I
1
*
0
~
I'<"~
p:;
IX
a..
+O
Q)
1.1)
~
*
•rl
:.u
"'
I
I
I
I
I
*
ro
,g
+
1
*
./'\
"'
"'
I
*
..,
0
I
I
I
I
I
*
a..
1.1)
"'
+ 0
*
*
<.II
....
I ..0
I
I
*
*
It'\
+ 0
+
':)
,...
•
..,.,
I
I
•""
I ....
l.t'l
0
"
•
H3MOGLOBIN
•
- Analysis of a 2-Period Cr8ss-over Design
(Grizzle, 1965,
J AT A HE!o\U;
l:'lt>JT Yl Y2 ,..;,;
SJ:3JEC T = -~-;
IF _N_ LE 6 THEN GKOUP= 1 Al_B2';
ELSE GKOUP= 1 Bl_A2 1 i
f'H
= YZ-Yl;
i\!:::510= YZ+Yl;
Ttl.b-IJ= HIT;
iF GKOUP='Bl_AZ' THEN TREND=-TMT;
XJ = li
L.A.<.JS;
•
~
j3j._ometric~
21: 46;-I+EC)
These statements calculate the sums and differences required for the
appropriate t-tests. See printout for };) and ]) .
PRuC jUKTi BY GKUUP;
~
PKUC
~·
PKOC TTEST; CLASS bROUP;
VAK TMT RESID TREND Yl;
"C'
PRUC GLM; CLASS GRJUP;
M00£L TMT RESID TREND Yl = XO GkuUP I NUINT;
LS~EANS GROUP I STDERRl
ESTIMATE •CONTRAST' GROUP 1 -1;
])
O~TA
'-./
~ROC
Pf<INT N; BY GROUP;
PROC TTEST gives the appropriate four t-tests for treatment effects,
carry-over effects, time trend and treatment differences within
first period only.
AUV; StT HEMO;
Y-=Vl; t'E:RIOD=l; If _N_ LE a THE:"i TRT= 1 A1
Y=YZ; PERIOO=Z; If _N_ LE: 6 THEN TRT= 1 B1
ORUP Yl Y2 TMT RESIO TREND;
PRl~T;
;
;
ELSE: TRT='B'; l.JlJTPUTo
ELSE TKT= 1 A1 i OUTPUT;
?KuC GLM; CLASS TRT PERIOO SUBJECT ~ROUP;
MODEL Y = XC GROUP SUBJECTIGROUP)
PERIOD TRT I NOINT P SSl SS£ SSJ SS~
MEANS GROUP SUBJECT(GROUP) PERIOO TRT I OEPONLY
TE5T H=GROlJP E=SUBJECTlGROUP) I HTYPE=l ETYPc=l
ESTIMATE 'TRT' TRT l -1;
eSTIMATE 'PERIOD' PERIOD 1 -1;
:W'
PROC PLOT; PLOT
RES*P~•••
I
VREF=O;
Combined ANOVA table with two error terms.
Residual plot.
-'/'~-
®.
Rearranging the data so that the "usual"
ANOVA table may be constructed.
VAR SUBJECT XO GROUP PERIGO TRT Y;
®
'-"'--'
This performs the same analyses as those found in par:t
Compare also with the results in part @ .
•
QD ---- ___
-------------------------LlBS
l
l
3
Yl
Y2
0.2
1.0
-0.7
0.2
1.1
0.4
1.2
o.o
-0.8
O.b
0.3
1.5
't
5
b
GKOUP=Al_B
SllBJEC T
1
2
3
4
5
6
2
--
•
•
--------------------------------
TMT
RESliJ
0.8
-0.7
1.0
0.5
(). 1
-0.3
1.2
-0.1
-:>.o
1. 7
0.7
2.7
xu
IRENU
.:>.a
1
1
1
1
1
1
-0.7
1. 0
0.5
o. 1
-0.3
The assumed model appears as:
y ijk = uik + ~ij + Eijk
where
uik
N=o
j=l,···,n1 ;
--------------------------------- GROUP=B1_A2
Y1
uSS
1
1.3
ii
-2.3
0.9
1.0
0.6
-0.3
-1.0
1.7
-0.3
o.o
-o.a
~
10
-u.4
-2.9
-1.9
-2.9
11
12
lJ
1-+
SUBJECT
Y2
7
8
9
10
11
0.'7
TMT
-0.4
3.3
0.6
0.5
-0.6
12
4.o
13
14
3.8
loo
= J.L + !Tk + ¢.e + A,e
i=l,2;
k=l,2;
L=l,2
and
IU:SID
2.2
-1.3
0.6
-1.1
-1.4
-1.2
-2.2
-z.o
xo
TREND
0.4
-3.3
-0.6
-0.5
0.6
-4.6
-1 • .:.
-3.d
= general mean,
= the effect of the i-th patient (subject) within the Kh eequence,
which, for the eake of testing hypotheses, we must assume
to be a normally distributed random variable with mean 0
and variance ..: ,
.... = the eft'ect of the k-th period,
•• = the direet e1fect of the l-th drug,
>., = the residual e1fect of the l-th drug, and
••~> = the random fluctuation which is normally distributed with
mean 0 and variance or! , and is independent of the f 11 •
,.
~.~
1
1
1
1
1
1
1
1
The assumptions made· about E11 and e.,. imply that the variance
of an obeervation is or!
or! and that two observations on an indi"ridual
have covariance or! • Observations made on diHerent subjects are
dependent.
N=8
+
Yl are the responses during period l.
m-
Y2 are the responses during period 2
Note:
Group (Sequence)
l(n=6)
2(n=8)
1
A
J.Ln
B
J.L21
2
B
J.Ll2
A
J.L22
Period
( i)
(ii)
(iii)
CY1·1 - Y1. 2) - ( y2 ·1 - y 2· ,) = 2 (tf>1 -
(Y1•1- y1•2) + (y2•1- y2·2) = 2 (TT1- TT2)- (:\.1 + A2) + (E1•1- E1·2 + E2·1- E2·2)
(yl·l +yl·2)- (Y2·1 +y2·2) = (A-2- :\.1) + 2 (~1· - ~2·) + (E\.1 + €1·2- €2·1- €2·2)
(iv)
'lMT = Y1 j 2 -yijl = dij
TRE!'m
={
y1·1-y2·1
(=within subject differences)
RESID = yij 2 +yijl = zij (=within subject sums)
~2) + ( A2 - A1) + ( €1·1 - €1· 2 - €2 ·1 + €2. 2'
rtf>1
-<1>2 ) + (~1.- ~2·) + (€1·1- €2·1'
Now, i) through iv) may be reccenized as:
d .. if sequence is AB
l.J
(i)
-dij if sequence is BA
(ii)
(iii)
(iv)
~-­
-~c-
#;_>:.·.
d1
-a2
a1+d2
, a test of treat=ent effects if there is no carryover effect
, a test of perio~ effects if there is no carryover effect
zl-z2 ' tests for :arr:.-c·ter ef!'e-.: ~"
tests for treatment effe:ts based upon the first period data only
])
VA.< I ABL. . . T
t-:~st
TTEST PROCELlURE
uses
d.1 - d.2
"difference of differences''
•
GROUP
';
MEA 'II
STU OEV
STD ERROR
MINIMUI-1
MAXIMUM
A1_B2
B1_A2
:,
:,
O.B33BB
1.b7,00000
O.t-5625198
1.99051321
0.26791375
0.70375270
-0.70000000
-0.6000000C
1.00000JOO
4.ocooouoo
VARIANCE~
UNEQUAL
EQUAL
FOR HO:
T
-1.9145
tl.~
o.uadz
-1.o~l5
12.0
o.t1o5
vA~IANCES
VARIABlE:
> I Tl
?ROB
i,)f
A~E
EJUAL 1 f'=
t-test uses
~ES!J
9.20 WITH 1 AND 5 DF
-zl- -z2
·~
MEAN
STO OEV
A1_B2
8l_A2
b
O.d3333333
-O.dJCOOOOO
1.32614130
1.47't54593
T
[jf
2.1732
2..1379
11.5
12.0
VARIANCES
UNEQUAL
EQUAL
FOR HO:
VAKl~NCES
VARIABLE: Tr'.f:f\10
PROB > f
1
= J.02o5
"difference of sums"
GROUP
d
ERROR
MINIMUM
MAXIMUM
0.54139737
0.52133071
-0.7000000J
-2.20JOOOOO
2.10000000
2.20000000
ST~
> ITI
PROS
0.0515
u.05J8
There appear to be important carry-over effects. Thus, the above test for treatment effects is not free
of residual effects and we must resort to the results of the first p~r:o1 ~nly (variaole Yl below).
AKE EQuAL,
f'=
1.24 WITH 1 AND 5 Of
t-test uses
al + a.2
"sum :>f differences"
PROB
> F'= 0.8437
GROUP
!'-<
:olEAN
STO DEV
STD ERROR
MINIMUM
MAXIMUM
Al_B2
8l_A2
0
o. 23333333
-l.6750JOOO
0.65625198
1.99051321
0.2b791375
0.70375270
- o. 7000000 0
-4.6\lilOOOOO
1.00000000
O.bOJJOOOO
PRU8
> F•= 0.0265
3
T
Df
2..5342
2..2390
8.9
12.0
VARIANCES
UNEQUAL
EI.IUAL
PROB
t-test uses
GROUP
N
Al_B2
6
3
6l_A2
VARIANCES
UNhhJAL
EQUAL
> IT I
0.0323
0.0449
FOR HO: VARIANCES ARE EQUAL 1 F 1 =
VARIABLE': Y1
9.20 WITH 7 AND 5 OF
yl·l -y2·1
"independent two-sample t-test for the first period only"
MEAN
STL) OEV
STO ERkOR
M1NIMUH
MAXIMUM
::lo3JJOOOJO
o. 75365775
1.50990175
0.30767949
Oo533d3301
-0.80000000
-2.90000000
1.50000000
l.JCOuOOOO
-1.237~0000
T
2.49~3
2. 2746
FUR HO: VARIANCES ARE
Of
PROB
10.8
12.0
> ITI
0.0302
0.0421
E~UAL,
_,.-;
•
.
f'=
There appear to be treatment effects present. Note:
the con~lusion wou11 likely have been different.
4.01 WITH 1 AND 5 DF
~ROB>
Had we chosen to
:gn~re
residual effects
F•: 0.1453
:·:
;·~:·:-
:.
.0
•
•
GENERAL LINEAR HODELS PROLEOURE
DEPENDtNT VARIABLE: TMT
j)f
SUM OF SQUARES
MEAN SQUARE
F VALUE
MODEL
2
22.17166667
ll.3d~83333
4.57
ERROR
12
29.8tltl33333
2.49ilb~'t44
UNCORRECTEJ TOTAL
14
52.66000000
R-SQUAil.E
c.v.
SHl DfV
TMT MEAN
0.432428
lit9.2866
1.57819341
1. 05714286
SOURCE:
PR >
f
u.0334
LEAST SQUARES MEANS
SOURCE
OF
TYPE I SS
F IIALUE
1
1
15.64571429
7.12595238
6.28
2.86
xo
GROUP
PARAMEH:l.
CONTRAST
PR >
f
o.o21c.
0.1165
PR > ITI
ESTIMATE
T FOR HO:
PARAMETER=O
-1.44166667
-1.69
0.1165
STD ERROR Of
ESTIMATE
OF
SUM OF SQUARES
MEAN SWUARE
MODEL
2
9.2 8666667
4.64333333
ERH.uli
12
24.01333333
2.00111111
UNCORREC Tbl TuTAL
14
33.30000000
R-SQUAkE
c.v.
sro oev
RESIO MEAN
o.27&lH9
1414.6063
1.41460634
-0.10000000
SOURCt
xu
GROUP
PARAMETEI<
CONTRAST
'!$
·~,t
f
lfALUI:
PR >
f
0.1406
F VALUE
PR > F
1
1
0.14000000
9.14666667
0.07
._.57
o. 7959
o.o5n
T FOR HO:
PARA14ETER=O
PR > lT I
E:STHlATE
STO ERROR OF
ESJIMATE
1.63333333
2.14
0.0538
o. 76397474
TYPE
I
STO ERR
t.SHEAN
PRUS > ITI
HO:LSM£AN=O
Al_S2
0.23333333
1.67~00000
0.64429476
0.55797563
0.7235
Bl_A2
Gt{OUP
RESID
LSMEAN
STD EHR
LSMEAN
PROB > ITI
HO:LSMEAN=O
A1_o2
S1_A2
O.t13333333
-0.80000000
0.57751062
0.50013887
0.1357
GROUP
TREND
LSMEAN
sro ERR
PROB > I r&
HO:LSMEAN=O
Al_B2
B1_AZ
0.23333333
-1.67500000
0.55797563
o.ouo
Yl
LSMEAN
STI> ERR
LSMEAN
PRUB > ITI
HO:LSMEAN=O
0.30000000
-1.23750000
o.5109133.tt
0.44251589
o.56ao
0.0161
o.ouo
0.17~6
LSMEAN
0.64~29476
0.7235
2.32
SS
Of
TMT
LSMEAN
o.o52Jll86
DEPENDENT VARIABLE: RESlO
SOURCE
GRJiJP
GR~UP
Al_B2
Bl_A2
-76-
..
~--
~·
'·
·.:
--::
•
s
DEPENOE~T
•
GENERAL LINEAR MODELS PROCEOURE
V6~1ABLE:
TREND
SOURCE
OF
SUM OF SQUARES
MEAN SlollJAKE
F 1/ALUE
t-IOOEL
2
22.77166667
ll.385d3333
~.57
ERROR
12
29. 8dti33333
2.4'1J6944~
UNCORRECTcJ TOTAL
14
52.66)00000
R-SQUARE
C.IJ.
STU OEIJ
TREND MEAN
0.432428
184.1226
1. 57819341
-0.85714286
JF-
TYPE I SS
1
1
10.28571429
12.48595238
... u
ESTIMATE
T FOR HO:
PARAMETER=O
PR > ITI
STD ERROR Of
ESTII'IATE
1.90833333
2.24
0.0449
o.a5232186
SOURCE
xo
'JROUP
PARAMHE~
CONTRAST
PR
>
f
o.J33-.
f
IJALUE
PR
>F
0.0649
0.0449
5.01
DEPENDENT VARIABLE: V1
OF
SUM OF SQUARES
MEAN S<lUAkE
F VALUE
MODEL
2
12.79125000
6.39562500
4.08
ERROR
12
1B.79d75000
l.:to65o250
PR > F
UNCORRECTED TOTAL
14
31.59000000
R-SQUAKE
C.IJ.
STD DEV
Yl MEAN
0.404915
21&. 3301
1. 2 5162 395
-0.57857143
t)f
TYPE l SS
F IJALUE
1
1
4.6db42857
8.10482143
2.99
5.17
ESTIMATE
T FOR HO:
PARA14ETER=O
PR
1.53750000
2.27
SOURCE
SOURCE
)(0
GROUP
PARAHETE R
CONTK4ST
0.0444
PR >
f
0.1093
0.0421
> IT I
STO ERROR Of
ES Tl14A TE
0.0421
0.67595419
-79-
•
:.
0135
'D'
....__,
•
•
1
2
3
4
5
6
7
&
9
10
11
12
13
l<t
15
16
17
ltl
19
20
21
22
23
24
25
26
21
28
SUBJECT
1
1
2
2
3
3
.
4
5
5
b
b
7
1
8
8
9
9
10
10
11
11
12
12
13
13
14
1ft
xo
;.>ROUP
1
1
1
1
1
1
1
1
Al_B2
Al_B2
Al_B2
A1_B2
Al_B2
A1_82
A1_82
A1_82
A1_d2
A1_82
Al_B2
Al_B2
6l_A2
B1_A2
dl_A2
B1_A2
Bl_A2
Bl_A2
Bl_A2
o1_A2
B1_A2
tH_AZ
B1_A2
B1_A2
IH_A2
81_A2
Bl_A2
.8l_A2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
PERIOD
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
y
TRT
0.2
loO
A
0
A
B
A
8
A
o.o
-o.a
-0.7
0.2
0.6
1.1
0.3
0.4
1.5
B
A
8
A
B
1.2
B
A
1.3
0.9
-2.3
1.0
B
A
d
A
o.o
0.6
-O.d
-0.3
-0.4
-1.0
-2.9
B
A
8
A
8
A
B
A
B
A
1.7
-1.9
-0.3
-2.9
0.9
-:.G-
-·"":;:
.!)
•
GENER4L LINEAR MODELS PROCEDURE
CLASS LEVEL
CLASS
LEVE:LS
VALUES
TRT
2
A 8
Pi::RiuO
2
l 2.
SUBJECT
14
ukfJUP
2
IN~GKMATIUN
1 2 3 4 5 6 7 d 9 10 11 12 13
•
l~
A1_82 B1_A2
NUMdER Of OBSERVATIONS IN DATA SET = 28
DEPENDENT VARIABLE: Y
MEAN
SOURCE
OF
SUM OF Sf.IUARES
ptOOE L
16
2.d.03583333
1.75.223958
ERROR
12
14.94416667
1.24534722
UNCORRECTEJ TOTAL
28
42.9b000000
R-S~.o~IJARE
c.v.
STO DE:V
0.652300
22H.9025
l.ll595126
OF
TYPE I SS
F VALUE
xo
1
GROUf>
1
0.06
3.o7
1
.).07000000
4.57333333
12.00666667
7.82285714
3.56297619
SOURCE
OF
TYPE II SS
xo
0
1
12
1
SOURCE
SUBJECT!
~.>ROUP
I
PERIOD
JRT
GROuP
SUB.I EC f I Gt<JUP I
PERIOD
TRT
SOUIR CE
xo
GROUP
SUBJtCTivRCJUt>l
PERiUG
r~
r
12
1
Y
VALUE
1.41
PR
>
F
MEAN
-0.05000000
PR > F
o.so
The TYPe I SS test equality of weighted means for the
PERIOD effect. This is probably not of interest.
6o28
2.86
f
VALUE
PR
>
f
o.oooooooo
l
3.67
0.80
5.01
2.86
OF
TYPE Ill SS
F VALUE
0
O.JOOOOOOO
1
4.57333333
3.67
1
12.00666667
6.24297619
3.56297619
0.30
5. 01
2.86
1
f
0.2780
4.57333333
12.00666667
6.24297619
3.56297619
u
Sf.IUARE
~
0.044';
0.1165
f'j{
>
f
~
o.044<J
0.1165
The Type III SS give the appropriate tests of unwe"'.ghtef1 menn" for t"!:':
TRT and PERIOD effects. (See J) ,
and ESTIM.~.TE on next pa~;e. '
JY
-2l-
•
~
~
•
•
.,
TESTS OF HYPOTHESES USING THE TYPE l MS fOR SUBJECTtGROUPl AS AN ERROR TERM
JF
SOURCE
GROUP
TYt>E I SS
F VALUE
4.57333333
4.57
>
f
I
(Residual)
T fOR HO:
ESTIMATE
PARAME f ER=O
0.72083333
-0.95416667
1.69
-.2.24
PARAMETE.R
TRT
PERl 00
PR
0.0538
> IT I
PR
STu ERROR Of
tS II MATE
HEANS
N
y
A1_82
Bl_A2
12
0.4166666 7
-0.40000000
16
SUBJECT
GI(OUP
N
y
l
Al_B2
Al_82
Al.:_B2
Al_B2
A1_82
Al_B2
Bl_A2
Bl_A2
Bl_A2
tH_A2
Bl_A2
Bl_A2
B1_A2
B1_A2
2
2
2
0.60000000
-0.35000000
-0.30000000
0.85000000
0.35000000
1.35000000
1.10000000
-0.65000000
0.30000000
-0.55000000
-0.70000000
-0.60000000
-1.10000000
-1.00000000
2
3
4
5
6
1
!l
9
10
11
12
13
14
2
2
2
2
2
2
2
2
2
2
2
PER 100
l
2
TRT
A
d
N
y
14
14
-0.51857143
0.4 7857143
N
y
14
14
o. 37857143
-0.47851143
(
o.426l6J93
0.42616093 _.)
0.1165
0.0449
GRUUP
\
-b2-
Compare with parts ]) and
:0 .
•
I
I
I
I
+
*
•
I
i.•l
'C•
I
*
*
+ .....
*
*
*
<I')
*
*
I
I
I
I
I
*
*
*
*
+
0..
*
*
*
*
0..
....
*
w
<I')
(~'«)
0
I
I
*
*
I
I
I
I
I
I
I
I
I
I
*
*
*
*
<:>:
I
l
u..
0
.....
a
I
I
I
*
0..
*
*
I
I
I
I
I
I
I
II
I
I
I
I
I
*
I
I
*I
I
+1'\J
I
I
I
!
I
I
I
- - + - - - + - - - + - - - + - - - + - - - + ---·---+-~~~---+---•-1I
.
1(\
....
a-
0
•
.
""
0
.
0
0
I
I
I
I
I
*
...j
•
N
.
,.,
-o
a-
0
I
0
I
0
I
.
.
.
N
1(\
....
.....
I
I
I
•
~IIK41t~D-------------------------------------3alanced for Residual Effects.
DATA cow;
INPUT S~UARE COW
CARDS;
lJ
PkCC
P~RIOD
TRT
$
YIELU RA RB RC
(p. 134ff in Cochran and Cox, 1957)
~ES;
P~INT;
VAH SQUARE COW PERluD TRT RA RB RC RES YlELu;
TITLE A CROSSOVER OESIG~ wHEN THERE ARE PGSSIBLE RESIJUAL EffECTS;
®
PKOC GLM;
CLASSES S~UARE COW PERIOD TRT;
~OJEL YIELD = COw PERIODISQUAREJ RA RB RC TRT I SSli
~EANS
TRT I UEPONLY;
LSMEANS TRT I STDERR;
~
PRGC GLM;
CLASSES SQUARE COw PERIOD TRT;
MU~El YIELD= COw PERIOOIS~UAREJ TRT RA RB kC I SSli
ESTIMATE 'TKT A VS AVGIB+C)' TRT 1 -0.5 -O.Si
ESTIMATE 'TRT B VS T~T C1 TRT 0 1 -1;
LS~EA~S TRT I STDERK;
MEANS TRT I OEPONlY;
OUTPUT OUT=NEW PREOICTED=P RESlDUAl=R;
~
PROC PLOT;
PLOT R*P= 1 * 1 I VREF=O;
A check on the residuals reveals no obvious violations
of the assumed model.
®
OBS
SQUARE
1
l.
3
4
5
SQUARE, COW, PERIOD, TRT and RES are CLASS variables.
R~, RB and RC are 0,1 indicator variables which indicate the residual effects of each of the three treat~ent~.
YIELD is the response variable, coded milk
yield.
cow
1
1
1
1
1
1
2
2
2
3
15
1
1
1
1
1
1
2
2
2
2
2
2
lb
2
0
1
d
9
10
11
12
13
14
z
17
18
2
-:.'--
CLASS, indicator and response variables
PERIOD
l
2
3
1
2
3
TRT
A
B
c
B
c
A
c
1
2
A
3
B
4
4
l
2
A
4
3
1
ti
i3
2
3
l
A
c
c
2
6
3
A
=
3
5
5
5
b
b
6
c
RA
RB
RC
0
;J
1
0
0
0
0
0
0
1
0
1
0
J
0
1
0
0
0
0
0
0
1
i)
0
0
1
0
1
0
0
0
0
0
0
0
0
1
0
0
0
l
0
1
0
0
0
1
0
0
0
0
1
0
RES
0
1
2
0
2
3
0
3
l
0
YIELD
38
2.5
15
109
8&
39
124
12
27
1
8&
76
J
'+b
0
l.
1
0
3
z
75
35
14
101
63
1
•
~
•
I'he model fitting residual effec··fore treat:::ent effects.
d
A CROSSOVER DESIGN WHEN THERE AKE POSSIBLE RtSlOUAL EFFECTS
GENERAL LINEAR
~UOELS
P~JCCUURE
CLASS LEVEL INFORMATION
CLASS
LeVELS
VALUES
S<JUAKE
2
l
2
Cuw
&
l
2
Pt:IUUu
3
l
2 3
TKT
3
A B C
j
4 5 6
NUMBER Of OBSERVATIONS IN IJATA SET
TRT
= Rougha€e diet
B = Li~ited grain diet
C = ?ull grain diet
A
= 1:3
DEPENDENT VARIABLE: YIELD
SOURCE
Df
SUM OF SQUARES
MEAN Sf.1UAI{E
'400El
13
20163.1'1444444
1551.01495726
ERROR
4
199.25000000
49.81250000
17
20362.44444444
R-SQUAf<E
c.v.
STO OI:V
YIELO MEAN
o. <}<}0215
12.0761
7.05779711
5d.44444444
Jr
H'PE I SS
5
5781.11111111
ll48'i.lll1llll
11.75555556
2o.66666667
CORRECTED TUTAL
SOURCE
cow
PERIOD I S>.luAf-:[ l
RA1
R.B
4
1
1
RC J·
0
TR T
2
z
f
VALUe
PR > f
23.21.
57.66
0.24
0.54
0.0047
0.0009
0.6525
0.5049
28.65
0.0043
I'he SS due to residual effects unadjusted for treatments is found as:
ss
Rer-id.ual effects (unadj.)
= RA
+ RB + RC
11. 7 556 +26.6667 +0
~c.:,.22~
VALUE
31.14
PR > f
0.0023
J.OOOOOOOO
2d54.55000000
f
>·rith 2 df.
-::;-
·;:.,,.
'{!t
•
:s
•
The JlOd.el-fi tting treatments -oefore . a l effects.
A CKOSSGVEK DESIGN WHEN THERE ARE POSSISLE RESIDUAL EFFECTS
GENERAL LINEAR
~ODELS
PROCEDURE
OEPtNDENT Vt..'K !A3LE: Yl ELO
SOURCE
OF
SUM GF SQUARES
MEAN SQUARE
.''IODEL
13
20163.1'14ft4444
.1:>51. Jl495726
31.14
EKRCR
4
l 9 "· 2 50 00 0 0 0
49.81250000
PR > F
17
20362.44444444
R-SQUAKE
c.v.
STO OI:V
YIELD MEAN
0.990215
12.07ol
7.0577'1711
58.44444444
CDRRECTEJ TOTAL
SOURCE
cow
5
4
2
1
1
0
PERIGO! SQUAKE I
TRT
RA}
RB
RC
SS
F VALUE
578l.llllllll
ll489.llllllll
227o. 77777778
{ 258.67361111
357.52083333
0.00000000
23.21
57.66
22.o5
5.19
7.18
TRT A VS AVGIB•C)
T~
T C
PR
PR > ITI
-23.93150000
-20.b2500000
-6.07
-4.53
0.0037
0.010b
@
Source
Cows
Periods w/i squares
Treatments (unadj.)
Residual (adj.)
Residual (unadj.)
I'rea tmen ts (adj.)
Error
Corrected Total
>
F
0.0047
0.0009
0.0065
0.084'1
0.0553
T FOR HO:
PAR AMETEk=O
Combining the results of
L
i.
I
5
4
2
2
2
2
-~
17
ss
MS
5781.1111
11489.1111
2276.7778'
616.1944
38.4223
2854.5500
199.2500
20362.4444
1138.3889
308.0972
19.1115
1427.2750
49.8125
S 3 Residual effects (adj. )
= RA + RB + RC
= 258.6736 + 357. 5202 + 0
= 616.1944 with 2 df.
STU EKfWR Of
ESTIMATE
7
3.94542853
4.55576644 ;
and ]) gives the ANOVA table found on page
df
VALUE
0.0023
ESTH4AH
PARAMETER
TRT B VS
TYPE
DF
F
-E6-
These are contrasts among the unadjusted treatment means.
135 of Cochran and Cox;
•
•
A CROSSOVErt DESIGN HHEN THEkE ARE POSSIBLE RESIDUAL EFFECTS
GENEKAL
LIN~AR
~OOELS
:-lEANS
~MuSSOVER
The unadjusted treatment means
TRT
'\j
YIELD
A
B
6
45.1666667
57.5000000
72.6666667
6
6
c
A
PRUCEUUKE
UESIGN WHEN THERe ARE POSSIBLE KESIDUAL EFFECTS
GENERAL LINEAR
~00ELS
PRuCEDUME
LEAST SQJARES MEANS =
TkT
'((ELll
LSMEAi~
A
.. z .4861111
B
56.1111111
76.7361111
c
The treatment means adjusted f8r residual effects
STD f:RR
LSMEAti
PROa > lTI
HO:LSMEAN=O
3.1121960
3.1121960
0.0002
3.1121960
o.ooo1
0.0001
Notice that the adjustments are intuitively pleasing.
-~<7-
•
•
Allen, David M. and Cady,
. .JlY..... Regr·essi on.
Foster B.
( 1982).
Analyzing
.E:-:pel~iment,..?..L
Lifetime Learning Publications, Belmont, CA.
U§.i.~
Aref, Suzanne and Piegorsch, Walter
Data by Regression X SAS:
( 1980) .
Analyzing Experimental
l.f.:!chni cal
Annotated outputs.
p,:tpt:~r-·
BU-705-M in the Biometrics Unit series, Cornell University,
Ithac;:,, N\1 •
Arneson,
Valerie, Firey,
Patricia A. and McCulloch, Charles E.
Statistical methods X SAS.
Brogan,
•
Donna R. and Kutner,
Technical paper BU-664-M in the
Michael H.
( 1980) •
Comparative analyses
of pretest-posttest research designs .
Cochran, William G.
and Cox,
John Wiley,
Gertrude M.
(195'7).
New York.
Grizzle, James E.
The two-period change-over design and
its use in clinical trials.
Meredith, Michael P.
Annotated SAS Output
CASO).
Technical
paper BU-814-M in the Biometrics Unit series, Cornell University,
Ith<::1c:a, N'i'".
SAS Institute,
InstitutE?,
Inc.
( 19B2) •
Inc., Car-·y:, 1\!C:, 584 pp.
Snedecor, George W.
and Cochran, William G.
Iowa State University Press, Ames,
-88-
Iowa.
Download