29.12.2013 Views

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

Base SAS 9.1.3 Procedures Guide - Acsu Buffalo

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The TRANSPOSE Procedure 4 What Types of Transpositions Can PROC TRANSPOSE Perform? 1327<br />

Complex Transposition Using BY Groups<br />

The next example, which uses BY groups, is more complex. The input data set<br />

represents measurements of the weight and length of fish at two lakes. The statements<br />

that create the output data set do the following:<br />

3 transpose only the variables that contain the length measurements<br />

3 create six BY groups, one for each lake and date<br />

3 use a data set option to name the transposed variable.<br />

Output 51.2<br />

A Transposition with BY Groups<br />

Input Data Set 1<br />

L<br />

o L W L W L W L W<br />

c e e e e e e e e<br />

a n i n i n i n i<br />

t D g g g g g g g g<br />

i a t h t h t h t h<br />

o t h t h t h t h t<br />

n e 1 1 2 2 3 3 4 4<br />

Cole Pond 02JUN95 31 0.25 32 0.30 32 0.25 33 0.30<br />

Cole Pond 03JUL95 33 0.32 34 0.41 37 0.48 32 0.28<br />

Cole Pond 04AUG95 29 0.23 30 0.25 34 0.47 32 0.30<br />

Eagle Lake 02JUN95 32 0.35 32 0.25 33 0.30 . .<br />

Eagle Lake 03JUL95 30 0.20 36 0.45 . . . .<br />

Eagle Lake 04AUG95 33 0.30 33 0.28 34 0.42 . .<br />

Fish Length Data for Each Location and Date 2<br />

Location Date _NAME_ Measurement<br />

Cole Pond 02JUN95 Length1 31<br />

Cole Pond 02JUN95 Length2 32<br />

Cole Pond 02JUN95 Length3 32<br />

Cole Pond 02JUN95 Length4 33<br />

Cole Pond 03JUL95 Length1 33<br />

Cole Pond 03JUL95 Length2 34<br />

Cole Pond 03JUL95 Length3 37<br />

Cole Pond 03JUL95 Length4 32<br />

Cole Pond 04AUG95 Length1 29<br />

Cole Pond 04AUG95 Length2 30<br />

Cole Pond 04AUG95 Length3 34<br />

Cole Pond 04AUG95 Length4 32<br />

Eagle Lake 02JUN95 Length1 32<br />

Eagle Lake 02JUN95 Length2 32<br />

Eagle Lake 02JUN95 Length3 33<br />

Eagle Lake 02JUN95 Length4 .<br />

Eagle Lake 03JUL95 Length1 30<br />

Eagle Lake 03JUL95 Length2 36<br />

Eagle Lake 03JUL95 Length3 .<br />

Eagle Lake 03JUL95 Length4 .<br />

Eagle Lake 04AUG95 Length1 33<br />

Eagle Lake 04AUG95 Length2 33<br />

Eagle Lake 04AUG95 Length3 34<br />

Eagle Lake 04AUG95 Length4 .<br />

For a complete explanation of the <strong>SAS</strong> program that produces these results, see<br />

Example 4 on page 1340.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!