goptions reset=all border;
title "Study of Height vs Weight";
footnote1 j=l "Source: T. Lewis & L. R. Taylor";
footnote2 j=l "Introduction to Experimental Ecology"
j=r "GPLVRBL1(a) ";
proc gplot data=sashelp.class;
plot height*weight;
run;
footnote1; /* this clears footnote1 */
symbol1 interpol=rcclm95
value=circle
cv=darkred
ci=black
co=blue
width=2;
plot height*weight / haxis=45 to 155 by 10
vaxis=48 to 78 by 6
hminor=1
regeqn;
run;
kids <- read.table("http://www.math.montana.edu/~jimrc/classes/stat408/data/kidsHtWt.txt", head=T)
write.table(kids,file="kidsHtWt.txt",sep="\t", row.names=F)
pairs(kids)
fit1 <- lm( wt ~ ht + age, kids)
par(mfrow=c(2,2)) ## set up for 4 plots per page in 2 rows, 2 columns
plot(fit1)
Plots are used as diagnostics:
DATA kids; infile "kidsHtWt.txt" firstobs=2; input sex $ age :3.1 height weight; ods graphics on; PROC REG; model weight = height age; run;Plots: First column -- like top row in R.
Panel 1 also shows residuals versus predictors.
proc sgplot data= sashelp.class;
scatter x=height y=weight / group=sex;
run;
proc sgplot ;
reg x=height y=weight / CLM CLI;
run;
proc sgplot data=sashelp.class(where=(age<16));
dot age / response=height stat=mean
limitstat=stddev numstd=1;
run;