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

684 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

677 Answers

Hire Me
expert
Husnain SaeedComputer science

852 Answers

Hire Me
expert
Atharva PatilComputer science

820 Answers

Hire Me
April
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
1
2
3
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30