Form of the freq procedure to create a crosstabular

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: value money low-<25000 ='Less than 25,000' 25000-50000='25,000 to 50,000' 50000<-high='More than 50,000'; run; proc freq data=crew; tables JobCode*Salary; format JobCode $codefmt. Salary money.; title 'Salary Distribution by Job Codes'; run; PROC FREQ DATA=SAS-data-set; TABLES variable1*variable2; RUN; 21 Crosstabular Frequency Reports Crosstabular Frequency Reports Salary Distribution by Job Codes The FREQ Procedure To display the crosstabulation results in a listing form, add the CROSSLIST option to the TABLES statement. Table of JobCode by Salary JobCode Salary ‚ ‚ ‚ ‚Less tha‚25,000 t‚More tha‚ Total ‚n 25,000‚o 50,000‚n 50,000‚ ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ Flight Attendant ‚ 5‚ 39 ‚ 0‚ 44 ‚ 7.25 ‚ 56.52 ‚ 0.00 ‚ 63.77 ‚ 11.36 ‚ 88.64 ‚ 0.00 ‚ ‚ 100.00 ‚ 100.00 ‚ 0.00 ‚ ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ Pilot ‚ 0‚ 0‚ 25 ‚ 25 ‚ 0.00 ‚ 0.00 ‚ 36.23 ‚ 36.23 ‚ 0.00 ‚ 0.00 ‚ 100.00 ‚ ‚ 0.00 ‚ 0.00 ‚ 100.00 ‚ ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆƒƒƒƒƒƒƒƒˆ Total 5 39 25 69 7.25 56.52 36.23 100.00 22 Frequency Percent Row Pct Col Pct proc freq data=crew; tables JobCode*Location / crosslist; title 'Location Distribution for Job Codes'; run; 23 24 6 Crosstabular Frequency Reports Partial Output Location Distribution for Job Codes The FREQ Procedure Lab Exercises 15 Table of JobCode by Location Job Row Column Code Location Frequency Percent Percent Percent ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ FLTAT1 CARY 5 7.25 35.71 18.52 FRANKFURT 4 5.80 28.57 21.05 LONDON 5 7.25 35.71 21.74 Exercises 1 & 2 Creating Frequency Reports Validating Data with PROC FREQ Total 14 20.29 100.00 ------------------------------------------------------------FLTAT2 CARY 7 10.14 38.89 25.93 FRANKFURT 5 7.25 27.78 26.32 LONDON 6 8.70 33.33 26.09 Total 18 26.09 100.00 ------------------------------------------------------------25 26 Calculating Summary Statistics Business Task •The MEANS procedure displays simple descriptive statistics for the numeric variables in a SAS data set. International Airlines wants to determine the minimum, maximum, and average salary for each job code. •General form of a simple PROC MEANS step: PROC MEANS DATA=SAS-data-set; RUN; •Example: proc means data=crew; title 'Salary Analysis'; run; 27 28 7 Calculating Summary Statistics Calculating Summary Statistics By default, PROC MEANS Salary Analysis – analyzes every numeric variable in the SAS data set – prints the statistics N, MEAN, STD, MIN, and MAX – excludes missing values before calculating statistics. The MEANS Procedure Variable N Mean Std Dev Minimum Maximum ƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒƒ...
View Full Document

This note was uploaded on 09/25/2013 for the course STAT 440 taught by Professor Muyot,m during the Fall '08 term at University of Illinois, Urbana Champaign.

Ask a homework question - tutors are online