Stats 124 Final Review

Descrição

SAS Basic Programming Multiple Choice
James Blair
Quiz por James Blair, atualizado more than 1 year ago
James Blair
Criado por James Blair mais de 9 anos atrás
281
0

Resumo de Recurso

Questão 1

Questão
See image
Responda
  • 3 Observations, 4 Variables
  • 3 Observations, 3 Variables
  • 4 Observations, 3 Variables
  • Can't tell because some values are missing

Questão 2

Questão
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.
Responda
  • three
  • four
  • five
  • six

Questão 3

Questão
See Image
Responda
  • numeric
  • character
  • can be either character or numeric
  • can't tell from the data shown

Questão 4

Questão
See image
Responda
  • numeric
  • character
  • can be either character or numeric
  • can't tell from the data shown

Questão 5

Questão
Which of the following variable names is valid
Responda
  • 4BirthDate
  • $Cost
  • _Items_
  • Tax-Rate

Questão 6

Questão
Which of the following files is a permanent SAS file?
Responda
  • Sashelp.PrdSale
  • Sasuser.MySales
  • Profits.Quarter1
  • all the above

Questão 7

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

Questão 8

Questão
See image
Responda
  • 5
  • 6
  • 7
  • 8

Questão 9

Questão
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;
Responda
  • three
  • four
  • five
  • six

Questão 10

Questão
What is a SAS library?
Responda
  • 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

Questão 11

Questão
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;
Responda
  • 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.

Questão 12

Questão
How can you create SAS output in HTML format on any SAS platform?
Responda
  • 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

Questão 13

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

Questão 14

Questão
When you specify an engine for a library, you always specify
Responda
  • 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

Questão 15

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

Questão 16

Questão
See image.
Responda
  • OBS=, DATE, and NONUMBER
  • NUMBER, PAGENO=1, and DATE
  • NUMBER and DATE only
  • none of the above

Questão 17

Questão
Which of the following programs correctly references a SAS data set named SalesAnalysis that is stored in a permanent SAS library?
Responda
  • 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;

Questão 18

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

Questão 19

Questão
Assuming you are using SAS code and not special SAS windows, which one of the following statements is false?
Responda
  • 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.

Questão 20

Questão
What does the following statement do? libname osiris spss 'c:\ myfiles\ sasdata\ data.spss';
Responda
  • 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

Questão 21

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

Questão 22

Questão
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?
Responda
  • 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.

Questão 23

Questão
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;
Responda
  • 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.

Questão 24

Questão
What generally happens when a syntax error is detected?
Responda
  • 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.

Questão 25

Questão
A syntax error occurs when
Responda
  • 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

Questão 26

Questão
How can you tell whether you have specified an invalid option in a SAS program?
Responda
  • 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.

Questão 27

Questão
Which of the following programs contains a syntax error?
Responda
  • 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

Questão 28

Questão
What should you do after submitting the following program in the Windows or UNIX operating environment? proc print data = mysales; where state =' NC; run;
Responda
  • 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.

Questão 29

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

Questão 30

Questão
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?
Responda
  • 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.

Questão 31

Questão
See image
Responda
  • 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;

Questão 32

Questão
Which of the following PROC PRINT steps is correct if labels are not stored with the data set?
Responda
  • 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;

Questão 33

Questão
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?
Responda
  • 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');

Questão 34

Questão
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?
Responda
  • 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;

Questão 35

Questão
See image.
Responda
  • 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

Questão 36

Questão
Which of the following statements can you use in a PROC PRINT step to create this output?
Responda
  • 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

Questão 37

Questão
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
Responda
  • 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.

Questão 38

Questão
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;
Responda

Questão 39

Questão
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.
Responda
  • 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;

Questão 40

Questão
What does PROC PRINT display by default?
Responda
  • 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.

Questão 41

Questão
Which SAS statement associates the fileref Crime with the raw data file C:\ States\ Data\Crime.dat?
Responda
  • 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;

Questão 42

Questão
Filerefs remain in effect until . . .
Responda
  • You change them
  • You cancel them
  • you end your SAS session
  • all the above

Questão 43

Questão
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?
Responda
  • infile products obs 15;
  • infile products obs = 15;
  • input products obs = 15;
  • input products 1-15;

Questão 44

Questão
Which of the following programs correctly writes the observations from the data set below to a raw data file?
Responda
  • 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;

Questão 45

Questão
Which raw data file can be read using column input?
Responda

Questão 46

Questão
See image
Responda
  • 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

Questão 47

Questão
See image
Responda
  • 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;

Questão 48

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

Questão 49

Questão
Which program correctly reads instream data?
Responda
  • 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 ;

Questão 50

Questão
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?
Responda
  • if sex = f;
  • if sex = F;
  • if sex =' F';
  • a or b

Questão 51

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

Questão 52

Questão
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?
Responda
  • a. incorrect values and formats
  • b. invalid options or variable names
  • c. missing or invalid punctuation
  • d. missing or misspelled keywords

Questão 53

Questão
Unless otherwise directed, the DATA step executes...
Responda
  • 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

Questão 54

Questão
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:
Responda
  • a. 0
  • b. 1
  • c. undefined
  • d. missing

Questão 55

Questão
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?
Responda
  • a. 0
  • b. 1
  • c. 2
  • d. 3

Questão 56

Questão
Which of the following actions occurs at the beginning of an iteration of the DATA step?
Responda
  • 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.

Questão 57

Questão
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;
Responda
  • a. IDnum Item InStock BackOrd Total
  • b. Item IDnum InStock BackOrd Total
  • c. Total IDnum Item InStock BackOrd
  • d. Total Item IDnum InStock BackOrd

Questão 58

Questão
If SAS detects syntax errors, then...
Responda
  • 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.

Questão 59

Questão
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;
Responda
  • a. missing semicolon on second line
  • b. missing semicolon on third line
  • c. incorrect order of variables
  • d. incorrect variable type

Questão 60

Questão
See image
Responda
  • 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.

Questão 61

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

Questão 62

Questão
Which of the following statements will store your formats in a permanent catalog?
Responda
  • 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 ...;

Questão 63

Questão
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...
Responda
  • 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.

Questão 64

Questão
Which of the following FORMAT procedures is written correctly?
Responda
  • 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;

Questão 65

Questão
Which of these is false? Ranges in the VALUE statement can specify...
Responda
  • 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.

Questão 66

Questão
How many characters can be used in a label?
Responda
  • a. 40
  • b. 96
  • c. 200
  • d. 256

Questão 67

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

Questão 68

Questão
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?
Responda
  • 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.

Questão 69

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

Questão 70

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

Questão 71

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

Questão 72

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

Questão 73

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

Questão 74

Questão
Which of the following statements is true regarding BY group processing?
Responda
  • 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.

Questão 75

Questão
Which group processing statement produced the PROC MEANS output shown below?
Responda
  • a. class sex survive;
  • b. class survive sex;
  • c. by sex survive;
  • d. by survive sex;

Questão 76

Questão
Which program can be used to create the following output?
Responda
  • 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.

Questão 77

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

Questão 78

Questão
Frequency distributions work best with variables that contain
Responda
  • a. continuous values.
  • b. numeric values.
  • c. categorical values.
  • d. unique values.

Questão 79

Questão
Which PROC FREQ step produced this two-way table?
Responda
  • 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;

Questão 80

Questão
Which PROC FREQ step produced this table?
Responda
  • 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;

Questão 81

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

Questão 82

Questão
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';
Responda
  • a. HTML and PDF
  • b. PDF only
  • c. HTML, PDF, and listing
  • d. No output is created because ODS is closed by default.

Questão 83

Questão
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 ... ;
Responda
  • 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.

Questão 84

Questão
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;
Responda
  • 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.

Questão 85

Questão
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';
Responda
  • 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.

Questão 86

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

Questão 87

Questão
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';
Responda
  • 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.

Questão 88

Questão
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';
Responda
  • 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.

Questão 89

Questão
Which ODS HTML option was used in creating the following table?
Responda
  • a. format = brown
  • b. format =' brown'
  • c. style = brown
  • d. style =' brown'

Questão 90

Questão
What is the purpose of the PATH = option? ods html path =' d:\ output' (url = none) body =' body.html' contents =' contents.html' frame =' frame.html';
Responda
  • 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.

Questão 91

Questão
Which program creates the output shown below?
Responda
  • 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;

Questão 92

Questão
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;
Responda
  • 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.

Questão 93

Questão
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 +';
Responda
  • a. finlexam > = 95
  • b. research =' A'
  • c. project =' A' and present =' A'
  • d. research =' A' or (project =' A' and present =' A')

Questão 94

Questão
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;
Responda
  • a. missing
  • b. 0
  • c. 30
  • d. 70

Questão 95

Questão
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;
Responda
  • a. missing
  • b. 0
  • c. 100
  • d. 130

Questão 96

Questão
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';
Responda
  • a. Count = 12 Control = Go
  • b. Count = 13 Control = Stop
  • c. Count = 12 Control = Stop
  • d. Count = 13 Control = Go

Questão 97

Questão
Which of the following can determine the length of a new variable?
Responda
  • 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

Questão 98

Questão
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';
Responda
  • 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';

Questão 99

Questão
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;
Responda
  • a. 5
  • b. 8
  • c. 10
  • d. It depends on the first value of Type

Questão 100

Questão
Which program contains an error?
Responda
  • 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;

Questão 101

Questão
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;
Responda
  • a. none
  • b. Weight
  • c. Age, Group
  • d. Age, Weight, Group

Questão 102

Questão
Which of the following programs correctly reads the data set Orders and creates the data set FastOrdr?
Responda
  • 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

Questão 103

Questão
Which of the following statements is false about BY-group processing? When you use the BY statement with the SET statement:
Responda
  • 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.

Questão 104

Questão
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;
Responda
  • a. an error
  • b. an empty data set
  • c. continuous loop
  • d. a data set that contains one observation

Questão 105

Questão
There is no end-of-file condition when you use direct access to read data, so how can your program prevent a continuous loop?
Responda
  • 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.

Questão 106

Questão
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;
Responda
  • a. an error
  • b. an empty data set
  • c. a continuous loop
  • d. a data set that contains one observation

Questão 107

Questão
Which of the following statements is true regarding direct access of data sets?
Responda
  • 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.

Questão 108

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

Questão 109

Questão
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:
Responda
  • a. blank
  • b. missing
  • c. 0
  • d. there are no observations.

Questão 110

Questão
The DATA step executes:
Responda
  • 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.

Semelhante

Statistics Key Words
Culan O'Meara
SAMPLING
Elliot O'Leary
FREQUENCY TABLES: MODE, MEDIAN AND MEAN
Elliot O'Leary
HISTOGRAMS
Elliot O'Leary
CUMULATIVE FREQUENCY DIAGRAMS
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