PSTAT 130 (S22)
Name_______________________
Practice Final
Instructions: This is a closed book exam. You may NOT use any electronic device(s).
Copyright By PowCoder代写 加微信 powcoder
You have 120 minutes to complete this exam. Multiple Choice: (2 pts each)
1. The trailing @ symbol holds a raw data record
(a) Foraspecifiednumberofiterations
(b) UntilSASreadspasttheendoftheline
(c) Until an input statement with no trailing @ is executed
(d) Alloftheabove
2. Which of the following are valid pointer controls? (a) @n
3. Which of the following is not true of PROC TABULATE?
(a) Requiresacommabetweendimensions(i.e.rows,columns)
(b) Cancreatealist/detailreport
(c) Can use a WHERE statement
(d) Allowslabellingofvariables
4. Which procedure indicates, for each variable, the number of missing values? (a) PROC MEANS
(b) PROC REPORT
(c) PROC FREQ
(d) PROC TABULATE
5. Which of the following is an example of a name range list? (a) address-zip
(b) address–zip
(c) zip1-zip20
(d) _character_
6. Which of the following is not a valid comparison operator? (a) LESS
(b) ~= (c) GE (d) IN
7. NewVar1=INT(5.7); NewVar2=CEIL(5); NewVar3=FLOOR(5.7); (a) NewVar3 = 5
(b) NewVar1=NewVar2
(c) NewVar2=NewVar3
(d) Alloftheabove
PSTAT 130 (S22)
8. Which of the following statements is not true of PROC GCHART?
(a) Chartvariablescanbecharacterornumeric
(b) CancreatemultiplechartsinasingleGCHARTstep
(c) Can produce a scatterplot
(d) Canchartasummarystatistic
9. PROC TABULATE
(a) Alwaysneedsavarstatement
(b) Hasamaximumoftwodimensions
(c) Uses the keyword ALL to generate overall information
(d) Alloftheabove
10. Which of the following are case sensitive?
(a) SASvariablenames
(b) SASlibrarynames
(c) SAS string comparisons
(d) Nonearecasesensitive
(a) StandsfortheOutputDataSystem
(b) CancreateHTMLfiles
(c) Can create SAS listing files
12. The default list report created by the REPORT procedure displays
(a) Observationsintheorderinwhichtheyarestoredinthedataset
(b) Charactervaluesright-justified
(c) Numeric variables left-justified
(d) Alloftheabove
13. How is missing data at the end of the input record treated by default?
(a) SASloadsthenextrecordtofinishtheobservation
(b) SASautomaticallyassignsappropriatemissingvaluestotheaffectedvariables
(c) SAS halts its execution
(d) Alloftheabove
14. A colon modifier
(a) Readsonlyasfarasthenextdelimiter
(b) AllowstheuseofaFORMAT=optionwithlistinput
(c) Modifies the default delimiter
(d) Alloftheabove
15. Which of the following is not a correct symbol statement? (a) symbol v=diamond i=join c=green;
(b) symbol val=plus i=spline width=3;
(c) symbol value=star i=needle color=blue; (d) None,allarecorrect
PSTAT 130 (S22)
16. Which of the following does not produce the same report?
(a) proc print data=cities label noobs; var pop–taxrate; run; (b) proc report data=cities; var pop–taxrate; run;
(c) proc report data=cities; column pop–taxrate; run;
(d) Allproducethesamereport
17. The statement do i=Week1,Week12 will execute ____ times (a) 1
(b) 2 (c) 11 (d) 12
18. Output can be directed to
(a) TheResultswindow
(b) An.htmlfile
(c) A .csv file
(d) Alloftheabove
19. TheRBREAKstatement
(a) Isusedtodisplayobservationnumbers
(b) Alwayscreatesasinglelineaboveandbelowthetotal
(c) Has the option of creating double lines above the total
(d) Alloftheabove
20. Which format produces dates of the form 10DEC2014? (a) ddmmyy9
(b) mmyydd9 (c) yyddmm9 (d) date9
21. Which of the following is true?
(a) TheINPUTstatementconvertscharacterdataintonumericdata
(b) ThePUTfunctionconvertsnumericdataintocharacterdata
(c) The PUT statement controls how raw data is read into the data step
(d) Alloftheabove
22. Which of the following is not true of the SCAN function?
(a) Delimitersbeforethefirstworddohaveaneffect
(b) Anycharacterorsetofcharacterscanserveasdelimiters
(c) Two or more contiguous delimiters are treated as a single delimiter
(d) Alloftheabovearetrue
23. PROC REPORT
(a) Cansortdataforthereport
(b) RequiresaLABELoptiontodisplaylabels
(c) By default, displays grand totals
PSTAT 130 (S22)
24. Which of the following conditional statements is valid?
(a) if location=’CA’, then State=’California’;
(b) if location=’CA’ then State=’California’ and Region=’West Coast’; (c) if location=’CA’ then State=’California’;
(d) Noneoftheabove
25. data work.change;
set data1.weightloss; weightchange=lastweight-weight; lastweight=weight;
In work.change, what are the values of weightchange and lastweight for the second observation?
(a) (b) (c) (d)
26. By (a) (b) (c) (d)
weighchange=11 , lastweight=210 weightchange=. , lastweight=210 weightchange=. , lastweight=199 weightchange= . , lastweight= .
default, PROC FREQ does not AnalyzeeveryvariableintheSA
Calculate the number of observations in which each data value appears Haltexecutionwhenitencountersmissingvalues
27. DATA data1.summer data1.fall;
(a) CreatesSASdatasetsinthedata1library
(b) CreatesSASdatasetsinthesasuserlibrary
(c) Creates SAS data sets in the work library
(d) Noneoftheabove
28. DATA summer(keep name class) fall(keep name address);
(a) Thesummerdatasetcontainsonlythevariablesnameandclass
(b) Thefalldatasetcontainsonlythevariablesnameandaddress
(d) Noneoftheabove
29. substr(‘It was the best of times’, 13)
(a) Returns’bestoftimes’
(b) Returns’estoftimes’
(c) Returns ‘st of times’
(d) Noneoftheabove
30. Theinputstatement
(a) Isrequiredwhenusingadatalinesstatement
(b) Isrequiredwhenusinganinfilestatement
(d) Noneoftheabove
data1.weightloss
PSTAT 130 (S22)
31. PROC REPORT data=data1.admit; run;
(a) Createsadetailreport
(b) Createsasummaryreport
(d) Noneoftheabove
32. output greenland;
(a) CanbeusedinthePRINTprocedure
(b) CanbeusedintheREPORTprocedure
(c) Writes an observation to the greenland data set
(d) Alloftheabove
33. input name $ age
(a) Impliesthattherearemorethantwoinputvariables
(b) Impliesthattheremaybemultiplerecordsintheinputbuffer
(c) Implies that the input statement is not complete
(d) Alloftheabove
34. The options statement can be used in (a) PROC MEANS
(b) PROC TABULATE
(c) PROC REPORT
(d) Alloftheabove
35. By default, how many statistics are displayed as output to the MEANS procedure? (a) 3
(d) Noneoftheabove
Programming Questions:
The data set RC1833, located in the utilities library, contains information about electricity usage for a residential customer during the period 1/1/21 – 6/30/21. This data set contains three numeric variables: month (1, … , 6), date (SAS date value), and usage (in kilowatt-hours).
1. (10 pts) Create a scatterplot of the usage (y-axis) vs. the date (x-axis) for 3/1/21-3/14/21. Display the data points as green squares, and define the vertical axis tick marks to start at 10 and end at 60 with values appearing in increments of 10.
PSTAT 130 (S22)
2. (10 pts) Create a new data set called EC1833 that contains the information in RC1833. This new data set should also contain a variable called cost, which is the daily cost of electricity (in dollars) under the assumption that electricity costs 21 cents per kilowatt-hour. Create a summary (not detail) report that shows the month and the total electricity cost for each month. Format the values of cost with dollar signs and two decimal places, and use ‘Total Cost’ as the column header.
3. (10 pts) Use the EC1833 data set. Create a report that displays the daily usage by month (each on its own separate page). Display the months as ‘January’, ‘February’, etc. and use month as an ID variable. Display the values of date in the form of mm/dd/yy, and use ‘Daily Cost’ as the column header.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com