lesson08 - Lesson 8 - Topics Creating SAS datasets from...

Info iconThis preview shows pages 1–9. Sign up to view the full content.

View Full Document Right Arrow Icon
Lesson 8 - Topics Creating SAS datasets from procedures Using several data steps to make reports Using PROC RANK Programs 15-16 in course notes LSB 4:10;5:3
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Making SAS Datasets From Procedures Output from SAS PROCs can be put into SAS datasets: 1. To do further processing of the information from the output 2. To reformat output to make a report 3. To restructure original SAS dataset or create new variables
Background image of page 2
Ways to Put Output into SAS Datasets Using OUTPUT statement available from many procedures Using ODS OUTPUT statement – any piece of output can be put into a SAS dataset
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Report We Want to Generate Quartiles of Weight by Gender and Center sex clinic N P25 P50 P75 Male A 9 180.0 190.0 208.0 Male B 16 158.3 174.8 218.3 Male C 29 178.0 199.5 220.5 Male D 11 172.0 184.5 194.0 Female A 6 125.0 143.5 160.5 Female B 9 150.0 164.5 184.0 Female C 6 132.5 134.3 138.5 Female D 6 131.0 137.5 148.5
Background image of page 4
Program 15 LIBNAME class ‘C:\SAS_Files' ; PROC FORMAT ; VALUE sexfmt 1 = 'Male' 2 = 'Female' ; * Will use SAS dataset version of TOMHS data; DATA wt; SET class.tomhsp ( KEEP =ptid clinic sex wtbl wt12); wtchg = wt12 - wtbl; FORMAT sex sexfmt. ; RUN ;
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Create report by sex and clinic of univariate info; PROC SORT DATA = wt; BY sex clinic; PROC UNIVARIATE DATA = wt NOPRINT ; BY sex clinic; VAR wt12 ; OUTPUT OUT =univinfo N = n Q1 = p25 MEDIAN = p50 Q3 = P75 ; Dataset univinfo will have one observation for each combination of sex and clinic. Statistic name = variable name Name of new dataset
Background image of page 6
PROC PRINT DATA = univinfo; RUN ; Obs sex clinic n p75 p50 p25 1 Male A 9 208.00 190.00 180.00 2 Male B 16 218.25 174.75 158.25 3 Male C 29 220.50 199.50 178.00 4 Male D 11 194.00 184.50 172.00 5 Female A 6 160.50 143.50 125.00 6 Female B 9 184.00 164.50 150.00 7 Female C 6 138.50 134.25 132.50 8 Female D 6 148.50 137.50 131.00
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
PROC PRINT DATA = univinfo NOOBS ; VAR sex clinic n p25 p50 p75; FORMAT p25 p50 p75 6.1 ; TITLE 'Quartiles of Weight by Gender/Center' ; RUN ; Quartiles of Weight by Gender and Center sex clinic N P25 P50 P75 Male A 9 180.0 190.0 208.0 Male B 16 158.3 174.8 218.3 Male C 29 178.0 199.5 220.5 Male D 11 172.0 184.5 194.0 Female A 6 125.0 143.5 160.5 Female B 9 150.0 164.5 184.0 Female C 6 132.5 134.3 138.5 Female D 6 131.0 137.5 148.5
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/21/2011 for the course PUBH 6420 taught by Professor Greggrandis during the Fall '11 term at University of Florida.

Page1 / 26

lesson08 - Lesson 8 - Topics Creating SAS datasets from...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online