DATABASE-"G:\LR\OTHER__LR_DATA\Criteria_work\chlorophyll\2010\j ames river.mdb" 
/ 
*RUN; 
* PROC CONTENTS DATA=ALGAE.JAMES_SUMMER_CHL; RUN; 
data one; 
set ALGAE.JAMES_SUMMER_CHL; 
logE_Chl=log(reported_value); 
label 
logE 
_Chl = " 
L0G_E UG/LITER" 
/ 
if 
cbseg 
2003 
= 
"APPTF" 
or 
cbseg 
2003 
= 
"CHKOH" 
or 
cbseg 
2003 
= 
"EBEMH" 
or 
cbseg 
'2003 
= 
"LAFMH" 
or 
cbseg 
'2003 
= 
"WBEMH" 
then 
delete; 
if 
cbseg 
2003 
= 
"JMSPH" 
then 
SegGrp = 1; 
if 
cbseg 
_2 0 03 
= 
"JMSMH" 
or 
cbseg 
[2003 
= 
"SBEMH" 
then 
SegGrp = 2; 
if 
cbseg 
_2 003 
= 
"JMSOH" 
or 
cbseg 
2003 
= 
"CB8PH" 
or 
cbseg 
_2 0 03 
= 
"ELIPH" 
then 
SegGrp = 3; 
if 
cbseg 
2003 
= 
"JMSTF" 
then 
SegGrp = 4 ; 
sdate = DatePart(SAMPLE_DATE); 
year = year(SDATE); 
RUN; 
*Proc Contents; 
run ; 
title "Summer James River Data 1991-2000"; 
proc glm data=one; 
class year cbseg_2003; 
model logE_Chl=year cbseg_2003; 
output out= reschl r=rchl; 
run ; 
proc Univariate normal plot data=work.reschl; 
title2 "Normality test on raw residuals"; 
var rchl; 
run; 
*( step to get rid of heterogeneous variances; 
Proc Sort data=reschl; 
by SegGrp year; 
run ; 
Proc Means data=reschl noprint; 
by SegGrp year; 
var rchl; 
output out=sdchl StdDev = sdchl n=n; 
run; 
*(proc print data=sdchl; 
*( title "standard deviation results"; 
*( var SegGrp year sdchl n; 
data ResChl; 
merge ResChl sdchl; 
by SegGrp year; 
StdResChl = rchl/sdchl; 
run; 
proc Univariate normal plot data=work.reschl; 
title2 "Normality test on standardized residuals"; 
59 
