The Essentials of Biostatistics for Physicians, Nurses, and Clinicians

(Ann) #1
114 CHAPTER 7 Correlation, Regression, and Logistic Regression

run;

proc reg;
model buchanan = nader bush gore;
run;

proc reg;
model buchanan = nader bush;
run;

proc reg;
model buchanan = nader bush nbinter;
run;

The data statement at the beginning creates the SAS data set
“ fl orida, ” with “ county ” as a character variable, which is indicated by
“ $ ” after it in the input statement, and “ gore, bush, buchanan and nader ”
as numerical variables representing the vote totals for that candidate in
the given county. The input statement tells how to assign the data that
will be read. The cards statement indicates that the data read according
to the input statement is to follow. The symbol “ ; ” at the end of the
data indicates the completion of reading the data. The statement “ run ”
indicates the fi nish of the data step.
The next statement is a new data step used to modify the original
data set. The set statement means to copy the data set fl orida into
fl orid2. The “ if statement ” deletes the line corresponding to Palm Beach
county, so that the model will be constructed without including Palm
Beach. The statement “ nbinter = nadir * bush ” creates a variable equal
to the product of Nader ’ s total with Bush ’ s total. This variable will be
used as the interaction term in the third regression.
The fi rst regression generates model 1, where we can test the sig-
nifi cance of Gore ’ s total when included with Bush and Nader. This is
part of the standard SAS output for this procedure. The second regres-
sion is for the model that includes Bush and Nader ’ s votes only to
predict Buchanan ’ s total. The third regression incorporates an interac-
tion term between Bush and Nader.
The output is now presented in bold face, as follows:

Free download pdf