survey - proc format; value $gender 'M' = 'Male' 'F' =...

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

View Full Document Right Arrow Icon
dm 'log;clear;output;clear;'; options ps=50 ls=75 pageno=1; o *********************************************************************; ** **; ** COURSE: STAT 6360 **; ** PURPOSE: Show how to summarize your data set (proc freq) **; *********************************************************************; *The following title will appear as the first line of every page in the output window; title1 'STAT 6360'; t *Data set SURVEY; data sasdata.survey; infile 'K:\6360\SASdata\survey.txt'; input @1 ID $3. @5 Gender $1. @7 Age 2. @10 Salary dollar7.0 @17 Ques1 $1. @19 Ques2 $1. @21 Ques3 $1. @23 Ques4 $1. @25 Ques5 $1. ; label ID = 'Subject ID' Gender = 'Gender' Age = 'Age as of 1/1/2006' Salary = 'Yearly Salary' Ques1 = 'The governor doing a good job?' Ques2 = 'The property tax should be lowered' Ques3 = 'Guns should be banned' Ques4 = 'Expand the Green Acre program' Ques5 = 'The school needs to be expanded'; run; r proc print data= sasdata.survey; run; r * Using PROC FORMAT to create user-defined formats;
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: proc format; value $gender 'M' = 'Male' 'F' = 'Female' ' ' = 'Not entered' other = 'Miscoded'; value age low-29 = 'Less than 30' 30-50 = '30 to 50' 51-high = '51+'; value $likert '1' = 'Strongly disagree' '2' = 'Disagree' '3' = 'No opinion' '4' = 'Agree' '5' = 'Strongly agree'; run; r *Adding a FORMAT statement in PROC PRINT; title2 "Data Set SURVEY with Formatted Values"; proc print data=sasdata.survey; id ID; var Gender Age Salary Ques1-Ques5; format Gender $gender. Age age. Ques1-Ques5 $likert. Salary dollar11.; run; r title "PROC FREQ with all the Defaults"; proc freq data=sasdata.survey; format Gender $gender. Age age. Ques1-Ques5 $likert. Salary dollar11.2; run; r title2 "Adding a TABLES statement to PROC FREQ"; proc freq data=sasdata.survey; tables Gender Ques1 / nocum; format Gender $gender. Ques1 $likert.; run; r...
View Full Document

This note was uploaded on 06/06/2011 for the course STAT 4360 taught by Professor Park during the Spring '11 term at University of Georgia Athens.

Page1 / 2

survey - proc format; value $gender 'M' = 'Male' 'F' =...

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

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