Stats 124 Final Review

Beschreibung

SAS Basic Programming Multiple Choice
James Blair
Quiz von James Blair, aktualisiert more than 1 year ago
James Blair
Erstellt von James Blair vor mehr als 9 Jahre
281
0

Zusammenfassung der Ressource

Frage 1

Frage
See image
Antworten
  • 3 Observations, 4 Variables
  • 3 Observations, 3 Variables
  • 4 Observations, 3 Variables
  • Can't tell because some values are missing

Frage 2

Frage
How many program steps are executed when the program below is processed? data user.tables; infile jobs; input date name $ job $; run; proc sort data = user.tables; by name; run; proc print data = user.tables; run; SAS Institute (2011-08-08). SAS Certification Prep Guide: Base Programming for SAS 9, Third Edition (Kindle Locations 13475-13478). SAS Institute/SAS Publishing. Kindle Edition.
Antworten
  • three
  • four
  • five
  • six

Frage 3

Frage
See Image
Antworten
  • numeric
  • character
  • can be either character or numeric
  • can't tell from the data shown

Frage 4

Frage
See image
Antworten
  • numeric
  • character
  • can be either character or numeric
  • can't tell from the data shown

Frage 5

Frage
Which of the following variable names is valid
Antworten
  • 4BirthDate
  • $Cost
  • _Items_
  • Tax-Rate

Frage 6

Frage
Which of the following files is a permanent SAS file?
Antworten
  • Sashelp.PrdSale
  • Sasuser.MySales
  • Profits.Quarter1
  • all the above

Frage 7

Frage
In a DATA step, how can you reference a temporary SAS data set named Forecast?
Antworten
  • Forecast
  • Work.Forecast
  • Sales.Forecast (after assigning the liberef Sales)
  • A and B

Frage 8

Frage
See image
Antworten
  • 5
  • 6
  • 7
  • 8

Frage 9

Frage
How many statements does the following SAS program contain? proc print data = new.prodsale label double; var state day price1 price2; where state =' NC'; label state =' Name of State'; run;
Antworten
  • three
  • four
  • five
  • six

Frage 10

Frage
What is a SAS library?
Antworten
  • collection of SAS files, such as SAS data sets and catalogs
  • in some operating environments, a physical collection of SAS files
  • a group of SAS files in the same folder or directory.
  • all the above

Frage 11

Frage
If you submit the following program, how does the output look? options pagesize = 55 nonumber; proc tabulate data = clinic.admit; class actlevel; var age height weight; table actlevel, ( age height weight)* mean; run; options linesize = 80; proc means data = clinic.heart min max maxdec = 1; var arterial heart cardiac urinary; class survive sex; run;
Antworten
  • The PROC MEANS output has a print line width of 80 characters, but the PROC TABULATE output has no print line width.
  • The PROC TABULATE output has no page numbers, but the PROC MEANS output has page numbers
  • Each page of output from both PROC steps is 55 lines long and has no page numbers, and the PROC MEANS output has a print line width of 80 characters.
  • The date does not appear on output from either PROC step.

Frage 12

Frage
How can you create SAS output in HTML format on any SAS platform?
Antworten
  • by specifying system options
  • by using programming statements
  • by using SAS windows to specify the result format
  • you can't create HTML output on all SAS platforms

Frage 13

Frage
In order for the date values 05May1955 and 04Mar2046 to be read correctly, what value must the YEARCUTOFF = option have?
Antworten
  • A value between 1947 and 1954, inclusive
  • 1955 of higher
  • 1946 or higher
  • any value

Frage 14

Frage
When you specify an engine for a library, you always specify
Antworten
  • the file format for files that are stored in the library
  • the version of SAS you are using
  • access to other software vendors' files
  • instructions for creating temporary SAS files

Frage 15

Frage
Which statement prints a summary of all the files stored in the library named Area51?
Antworten
  • proc contents data=Area51._all_ nods;
  • proc contents data=Area51 _all_ nods;
  • proc contents data=Area51 _all_ noobs
  • proc contents data=Area51 _all_.nods;

Frage 16

Frage
See image.
Antworten
  • OBS=, DATE, and NONUMBER
  • NUMBER, PAGENO=1, and DATE
  • NUMBER and DATE only
  • none of the above

Frage 17

Frage
Which of the following programs correctly references a SAS data set named SalesAnalysis that is stored in a permanent SAS library?
Antworten
  • data saleslibrary.salesanalysis; set mydata.quarter1sales; if sales > 100000; run;
  • data mysales.totals; set sales_99. salesanalysis; if totalsales > 50000; run;
  • aproc print data = salesanalysis.quarter1; var sales salesrep month; run;
  • proc freq data = 1999data.salesanalysis; t ables quarter* sales; run;

Frage 18

Frage
Which time span is used to interpret two-digit year values if the YEARCUTOFF = option is set to 1950?
Antworten
  • 1950-2049
  • 1950-2050
  • 1949-2050
  • 1950-2000

Frage 19

Frage
Assuming you are using SAS code and not special SAS windows, which one of the following statements is false?
Antworten
  • LIBNAME statements can be stored with a SAS program to reference the SAS library automatically when you submit the program.
  • When you delete a libref, SAS no longer has access to the files in the library. However, the contents of the library still exist on your operating system.
  • Librefs can last from one SAS session to another.
  • You can access files that were created with other vendors' software by submitting a LIBNAME statement.

Frage 20

Frage
What does the following statement do? libname osiris spss 'c:\ myfiles\ sasdata\ data.spss';
Antworten
  • defines a library called Spss using the OSIRIS engine
  • defines a library called Osiris using the SPSS engine
  • defines two libraries called Osiris and Spss using the default engine
  • defines the default library using the OSIRIS and SPSS engines

Frage 21

Frage
As you write and edit SAS programs it's a good idea to
Antworten
  • begin DATA and PROC steps in column one
  • indent statements within a step
  • begin RUN statements in column one
  • all the above

Frage 22

Frage
Suppose you have submitted a SAS program that contains spelling errors. Which set of steps should you perform, in the order shown, to revise and resubmit the program?
Antworten
  • Correct the errors. Clear the Log window. Resubmit the program. Check the Log window.
  • Correct the errors. Resubmit the program. Check the Output window. Check the Log window.
  • Correct the Errors. Clear the Log window. Resubmit the program. Check the Output window.
  • Correct the errors. Clear the Output window. Resubmit the program. Check the Output window.

Frage 23

Frage
What happens if you submit the following program? proc sort data = clinic.stress out = maxrates; by maxhr; run; proc print data = maxrates label double noobs; label rechr =' Recovery Heart Rate; var resthr maxhr rechr date; where toler =' I' and resthr > 90; sum fee; run;
Antworten
  • Log messages indicate that the program ran successfully
  • A “PROC SORT running” message appears at the top of the active window, and a log message may indicate an error in a statement that seems to be valid.
  • A log message indicates that an option is not valid or not recognized.
  • A “PROC PRINT running” message appears at the top of the active window, and a log message may indicate that a quoted string has become too long or that the statement is ambiguous.

Frage 24

Frage
What generally happens when a syntax error is detected?
Antworten
  • SAS continues processing the step
  • SAS continues to process the step, and the Log window displays messages about the error
  • SAS stops processing the step in which the error occurred and the Log window displays messages about the error
  • SAS stops processing the step in which the error occurred, and the Output window displays messages about the error.

Frage 25

Frage
A syntax error occurs when
Antworten
  • Some data values are not appropriate for the SAS statements that are specified in a program.
  • the form of the elements in a SAS statement is correct, but the elements are not valid for that usage.
  • program statements do not conform to the rules of the SAS language.
  • none of the above

Frage 26

Frage
How can you tell whether you have specified an invalid option in a SAS program?
Antworten
  • A log message indicates an error in a statement that seems to be valid.
  • A log message indicates that an option is not valid or not recognized.
  • The message “PROC running” or “DATA step running” appears at the top of the active window.
  • You can't tell until you view the output from the program.

Frage 27

Frage
Which of the following programs contains a syntax error?
Antworten
  • proc sort data = sasuser.mysales; by region; run;
  • dat sasuser.mysales; set mydata.sales99; run;
  • proc print data = sasuser.mysales label; label region =' Sales Region'; run;
  • none of the above

Frage 28

Frage
What should you do after submitting the following program in the Windows or UNIX operating environment? proc print data = mysales; where state =' NC; run;
Antworten
  • Submit a RUN statement to complete the PROC step.
  • Recall the program. Then add a quotation mark and resubmit the corrected program.
  • Cancel the submitted statements. Then recall the program, add a quotation mark, and resubmit the corrected program
  • Recall the program. Then replace the invalid option and resubmit the corrected program.

Frage 29

Frage
Which of the following commands opens a file in the code editing window?
Antworten
  • file 'd:\ programs\ sas\ newprog.sas'
  • include 'd:\ programs\ sas\ newprog.sas'
  • open 'd:\ programs\ sas\ newprog.sas'
  • all of the above

Frage 30

Frage
Suppose you submit a short, simple DATA step. If the active window displays the message “DATA step running” for a long time, what probably happened?
Antworten
  • You misspelled a keyword
  • You forgot to end the DATA step with a RUN statement
  • You specified an invalid data set option
  • Some data values weren't appropriate for the SAS statements that you specified.

Frage 31

Frage
See image
Antworten
  • proc print data = flights.laguardia noobs; var on changed flight; where on > = 160; run;
  • proc print data = flights.laguardia; var date on changed flight; where changed > 3; run;
  • proc print data = flights.laguardia label; id date; var boarded transferred flight; label boarded =' On' transferred =' Changed'; where flight =' 219'; run;
  • proc print flights.laguardia noobs; id date; var date on changed flight; where flight =' 219'; run;

Frage 32

Frage
Which of the following PROC PRINT steps is correct if labels are not stored with the data set?
Antworten
  • proc print data = allsales.totals label; label region8 =' Region 8 Yearly Totals'; run;
  • proc print data = allsales.totals; label region8 =' Region 8 Yearly Totals'; run;
  • proc print data allsales.totals label noobs; run;
  • proc print allsales.totals label; run;

Frage 33

Frage
Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY?
Antworten
  • where style =' RANCH' or 'SPLIT' or 'TWOSTORY';
  • where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
  • where style in (RANCH, SPLIT, TWOSTORY);
  • where style in (' RANCH',' SPLIT',' TWOSTORY');

Frage 34

Frage
If you want to sort your data and create a temporary data set named Calc to store the sorted data, which of the following steps should you submit?
Antworten
  • proc sort data = work.calc out = finance.dividend; run;
  • proc sort dividend out = calc; by account; run;
  • proc sort data = finance.dividend out = work.calc; by account; run;
  • proc sort from finance.dividend to calc; by account; run;

Frage 35

Frage
See image.
Antworten
  • the DATE system option and the LABEL option in PROC PRINT
  • the DATE and NONUMBER system options and the DOUBLE and NOOBS options in PROC PRINT
  • the DATE and NONUMBER system options and the DOUBLE option in PROC PRINT
  • the DATE and NONUMBER system options and the NOOBS option in PROC PRINT

Frage 36

Frage
Which of the following statements can you use in a PROC PRINT step to create this output?
Antworten
  • var month instructors; sum instructors aerclass walkjogrun swim;
  • var month; sum instructors aerclass walkjogrun swim;
  • var month instructors aerclass; sum instructors aerclass walkjogrun swim;
  • all the above

Frage 37

Frage
What happens if you submit the following program? proc sort data = clinic.diabetes; run; proc print data = clinic.diabetes; var age height weight pulse; where sex =' F'; run
Antworten
  • The PROC PRINT step runs successfully, printing observations in their sorted order.
  • The PROC SORT step permanently sorts the input data set.
  • The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
  • The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.

Frage 38

Frage
If you submit the following program, which output does it create? proc sort data = finance.loans out = work.loans; by months amount; run; proc print data = work.loans noobs; var months; sum amount payment; where months < 360; run;
Antworten

Frage 39

Frage
Choose the statement below that selects rows in which the amount is less than or equal to $ 5000 the account is 101-1092 or the rate equals 0.095.
Antworten
  • where amount < = 5000 and account =' 101-1092' or rate = 0.095;
  • where (amount le 5000 and account =' 101-1092') or rate = 0.095;
  • where amount < = 5000 and (account =' 101-1092' or rate eq 0.095);
  • where amount < = 5000 or account =' 101-1092' and rate = 0.095;

Frage 40

Frage
What does PROC PRINT display by default?
Antworten
  • PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.
  • PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.
  • PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables.
  • PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.

Frage 41

Frage
Which SAS statement associates the fileref Crime with the raw data file C:\ States\ Data\Crime.dat?
Antworten
  • filename crime 'c:\ states\ data\ crime.dat';
  • filename crime c:\ states\ data\ crime.dat;
  • fileref crime 'c:\ states\ data\ crime.dat';
  • filename 'c:\ states\ data\ crime' crime.dat;

Frage 42

Frage
Filerefs remain in effect until . . .
Antworten
  • You change them
  • You cancel them
  • you end your SAS session
  • all the above

Frage 43

Frage
Which statement identifies a raw data file to be read with the fileref Products and specifies that the DATA step read only records 1-15?
Antworten
  • infile products obs 15;
  • infile products obs = 15;
  • input products obs = 15;
  • input products 1-15;

Frage 44

Frage
Which of the following programs correctly writes the observations from the data set below to a raw data file?
Antworten
  • data _null_; set work.patients; infile 'c:\ clinic\ patients\ referals.dat'; input id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20; run;
  • data referals.dat; set work.patients; input id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20; run;
  • data _null_; set work.patients; file c:\ clinic\ patients\ referals.dat; put id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20; run;
  • data _null_; set work.patients; file 'c:\ clinic\ patients\ referals.dat'; put id 1-4 sex 6 age 8-9 height 11-12 weight 14-16 pulse 18-20; run;

Frage 45

Frage
Which raw data file can be read using column input?
Antworten

Frage 46

Frage
See image
Antworten
  • data work.salesrep; infile empdata; input ID $ 1-4 LastName $ 6-12 FirstName $ 14-18 City $ 20-29; run; proc print data = work.salesrep; run;
  • data work.salesrep; infile empdata; input ID $ 1-4 Name $ 6-12 FirstName $ 14-18 City $ 20-29; run; proc print data = work.salesrep; run;
  • data work.salesrep; infile empdata; input ID $ 1-4 name1 $ 6-12 name2 $ 14-18 City $ 20-29; run; proc print data = work.salesrep; run;
  • All the above

Frage 47

Frage
See image
Antworten
  • input StockNumber $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 27-32;
  • input StockNumber $ 1-3 Price 27-32 Item $ 20-24 Finish $ 5-9 Style $ 11-18;
  • input $ StockNumber 1-3 Price 27-32 $ Item 20-24 $ Finish 5-9 $ Style 11-18;
  • input StockNumber $ 1-3 Price $ 27-32 Item $ 20-24 Finish $ 5-9 Style $ 11-18;

Frage 48

Frage
Which statement correctly re-defines the values of the variable Income as 100 percent higher?
Antworten
  • income = income* 1.00;
  • income = income +( income* 2.00);
  • income = income* 2;
  • income =* 2;

Frage 49

Frage
Which program correctly reads instream data?
Antworten
  • data finance.newloan; input datalines; if country =' JAPAN'; MonthAvg = amount/ 12; 1998 US CARS 194324.12 1998 US TRUCKS 142290.30 1998 CANADA CARS 10483.44 1998 CANADA TRUCKS 93543.64 1998 MEXICO CARS 22500.57 1998 MEXICO TRUCKS 10098.88 1998 JAPAN CARS 15066.43 1998 JAPAN TRUCKS 40700.34 ;
  • data finance.newloan; input Year 1-4 Country $ 6-11 Vehicle $ 13-18 Amount 20-28; if country =' JAPAN'; MonthAvg = amount/ 12; datalines; run;
  • data finance.newloan; input Year 1-4 Country 6-11 Vehicle 13-18 Amount 20-28; if country =' JAPAN'; MonthAvg = amount/ 12; datalines; 1998 US CARS 194324.12 1998 US TRUCKS 142290.30 1998 CANADA CARS 10483.44 1998 CANADA TRUCKS 93543.64 1998 MEXICO CARS 22500.57 1998 MEXICO TRUCKS 10098.88 1998 JAPAN CARS 15066.43 1998 JAPAN TRUCKS 40700.34 ;
  • data finance.newloan; input Year 1-4 Country $ 6-11 Vehicle $ 13-18 Amount 20-28; if country =' JAPAN'; MonthAvg = amount/ 12; datalines; 1998 US CARS 194324.12 1998 US TRUCKS 142290.30 1998 CANADA CARS 10483.44 1998 CANADA TRUCKS 93543.64 1998 MEXICO CARS 22500.57 1998 MEXICO TRUCKS 10098.88 1998 JAPAN CARS 15066.43 1998 JAPAN TRUCKS 40700.34 ;

Frage 50

Frage
Which SAS statement subsets the raw data shown below so that only the observations in which Sex (in the second field) has a value of F are processed?
Antworten
  • if sex = f;
  • if sex = F;
  • if sex =' F';
  • a or b

Frage 51

Frage
Which of the following is not created during the compilation phase?
Antworten
  • a. the data set descriptor
  • b. the first observation
  • c. the program data vector
  • d. the _N_and_ERROR_ automatic variables

Frage 52

Frage
During the compilation phase, SAS scans each statement in the DATA step, looking for syntax errors. Which of the following is not considered a syntax error?
Antworten
  • a. incorrect values and formats
  • b. invalid options or variable names
  • c. missing or invalid punctuation
  • d. missing or misspelled keywords

Frage 53

Frage
Unless otherwise directed, the DATA step executes...
Antworten
  • a. once for each compilation phase.
  • b. once for each DATA step statement
  • c. once for each record in the input file
  • d. once for each variable in the input file

Frage 54

Frage
At the beginning of the execution phase, the value of _N_ is 1, the value of _ERROR_ is 0, and the values of the remaining variables are set to:
Antworten
  • a. 0
  • b. 1
  • c. undefined
  • d. missing

Frage 55

Frage
Suppose you run a program that causes three DATA errors. What is the value of the automatic variable _ERROR_ when the observation that contains the third error is processed?
Antworten
  • a. 0
  • b. 1
  • c. 2
  • d. 3

Frage 56

Frage
Which of the following actions occurs at the beginning of an iteration of the DATA step?
Antworten
  • a. The automatic variables _N_ and _ERROR_ are incremented by one.
  • b. The DATA step stops execution.
  • c. The descriptor portion of the data set is written.
  • d. The values of variables created in programming statements are re-set to missing in the program data vector.

Frage 57

Frage
Based on the DATA step shown below, in what order will the variables be stored in the new data set? data perm.update; infile invent; input IDnum $ Item $ 1-13 Instock 21-22 BackOrd 24-25; Total = instock + backord; run;
Antworten
  • a. IDnum Item InStock BackOrd Total
  • b. Item IDnum InStock BackOrd Total
  • c. Total IDnum Item InStock BackOrd
  • d. Total Item IDnum InStock BackOrd

Frage 58

Frage
If SAS detects syntax errors, then...
Antworten
  • a. data set variables will contain missing values.
  • b. the DATA step does not compile.
  • c. the DATA step still compiles, but it does not execute.
  • d. the DATA step still compiles and executes.

Frage 59

Frage
What is wrong with this program? data perm.update; infile invent input Item $ 1-13 IDnum $ 15-19 Instock 21-22 BackOrd 24-25; total = instock + backord; run;
Antworten
  • a. missing semicolon on second line
  • b. missing semicolon on third line
  • c. incorrect order of variables
  • d. incorrect variable type

Frage 60

Frage
See image
Antworten
  • a. A keyword was misspelled in the DATA step.
  • b. A semicolon was missing from the INFILE statement.
  • c. A variable was misspelled in the INPUT statement.
  • d. A dollar sign was missing in the INPUT statement.

Frage 61

Frage
If you don't specify the LIBRARY = option on the PROC FORMAT statement, your formats are stored in Work.Formats, and they exist ...
Antworten
  • a. only for the current procedure.
  • b. only for the current DATA step.
  • c. only for the current SAS session.
  • d. permanently.

Frage 62

Frage
Which of the following statements will store your formats in a permanent catalog?
Antworten
  • a. libname library 'c:\ sas\ formats\ lib'; proc format lib = library ...;
  • b. libname library 'c:\ sas\ formats\ lib'; format lib = library ...;
  • c. library =' c:\ sas\ formats\ lib'; proc format library ...;
  • d. library =' c:\ sas\ formats\ lib'; proc library ...;

Frage 63

Frage
When creating a format with the VALUE statement, the new format's name -cannot end with a number -cannot end with a period -cannot be the name of a SAS format, and...
Antworten
  • a. cannot be the name of a data set variable.
  • b. must be at least two characters long.
  • c. must be at least eight characters long.
  • d. must begin with a dollar sign ($) if used with a character variable.

Frage 64

Frage
Which of the following FORMAT procedures is written correctly?
Antworten
  • a. proc format lib = library value colorfmt; 1 =' Red' 2 =' Green' 3 =' Blue' run;
  • b. proc format lib = library; value colorfmt 1 =' Red' 2 =' Green' 3 =' Blue'; run;
  • c. proc format lib = library; value colorfmt; 1 =' Red' 2 =' Green' 3 =' Blue' run;
  • d. proc format lib = library; value colorfmt 1 =' Red'; 2 =' Green'; 3 =' Blue'; run;

Frage 65

Frage
Which of these is false? Ranges in the VALUE statement can specify...
Antworten
  • a. a single value, such as 24 or 'S'.
  • b. a range of numeric values, such as 0-1500.
  • c. a range of character values, such as 'A'-' M'.
  • d. a list of numeric and character values separated by commas, such as 90,' B', 180,' D', 270.

Frage 66

Frage
How many characters can be used in a label?
Antworten
  • a. 40
  • b. 96
  • c. 200
  • d. 256

Frage 67

Frage
Which keyword can be used to label missing numeric values as well as any values that are not specified in a range?
Antworten
  • a. LOW
  • b. MISS
  • c. MISSING
  • d. OTHER

Frage 68

Frage
You can place the FORMAT statement in either a DATA step or a PROC step. What happens when you place it in a DATA step?
Antworten
  • a. You temporarily associate the formats with variables.
  • b. You permanently associate the formats with variables.
  • c. You replace the original data with the format labels.
  • d. You make the formats available to other data sets.

Frage 69

Frage
The format JOBFMT was created in a FORMAT procedure. Which FORMAT statement will apply it to the variable JobTitle in the program output?
Antworten
  • a. format jobtitle jobfmt;
  • b. format jobtitle jobfmt.;
  • c. format jobtitle = jobfmt;
  • d. format jobtitle =' jobfmt';

Frage 70

Frage
Which keyword, when added to the PROC FORMAT statement, will display all the formats in your catalog?
Antworten
  • a. CATALOG
  • b. LISTFMT
  • c. FMTCAT
  • d. FMTLIB

Frage 71

Frage
The default statistics produced by the MEANS procedure are n, mean, minimum, maximum, and...
Antworten
  • a. median
  • b. range
  • c. standard deviation
  • d. standard error of the mean.

Frage 72

Frage
Which statement will limit a PROC MEANS analysis to the variables Boarded, Transfer, and Deplane?
Antworten
  • a. by boarded transfer deplane;
  • b. class boarded transfer deplane;
  • c. output boarded transfer deplane;
  • d. var boarded transfer deplane;

Frage 73

Frage
The data set Survey.Health includes the following variables. Which is a poor candidate for PROC MEANS analysis?
Antworten
  • a. IDnum
  • b. Age
  • c. Height
  • d. Weight

Frage 74

Frage
Which of the following statements is true regarding BY group processing?
Antworten
  • a. BY variables must be either indexed or sorted.
  • b. Summary statistics are computed for BY variables.
  • c. BY group processing is preferred when you are categorizing data that contains few variables.
  • d. BY group processing overwrites your data set with the newly grouped observations.

Frage 75

Frage
Which group processing statement produced the PROC MEANS output shown below?
Antworten
  • a. class sex survive;
  • b. class survive sex;
  • c. by sex survive;
  • d. by survive sex;

Frage 76

Frage
Which program can be used to create the following output?
Antworten
  • a. proc means data = clinic.diabetes; var age height weight; class sex; output out = work.sum_gender mean = AvgAge AvgHeight AvgWeight; run;
  • b. proc summary data = clinic.diabetes print; var age height weight; class sex; output out = work.sum_gender mean = AvgAge AvgHeight AvgWeight; run;
  • c. proc means data = clinic.diabetes noprint; var age height weight; class sex; output out = work.sum_gender mean = AvgAge AvgHeight AvgWeight; run;
  • d. Both a and b.

Frage 77

Frage
By default, PROC FREQ creates a table of frequencies and percentages for which data set variables?
Antworten
  • a. character variables
  • b. numeric variables
  • c. both character and numeric variables
  • d. none: variables must always be specified

Frage 78

Frage
Frequency distributions work best with variables that contain
Antworten
  • a. continuous values.
  • b. numeric values.
  • c. categorical values.
  • d. unique values.

Frage 79

Frage
Which PROC FREQ step produced this two-way table?
Antworten
  • a. proc freq data = clinic.diabetes; tables height weight;format height htfmt. weight wtfmt.; run;
  • b. proc freq data = clinic.diabetes; tables weight height; format weight wtfmt. height htfmt.; run;
  • c. proc freq data = clinic.diabetes; tables height* weight; format height htfmt. weight wtfmt.; run;
  • d. proc freq data = clinic.diabetes; tables weight* height; format weight wtfmt. height htfmt.; run;

Frage 80

Frage
Which PROC FREQ step produced this table?
Antworten
  • a. proc freq data = clinic.diabetes; tables sex weight / list; format weight wtfmt.; run;
  • b. proc freq data = clinic.diabetes; tables sex* weight / nocol; format weight wtfmt.; run;
  • c. proc freq data = clinic.diabetes; tables sex weight / norow nocol; format weight wtfmt.; run;
  • d. proc freq data = clinic.diabetes; tables sex* weight / nofreq norow nocol; format weight wtfmt.; run;

Frage 81

Frage
Using ODS statements, how many types of output can you generate at once?
Antworten
  • a. 1 (only HTML output)
  • b. 2
  • c. 3
  • d. as many as you want

Frage 82

Frage
If ODS is set to its default settings in the SAS windowing environment for Microsoft Windows and UNIX, , what types of output are created by the code below? ods html file =' c:\ myhtml.htm'; ods pdf file =' c:\ mypdf.pdf';
Antworten
  • a. HTML and PDF
  • b. PDF only
  • c. HTML, PDF, and listing
  • d. No output is created because ODS is closed by default.

Frage 83

Frage
In the SAS windowing environment for Microsoft Windows and UNIX, what is the purpose of closing the HTML destination in the code shown below? ods html close; ods rtf ... ;
Antworten
  • a. It conserves system resources.
  • b. It simplifies your program.
  • c. It makes your program compatible with other hardware platforms.
  • d. It makes your program compatible with previous versions of SAS.

Frage 84

Frage
When the code shown below is run, what will the file D:\ Output\ body.html contain? ods html body =' d:\ output\ body.html'; proc print data = work.alpha; run; proc print data = work.beta; run; ods html close;
Antworten
  • a. The PROC PRINT output for Work.Alpha.
  • b. The PROC PRINT output for Work.Beta.
  • c. The PROC PRINT output for both Work.Alpha and Work.Beta.
  • d. Nothing. No output will be written to D:\ Output\body.html.

Frage 85

Frage
When the code shown below is run, what file will be referenced by the links in D:\ Output\contents.html? ods html body =' d:\ output\ body.html' contents =' d:\ output\ contents.html' frame =' d:\ output\ frame.html';
Antworten
  • a. D:\ Output\ body.html
  • b. D:\ Output\ contents.html
  • c. D:\ Output\ frame.html
  • d. There are no links from the file D:\ Output\contents.html.

Frage 86

Frage
The table of contents created by the CONTENTS = option contains a numbered heading for
Antworten
  • a. each procedure
  • b. each procedure that creates output.
  • c. each procedure and DATA step.
  • d. each HTML file created by your program.

Frage 87

Frage
When the code shown below is run, what will the file D:\ Output\ frame.html display? ods html body =' d:\ output\ body.html' contents =' d:\ output\ contents.html' frame =' d:\ output\ frame.html';
Antworten
  • a. The file D:\ Output\contents.html.
  • b. The file D:\ Output\frame.html.
  • c. The files D:\ Output\ contents.html and D:\ Output\body.html.
  • d. It displays no other files.

Frage 88

Frage
What is the purpose of the URL = suboptions shown below? ods html body =' d:\ output\ body.html' (url =' body.html') contents =' d:\ output\ contents.html' (url =' contents.html') frame =' d:\ output\ frame.html';
Antworten
  • a. To create absolute link addresses for loading the files from a server.
  • b. To create relative link addresses for loading the files from a server.
  • c. To allow HTML files to be loaded from a local drive.
  • d. To send HTML output to two locations.

Frage 89

Frage
Which ODS HTML option was used in creating the following table?
Antworten
  • a. format = brown
  • b. format =' brown'
  • c. style = brown
  • d. style =' brown'

Frage 90

Frage
What is the purpose of the PATH = option? ods html path =' d:\ output' (url = none) body =' body.html' contents =' contents.html' frame =' frame.html';
Antworten
  • a. It creates absolute link addresses for loading HTML files from a server.
  • b. It creates relative link addresses for loading HTML files from a server.
  • c. It allows HTML files to be loaded from a local drive.
  • d. It specifies the location of HTML file output.

Frage 91

Frage
Which program creates the output shown below?
Antworten
  • a. data test2; infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish =' oak' then delete; retain TotPrice 100; totalprice + price; drop price; run; proc print data = test2 noobs; run;
  • b. data test2; infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish =' oak' and price < 200 then delete; TotalPrice + price; run; proc print data = test2 noobs; run;
  • c. data test2( drop = price); infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish =' oak' and price < 200 then delete; TotalPrice + price; run; proc print data = test2 noobs; run;
  • d. data test2; infile furnture; input StockNum $ 1-3 Finish $ 5-9 Style $ 11-18 Item $ 20-24 Price 26-31; if finish = oak and price < 200 then delete price; TotalPrice + price; run; proc print data = test2 noobs; run;

Frage 92

Frage
How is the variable Amount labeled and formatted in the PROC PRINT output? data credit; infile creddata; input Account $ 1-5 Name $ 7-25 Type $ 27 Transact $ 29-35 Amount 37-50; label amount =' Amount of Loan'; format amount dollar12.2; run; proc print data = credit label; label amount =' Total Amount Loaned'; format amount comma10.; run;
Antworten
  • a. label Amount of Loan, format DOLLAR12.2
  • b. label Total Amount Loaned, format COMMA10.
  • c. label Amount, default format
  • d. The PROC PRINT step does not execute because two labels and two formats are assigned to the same variable.

Frage 93

Frage
Consider the IF-THEN statement shown below. When the statement is executed, which expression is evaluated first? if finlexam > = 95 and (research =' A' or (project =' A' and present =' A')) then Grade =' A +';
Antworten
  • a. finlexam > = 95
  • b. research =' A'
  • c. project =' A' and present =' A'
  • d. research =' A' or (project =' A' and present =' A')

Frage 94

Frage
Consider the small raw data file and program shown below. What is the value of Count after the fourth record is processed? data work.newnums; infile numbers; input Tens 2-3; Count + tens; run;
Antworten
  • a. missing
  • b. 0
  • c. 30
  • d. 70

Frage 95

Frage
Now consider the revised program below. What is the value of Count after the third observation is read? data work.newnums; infile numbers; input Tens 2-3; retain Count 100; count + tens; run;
Antworten
  • a. missing
  • b. 0
  • c. 100
  • d. 130

Frage 96

Frage
For the observation shown below, what is the result of the IF-THEN statements? if status =' OK' and type = 3 then Count + 1; if status =' S' or action =' E' then Control =' Stop';
Antworten
  • a. Count = 12 Control = Go
  • b. Count = 13 Control = Stop
  • c. Count = 12 Control = Stop
  • d. Count = 13 Control = Go

Frage 97

Frage
Which of the following can determine the length of a new variable?
Antworten
  • a. the length of the variable's first reference in the DATA step
  • b. the assignment statement
  • c. the LENGTH statement
  • d. all of the above

Frage 98

Frage
Which set of statements is equivalent to the code shown below? if code =' 1' then Type =' Fixed'; if code =' 2' then Type =' Variable'; if code ^ =' 1' and code ^ =' 2' then Type =' Unknown';
Antworten
  • a. if code =' 1' then Type =' Fixed'; else if code =' 2' then Type =' Variable'; else Type =' Unknown';
  • b. if code =' 1' then Type =' Fixed'; if code =' 2' then Type =' Variable'; else Type =' Unknown';
  • c. if code =' 1' then type =' Fixed'; else code =' 2' and type =' Variable'; else type =' Unknown';
  • d. if code =' 1' and type =' Fixed'; then code =' 2' and type =' Variable'; else type =' Unknown';

Frage 99

Frage
What is the length of the variable Type, as created in the DATA step below? data finance.newloan; set finance.records; TotLoan + payment; if code =' 1' then Type =' Fixed'; else Type =' Variable'; length type $ 10; run;
Antworten
  • a. 5
  • b. 8
  • c. 10
  • d. It depends on the first value of Type

Frage 100

Frage
Which program contains an error?
Antworten
  • a. data clinic.stress( drop = timemin timesec); infile tests; input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33 RecHR 35-37 TimeMin 39-40 TimeSec 42-43 Tolerance $ 45; TotalTime =( timemin* 60) + timesec; SumSec + totaltime; run;
  • b. proc print data = clinic.stress; label totaltime =' Total Duration of Test'; format timemin 5.2; drop sumsec; run;
  • c. proc print data = clinic.stress( keep = totaltime timemin); label totaltime =' Total Duration of Test'; format timemin 5.2; run;
  • d. data clinic.stress; infile tests; input ID $ 1-4 Name $ 6-25 RestHR 27-29 MaxHR 31-33 RecHR 35-37 TimeMin 39-40 TimeSec 42-43 Tolerance $ 45; TotalTime =( timemin* 60) + timesec; keep id totaltime tolerance; run;

Frage 101

Frage
If you submit the following program, which variables appear in the new data set? data work.cardiac( drop = age group); set clinic.fitness( keep = age weight group); if group = 2 and age > 40; run;
Antworten
  • a. none
  • b. Weight
  • c. Age, Group
  • d. Age, Weight, Group

Frage 102

Frage
Which of the following programs correctly reads the data set Orders and creates the data set FastOrdr?
Antworten
  • a. data catalog.fastordr( drop = ordrtime); set july.orders( keep = product units price); if ordrtime < 4; Total = units* price; run;
  • b. data catalog.orders( drop = ordrtime); set july.fastordr( keep = product units price); if ordrtime < 4; Total = units* price; run;
  • c. data catalog.fastordr( drop = ordrtime); set july.orders( keep = product units price ordrtime); if ordrtime < 4; Total = units* price; run;
  • d. None of the above

Frage 103

Frage
Which of the following statements is false about BY-group processing? When you use the BY statement with the SET statement:
Antworten
  • a. The data sets listed in the SET statement must be indexed or sorted by the values of the BY variable( s).
  • b. The DATA step automatically creates two variables, FIRST. and LAST., for each variable in the BY statement.
  • c. FIRST. and LAST. identify the first and last observation in each BY group, respectively.
  • d. FIRST. and LAST. are stored in the data set.

Frage 104

Frage
There are 500 observations in the data set Usa. What is the result of submitting the following program? data work.getobs5; obsnum = 5; set company.usa( keep = manager payroll) point = obsnum; stop; run;
Antworten
  • a. an error
  • b. an empty data set
  • c. continuous loop
  • d. a data set that contains one observation

Frage 105

Frage
There is no end-of-file condition when you use direct access to read data, so how can your program prevent a continuous loop?
Antworten
  • a. Do not use a POINT = variable.
  • b. Check for an invalid value of the POINT = variable.
  • c. Do not use an END = variable.
  • d. Include an OUTPUT statement.

Frage 106

Frage
Assuming that the data set Company.USA has five or more observations, what is the result of submitting the following program? data work.getobs5; obsnum = 5; set company.usa( keep = manager payroll) point = obsnum; output; stop; run;
Antworten
  • a. an error
  • b. an empty data set
  • c. a continuous loop
  • d. a data set that contains one observation

Frage 107

Frage
Which of the following statements is true regarding direct access of data sets?
Antworten
  • a. You cannot specify END = with POINT =.
  • b. You cannot specify OUTPUT with POINT =.
  • c. You cannot specify STOP with END =.
  • d. You cannot specify FIRST. with LAST.

Frage 108

Frage
What is the result of submitting the following program? data work.addtoend; set clinic.stress2 end = last; if last; run;
Antworten
  • a. an error
  • b. an empty data set
  • c. a continuous loop
  • d. a data set that contains one observation

Frage 109

Frage
At the start of DATA step processing, during the compilation phase, variables are created in the program data vector (PDV), and observations are set to:
Antworten
  • a. blank
  • b. missing
  • c. 0
  • d. there are no observations.

Frage 110

Frage
The DATA step executes:
Antworten
  • a. continuously if you use the POINT = option and the STOP statement.
  • b. once for each variable in the output data set.
  • c. once for each observation in the input data set.
  • d. until it encounters an OUTPUT statement.
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Statistics Key Words
Culan O'Meara
SAMPLING
Elliot O'Leary
CUMULATIVE FREQUENCY DIAGRAMS
Elliot O'Leary
FREQUENCY TABLES: MODE, MEDIAN AND MEAN
Elliot O'Leary
HISTOGRAMS
Elliot O'Leary
TYPES OF DATA
Elliot O'Leary
GROUPED DATA FREQUENCY TABLES: MODAL CLASS AND ESTIMATE OF MEAN
Elliot O'Leary
Statistics Vocab
Nabeeha Yusuf
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
chapter 1,2 statistics
Rigo Sanchez
Statistics, Data and Area (Semester 2 Exam)
meg willmington