5: Analyzing and Reporting Data Flashcards
title1 ‘The First Line’;
title2 ‘The Second Line’;
proc print data=sales;
run;
title2 ‘The Next Line’;
proc print data=sales;
run;
title ‘The Top Line’;
proc print data=sales;
run;
a. The Top Line
b. The Top Line The Next Line
c. The Top Line The Second Line
d. The Top Line The First Line The Next Line
A TITLE is the same as TITLE1. The TITLE statement for the last PROC PRINT step cancels all the higher TITLEn statements.
Which statement substitutes the value of the macro variable Year in the footnote? %let Year=2018; a. footnote ‘year Sales’; b. footnote ‘&year Sales’; c. footnote “%year Sales”; d. footnote “&year Sales”;
D To reference a macro variable, use the & followed by the name of the macro variable (for example, &YEAR). The macro variable must be in double quotation marks in the FOOTNOTE statement in order for the value to be substituted. If single quotation marks are used, the value is not substituted.
Which statement is true based on the given program? data baseball2; set sashelp.baseball; BatAvg=CrHits/CrAtBat; label BatAvg=”Batting Average”; run; proc print data=baseball2; var Name Team BatAvg; run; proc means data=baseball2; var BatAvg; class Team; run; a. The column BatAvg will have a permanent label in the sashelp.baseball data set. b. The label for BatAvg will appear in the PROC PRINT report. c. The label for BatAvg will appear in the PROC MEANS report. d. The label for BatAvg will appear in both reports.
C The label will appear in the PROC MEANS report. The label will not appear in the PROC PRINT report because the LABEL option is missing in the PROC PRINT statement. The output table work.baseball2 (not the input table sashelp.baseball) contains a permanent label for BatAvg.
Which statement is true regarding a BY statement in a reporting procedure such as PROC PRINT? a. The BY statement is responsible for sorting the table. b. Only one column can be specified in the BY statement. c. The BY statement groups the report by the specified columns. d. The BY statement must be the first statement after the PROC statement.
C The BY statement in a reporting procedure is responsible for grouping the report by the specified columns. One or multiple columns can be in the BY statement. The BY statement can be placed in any order within a PROC step. The BY statement in PROC SORT is responsible for sorting the table.
Which statement is false concerning the FREQ procedure? a. The NOPROCTITLE option can be placed in the PROC FREQ statement to remove the procedure title The FREQ Procedure. b. The ORDER=FREQ option can be placed in the PROC FREQ statement to display the column values in descending frequency count order. c. The PLOTS= option can be placed in the TABLES statement after the forward slash to create bar charts based on counts or percentages. d. The OUT= option can be placed in the TABLES statement after the forward slash to create a table containing counts and percentages.
A The NOPROCTITLE option goes in a global ODS statement to remove the procedure title.
Which PROC FREQ step creates the results shown here? Number of Variable Levels Variable Levels Region 10 Region Frequency Percent Africa 56 14.18 Asia 14 3.54 Canada 37 9.37 Central America/Caribbean 32 8.10 Eastern Europe 31 7.85 Middle East 24 6.08 Pacific 45 11.39 South America 54 13.67 United States 40 10.13 Western Europe 62 15.70 a. proc freq data=sashelp.shoes; tables Region nocum; run; b. proc freq data=sashelp.shoes levels; tables Region / nocum; run; c. proc freq data=sashelp.shoes nlevels; tables Region / nocum; run; d. proc freq data=sashelp.shoes / levels; tables Region nocum; run;
C The NLEVELS option in the PROC MEANS statement creates a table displaying the number of levels for all TABLES columns. The NOCUM option in the TABLES statement, which goes after the forward slash, suppresses the display of cumulative frequencies and cumulative percentages.
Which report is created from the following PROC FREQ step? proc freq data=sashelp.cars; where Cylinders in (4,6) and Type in (‘Sedan’,’SUV’); tables Type*Cylinders / nocol norow crosslist; run;
C NOCOL removes the Column Percent, NOROW removes the Row Percent, and CROSSLIST displays statistic values in columns instead of stacked in a cell.
Which statement is true concerning the MEANS procedure? a. The VAR statement is required and identifies the analysis columns. b. The WAYS statement specifies the number of ways to make unique combinations of class columns. c. The MAXDEC= option is used in the VAR statement to specify the number of decimal places for the statistics. d. The _COUNT_ and _FREQ_ columns are automatically included in the output summary table that is produced by the OUT= option of the OUTPUT statement.
B The WAYS statement specifies the number of ways to make unique combinations of class variables. The VAR statement is not required. The MAXDEC= option goes in the PROC MEANS statement. _FREQ_ and _TYPE_ are automatically included in the output summary table.
An input table must be pre-sorted by the column(s) listed in the CLASS statement of a PROC MEANS step. proc means data=sashelp.heart; var Cholesterol; class Weight_Status; run; a. True b. False
B The input table does not have to be pre-sorted by the column(s) in the CLASS statement of the PROC MEANS step. If a BY statement is used instead of a CLASS statement, the columns need to be sorted.
Which statement from PROC MEANS contains valid syntax for creating a summary output table? a. out=work.summary mean; b. out work.summary mean(Weight)=TotW; c. output out work.summary Weight=TotW; d. output out=work.summary mean(Weight)=TotW;
D The OUTPUT statement writes statistics to an output table. The OUT= option names the output table. Statistic(input-variable)=output-variable can be specified in the OUTPUT statement.