QuestionQuestion

Transcribed TextTranscribed Text

1. Multiple Choice 1) Which of the following is a valid name for a user-defined format? a) Body_Mass_Index_Categories b) Description2 c) Age(yrs) d) Varchar$ 2) What is true about formats assigned to variables in the DATA step? a) They affect the stored values of variables in the data set b) They need to be specified for variables during subsequent procedures where you wish to use them c) They need to be specified for variables during subsequent DATA steps where you wish to use them d) None of the above 3) Which option in the PROC SORT statement would tell SAS to sort the following last names in alphabetical order? ----+----1 de Bie De Leon deVere De Mesa Dewey a) SORTSEQ = LINGUISTIC b) SORTSEQ = ASCII 1 c) NODUPKEY d) None of the above 4) Suppose that you have a data set that includes the gender, age, and height of students in a class. Which BY statement will tell SAS to sort the data so that within each age (youngest to oldest), the data will be organized by males (tallest to shortest), followed by females (tallest to shortest)? a) BY DESCENDING Gender Age DESCENDING Height; b) BY DESCENDING Gender DESCENDING Height Age; c) BY Age DESCENDING Height DESCENDING Gender; d) BY Age DESCENDING Gender DESCENDING Height; 5) Which WHERE statement using a nemonic operator is equivalent to the following WHERE statement using a symbolic operator? WHERE Temp ~= . a) WHERE Temp IS NOT MISSING; b) WHERE Temp CONTAINS . ; c) WHERE Temp IN (.); d) All of the above 6) For a) COMMA6.2 b) COMMA7.2 c) COMMA7.3 d) COMMA8.2 the value 5678 to appear as 5,678.00 in the output which format should be used? 7) Which of the following is a valid option for the PROC PRINT statement to suppress the Obs column from the output? a) NOOBSERVATION b) NOOBS c) NOOBSCOL d) NOOBSCOLUMN 8) Which statement is required when interleaving data sets but not when stacking data sets? a) SET b) BY c)MERGE d)UPDATE 2 9) Which statement in PROC MEANS will produce output summarized by the values of a categorical variable? a) VAR b) OUTPUT c) CLASS d) TITLE 10) What is the purpose of using the MAXDEC = n option in a PROC MEANS statement? a) Maximizes the computing power by a factor of n b) Limits the numeric output to n decimal places c) Uses a maximum of n observations in the calculation d) None of the above 11) Which PROC uses a TABLES statement? b) PRINT b) SORT c) FREQ d) All of the above 12) Suppose you would like to use the following program to combine the SAS data set DEMOGRAPHICS, which contains the variables ID, Age, Gender, and Date, with the SAS data set MEDICALHX, which contains the variables ID, PreviousTreatment, and Date. Assume that both data sets are sorted by ID. Which of the following will happen? DATA patients; MERGE demographics medicalhx; BY ID; RUN; a) The variable Date in DEMOGRAPHICS will overwrite the variable Date in MEDICALHX for observations with common ID values b) The variable Date in MEDICALHX will overwrite the variable Date in DEMOGRAPHICS for observations with common ID values c) Both Date variables will be included as separate variables d) SAS will give you an error message 13) Consider the following SAS data set and program. How many variables will be in the resulting data set called PAYTYPE? EMPLOYEES ID Gender Age Hours Wage 1234 Male 32 25 25.20 4567 Female 28 40 17.80 8910 Male 25 40 19.45 3456 Female 20 22 10.50 DATA paytype (DROP = Hours Wage); 3 2. 1) 2) 3) 4) SET employees (DROP = Age); Pay = Hours * Wage; RUN; a) 1 b)3 c)4 d)5 14) Which DATA step will not overwrite a temporary SAS data set called TOYS? a) DATA WORK.toys; SET WORK.toys; RUN; b) DATA 'c:\MySASLib\toys'; SET 'c:\MySASLib\toys'; RUN; c) DATA toys; SET toys; RUN; d) None of the above 15) How many observations will be produced with the following program? DATA new; DO p = 1 TO 5; OUTPUT; END; RUN; a) 0 b)1 c)5 d)6 16) To print only the variables Q1, Q2, and Q3 using PROC PRINT, which VAR statement could you use? a) VAR Q1, Q2, Q3; b) VAR Q1 Q2 Q3; c) V AR (Q1 to Q3); d) All of the above Short Answer statement when using PROC MEANS to generate these simple descriptive statistics? a Discuss two advantages of using a WHERE statement to subset your data rather than subsetting IF statement. Explain the difference between using a MEAN function to calculate an average versus using PROC MEANS to calculate an average. Describe an advantage of using the CLASS statement rather than the BY statement with PROC MEANS. Suppose that you need to present simple descriptive statistics to the Principal Investigator of the study that you work on. Would it be necessary to use an OUTPUT 4 3. Programming Exercise 1) We have two datasets “Class.xlsx” (a roster of the students in a school classroom) and “library.xlsx” (a record of the textbook checked from the library) as attached. a) Import two excel datasets into SAS by using import wizard (0.5 point); b) Merge these two SAS datasets to answer the question: “For each student in the class, what is the checked out textbook?” and print the merged dataset ( 0.5 point); c) Merge these two SAS datasets to answer the question: “For each library transaction, what is the age and sex of the person who has checked out the book?” and print the merged dataset 2) The United States Bureau of Labor Statistics publishes various indexes that measure average prices of consumer goods in urban areas. The SAS data set called GAS contains data on the average price of unleaded regular gasoline (per gallon) for recent years by month in the United States. The variables in this file are year, month, and GasPrice. a) Print the names, labels, and attributes of the variables in the SAS data set GAS. (0.5 point); b) Identify the minimum and maximum gasoline price per year. Present the price statistics to two decimal places c) Calculate the average and standard deviation of gasoline prices per quarter per year. Present the price statistics to two decimal places d) Create a SAS data set that contains the averages and standard deviations as calculated in part c). Print the data set showing only the year, quarter, average price, and standard deviation. Present the statistics with a dollar sign and two decimal places 3) Consider an experiment to investigate the durability of three brands of synthetic wood veneer. This type of veneer is often used in office furniture and on kitchen countertops. To determine durability, samples of each of the three brands were subjected to a friction test. The amount of veneer material that is worn away due to friction is measured. The resulting wear measurement is recorded for each sample. The SAS data set called VENEER. 5 a) Compute the mean, standard deviation, median, minimum, and maximum, the numbers of both missing and non-missing values for the variable “Wear” for each brand using a BY statement, keep the statistics with two decimal places (0.5 point); b) Repeat problem a), except using a CLASS statement instead (0.5 point); c) Compute the median of variable “Wear”, then output to a dataset called “summary” d) Merge “summary” with the original dataset, and print the merged dataset e) Create a new variable “wear_grp” by using the median of wear as the cut-off point, label the values of the variable “wear_grp” as “greater than or equal to median” vs. “below median” by using PROC FORMAT , and attach the format to the variable permanently 4) We have data in wide form as following Name David Jessica Thomas a. Enter the above data into SAS, name it as “BMI_wide1” b. Reshape it, from wide to long form as listed below, name it as “BMI_long” BMI2010 24.50 BMI2011 25.60 BMI2012 26.80 22.70 25.40 22.60 22.50 27.60 26.30 * BMI2010 means BMI measured in year 2010. Name David David David Jessica Jessica Jessica Tomas Tomas Tomas BMI Year 24.50 2010 25.60 2011 26.80 2012 22.60 2010 22.50 2011 22.70 2012 27.60 2010 26.30 2011 25.40 2012 c. Reshape “BMI_long” back to wide form, and name it as “BMI_wide2” 6

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

Question 1: The answer is option A)
Question 2: The answer is option D)
Question 3: The answer is option B)...

By purchasing this solution you'll be able to access the following files:
Solution.zip.

$60.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available Advanced Statistics Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Decision:
Upload a file
Continue without uploading

SUBMIT YOUR HOMEWORK
We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats