logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

the value 110700 is stored in a numeric variable.  Which one of the following SAS formats is used to display the value as $110,700.00 in a report?

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Section 1: Multiple Choice

1. What change to the program will correct the error?

  1. Replace the WHERE statement with an IF statement
  2. Change the ** in the BMI formula to a single *
  3. Change bmi to BMI in the WHERE statement
  4. Add a (Keep=BMI) option to the SET statement

2) The value 110700 is stored in a numeric variable.  Which one of the following SAS formats is used to display the value as $110,700.00 in a report?

  1. comma8.2
  2. comma11.2
  3. dollar8.2
  4. dollar11.2

3) The following SAS DATA step is submitted:

libname temp 'C:\Users\SAS\Datasets';

data temp.report;

set sashelp.houses;

newvar = price * 1.04; run;

Which one of the following statements is true regarding the program above?

  1. The program is reading from a temporary data set and writing to a temporary data set.
  2. The program is reading from a temporary data set and writing to a permanent data set.
  3. The program is reading from a permanent data set and writing to a temporary data set.
  4. The program is reading from a permanent data set and writing to a permanent data set.

4) Which of the following actions occurs at the beginning of an iteration of the DATA step?

  1. The automatic variables _N_ and _ERROR_ are incremented by one
  2. The DATA step stops execution
  3. The descriptor portion of the data set is written
  4. The values of variables are reset to missing in the PDV

5) A raw data record is shown below:

07Jan2002

Which one of the following informats would read this value and store it as a SAS date value?

  1. date9.
  2. ddmonyy9.
  3. ddMMMyy9.
  4. ddmmmyyyy9.

6) The following SAS program is submitted:

data newdata;

set sasdata.origin (firstobs = 75 obs = 499);

run;

The SAS data set SASDATA.ORIGIN contains 1000 observations. How many observations does the ALLOBS data set contain?

  1. 75
  2. 425
  3. 499
  4. 1000

7) The observations in the SAS data set TEST are ordered by the values of the variable SALARY. The following SAS program is submitted:

proc sort data = test out = testsorted;

by NAME;

run;

Which one of the following is the result of the SAS program?

  1. The data set TEST is stored in ascending order by values of the NAME variable.
  2. The data set TEST is stored in descending order by values of the NAME variable.
  3. The data set TESTSORTED is stored in ascending order by values of the NAME variable.
  4. The data set TESTSORTED is stored in descending order by values of the NAME variable.

8) Which one of the following SAS statements correctly renames two variables?

  1. data dept2; set dept1 rename = (jcode = jobcode) (sal = salary));
  2. data dept2; set dept1 (rename = (jcode = jobcode sal = salary));
  3. data dept2; set dept1 (rename = jcode = jobcode sal = salary);
  4. data dept2; set dept1 (rename = (jcode jobcode) (sal salary));

9) Which of the following statements is true regarding BY-group processing?

  1. BY variables must be either indexed or sorted.
  2. Summary statistics are computed for BY variables.

C BY-group processing is preferred when you are categorizing data that contains few variables.

  1. BY-group processing overwrites your data set with the newly grouped observations.

10) In the following program, complete the statement so that the program stops generating observations when Distance reaches 250 miles or when 10 gallons of fuel have been used.

data work.go250;

set perm.cars;

do gallons=1 to 10 ... ;

Distance=gallons*mpg;

output;

end;

run;

  1. while(Distance<250)
  2. when(Distance>250)
  3. over(Distance le 250)
  4. until(Distance=250)

Section 2: Coding

Q.11. Create a folder “final624” in your desktop and create library ‘final’ to link that folder. Copy and paste the output from Log window showing successful creation of final library in final624 folder. This library will be referred throughout this homework.                                                                                     

Q.12. (a) Create sas data demo in final library which reads the following data(copy and paste the following data after the Datalines or Cards statement, do not modify the data). The variables used (in order) are: St_Name, ID, Name, Income, DOB, Race, and City.

Palm Street    2 Calvin 123456 10/05/1988 H Chesapeake

Cherry Blvd.   4 Smithsonian 83456 11/23/1982 AA Virginia Beach

Lincoln Avenue 6 Anjali 134500 07/07/1979 A Portsmouth

              8 Smith 123456 06/07/1977 W Suffolk

Fairfield Rd.  9 Alexa 88000 05/23/1987 W 

Print the data, the printed demo data should look like (Pay attention to the column headings):

(If you are not able to create the data demo, you can still use the demo data (provided in BB), and print it to look like below. If you use the given demo SAS data, you will lose 5 points of creating the data from the first part.)

(b) Create demo1 data by using demo data and add a column Tax which shows 10% tax on Income. Also, rename the Race as Ethnicity and label Str_name as Street Name. The printed output should look like:    

(c) Create a permanent format ethn such that

H= Hispanics

AA= African Americans

A= Asians and

W=Whites

Apply this ethn format to demo1 data. The final printout after applying ethn format should look like:                             

(d) Export demo1 data as demo.csv in the final folder of your desktop. Print the log showing that it is successfully exported. 

Q.13. Dept1, dept2 and cost data have patient information from different years. Patient from one year is different from another year but patient with same ID within the year is the same.

(a) Import 3 comma separated value (.csv) data sets- dept1.csv, dept2.csv, and cost.csv in final library as dept1, dept2, and cost data sets. Print the log showing that these files are successfully imported.              

(if you are not able to import these files, you can still use SAS files from BB, but you won’t get 2 points of importing these files).

(b) Concatenate dept1 and dept2 data and create new data dept1_2. dept1_2 data should look like this: (Hint: you can review the lecture note Week 8, Data Manipulation …, page 36). 

 

(c) Create final_cost data by match merging of dept1_2 and cost data. final_cost should look like (only a part of the final_cost is printed below). The final_cost data will have 54 observations similar to the cost data but it has one more column, Gender, than the cost data.

[2+2]

(d) Create data final_cost1 by using final_cost. In final_cost1 data there will be one column for Total_Cost which accumulates the cost for each patient over different visits. The final_cost1 data should look like (only a part is presented). (Hint: first. is helpful, you can also review the WEEK 8 lecture notes on Data Manipulations.).  [1+3]                                                   

(if you were unable to create final_cost data in part (c ), you can use the given final_cost data)

(e) Modify the code in part (d) to create an output which only shows the Total_cost for each patient with the number of visits. The output should look like (Hint: Last. is a useful command).

(f) Create a report (ditto) by including the columns Year, Patient_ID, Gender, visit, Cost and Tax. using final_cost data. Tax is computed variable which is 8% of Cost. Also, for each Patient_ID, total tax and total cost is shown.                                                                           

(Hint: BREAK, RBREAK, COMPUTE statements, BREAK statement with Header=Style are useful in PROC REPORT, check header and footnotes carefully)

Q.14. A person invested $8,000 in year 2017. If the bank gives 1% interest every month, when the total accumulated money will cross $100,000 threshold. Please, provide the exact year and month by coding (Hint: Use Do loop; RETAIN statement is useful).         

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

852 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

895 Answers

Hire Me
expert
Husnain SaeedComputer science

753 Answers

Hire Me
expert
Atharva PatilComputer science

828 Answers

Hire Me

Get Free Quote!

352 Experts Online