Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Statistics and Probability Expert

Assignment

Instructions: Read lectures notes and sample codes I used in class carefully before starting your homework. You need to submit a .sas file on ANGEL

(Lessons > Homework > dropbox for Homework2).

1. (Column Input and Assignment Statement). Below is a small dataset of grades for 6 students.

Name

Gender

Homework

Midterm

Final

Beck

Male

90

88

75

Christal

Female

100

85

80

Gavetti

Female

80

77

71

Easton

Male

90

82

76

Mattiace

Male

60

67

53

Chen

Female

85

83

68

Table 1: Grades

(a) Use column input to read the dataset above called Grades and store it in the folder MyLibrary1

(b) Define Two new variables Score1 and Score2, where

Score1 = 40% Homework +20% Midterm + 40% Final, and Score2 = 40% Midterm + 60% Final.

(c) Calculate the final score. The final score, represented by a new variable fs, is defined to be the maximum of the following three variables:

Final, Score1 and Score2.

(d) Curve the final score fs. The curved new final score, represented by newfs, is defined as

newfs = 0.7 × fs + 30

(e) Round the new final score newfs to the nearest multiple of 5. (Hint: Use round function,

round(argument1, argument2), read SAS documentation for more details.)

(f) Print out the whole dataset, including all the new variables you created except the variable

Gender. (Usevarstatement).

2. (Formmated Input). Below is a dataset of all the games between Argentina and Germany in the FIFA World Cup. The descriptions of the variables are:

• game: the number of the game
• year: the year of the World Cup
• date: the date of the game
• stage: the stage of the game (a character variable)
• Arg: the score of Argentina
• Ger: the score of Germany
• Attendence: the number of audience

game

year

date

stage

Arg

Ger

Attendance

1

1958

08Jun1958

1st Round, Group1

1

3

31,156

2

1966

16Jul1966

1st Round, Group2

0

0

46,587

3

1986

29Jun1986

Final Game

3

2

114,600

4

1990

08Jul1990

Final Game

0

1

73,603

5

2006

30Jun2006

1/4 Finals

1

1

72,000

6

2010

03Jul2010

1/4 Finals

0

4

64,100

7

2014

13Jul2014

Final Game

0

1

74,738

Table 2: Germany vs Argentina in World Cup

(a) Use formatted input to read the dataset above called games. When reading the dataset (1) use an absolute pointer control to read year and date, and use a relative pointer controls to read stage and Attendance; (2) Use informat dateW. for variable 'date' and use informat commaW. for variable 'Attendance', where W is an integer which specifies the number of columns that variable will occupy.

(b) Set the page size to 50, line size to 80, center the output, and suppress the date and time when the output was created.

(c) Print the data set games. (1) Remember formatted input does not imply formatted output. Use format statement to format your output; (2) Add a title for this dataset.

3. (IF-THEN-ELSE Statement and Create a List Report). We have the following small dataset called HealthReport

Subj

Fname

Lname

Gender

Height

Weight

Date

Cal

1024

Alice

Smith

Female

65

125

12/01/95

2,036

1167

Maryann

White

Female

68

140

12/02/95

1,800

1168

Thomas

Jones

Male

 

190

01/05/96

2,302

1201

Benedictine

Arnold

Male

68

190

11/30/95

2,432

1302

Felicia

Ho

Female

63

115

01/01/96

1,972

1344

James

Hunter

Male

70

188

12/15/95

1,869

Table 3: Health Examination Report The columns, from left to right, represent the following variables:

Variable Name

Descriptions

Variable Type

Subj

Subject number

Numeric

Fname

First name

Character

Lname

Last name

Character

Gender

Gender

Character

Height

Height (lbs.)

Numeric

Weight

Weight (inches)

Numeric

Date

Date of measurement

Numeric

Cal

Calorie

Numeric

Table 4: Descriptions of variables

(a) Read the dataset above into SAS (pay attention to length and format of variables), and change the SAS system settings as follows:

linesize = 64, no current date and time, no page number

(b) Use assignment statement to create a new numeric variable BMI. BMI (Body mass index) is a person's weight divided by the square of his/her height. In other words, it is defined to be

BMI = Weight / Height2

where the weight unit is kilogram and the height unit is meter. So first you need to convert pound into kilogram and convert inch into meter (1 kilogram = 2.205 pounds, 1 inch = 0.0254 meter), and then calculate BMI.

(c) Use IF-TEHN-ELSE statement to create a new character variable Result. The value of variable

Result is determined by the value of BMI according to the following table.

Note: the length of the variable Result can be longer than 8. You should specify an appropriate length for variable Result with length statement. The length statement should be placed before the input statement.

Value of BMI     Value of Result
Missing             'Missing'
≤ 25                'Underweight'
> 25 and ≤       30 'Normal'
> 30                'Overweight'

(d) Use SORT procedure to sort the dataset Health Report first by the variable Gender in an ascending order, and then by the variable Lname in a descending order. The sorted dataset should be saved in another SAS dataset named Srtd Health Report.

(e) Print the the sorted dataset Srtd Health Report. When printing the dataset,

1. Use variable Lname and Fname as the identification variables (Use ID statement).

2. Split the dataset into two groups by variable Gender. Calculate the sum of Cal for each group.

3. Use LABEL statement to assign labels to all variables to make your output more readable. Particularly, use the descriptions in Table 2 as the labels. You can place the LABEL statement either in the DATA step or in the PRINT procedure. Use labels rather than the variable names when printing the dataset.

4. Add a TITLE ('Health Examination Report Sorted by Last Name') and FOOTNOTE for this dataset. The content of the FOOTNOTE is: ' BMI = Weight(kg)/(Height(m))^2'.

5. Use the correct FORMAT for variables Date and Cal.

(f) Use Where statement to print the first and last names of female students who are underweight.

Statistics and Probability, Statistics

  • Category:- Statistics and Probability
  • Reference No.:- M91897641

Have any Question?


Related Questions in Statistics and Probability

How does the cost of capital affect capital investments

How does the cost of capital affect capital investments that the firm makes? Cite examples.

The time required by students to complete an organic

The time required by students to complete an organic chemistry examination is normally-distributed with a mean of µ = 200 minutes and a standard deviation of σ = 20 minutes. Since this particular class is a large lecture ...

A sample of 100 randomly selected students found that the

A sample of 100 randomly selected students found that the proportion of students planning to travel home for Thanksgiving is 0.68. What is the Standard Deviation of the sampling distribution?

The ph acidity of the liquor is critical for regulating dye

The pH (acidity) of the liquor is critical for regulating dye uptake and hence the final color. There are 5 kettles, all of which receive dye liquor from a common source. Past data show that pH varies according to a Norm ...

1 explain the meaning of the following termslocation

1) Explain the meaning of the following terms: Location Quotient Coefficient of Specialization Coefficient of Localization 2) Explain and contrast the z-score and the coefficient of variation. 3) Define and describe the ...

A researcher working at a particular company wants to know

A researcher working at a particular company wants to know if workers' health would improve if they were given extra days 'off. In this company, all workers undergo a standard physical exam twice a year and after each ex ...

You need to have accumulated savings of 2 million by the

You need to have accumulated savings of $2 million by the time that you retire in 20 years. You currently have savings of $200,000. How much do you need to save each year to meet your goal if your savings earn a return o ...

1 this table summarizes the results from

1) This table summarizes the results from along+termrandomized clinicaltrial to  determine whether aspirin reduces the risk of heart attack. Researchers  randomly assigned a large sample of healthy male physicians (22,07 ...

Lets see how much you have been paying attention for your

Let's see how much you have been paying attention. For your first Pause-Problem in this chapter, please tell me three things that differentiate parametric from non-parametric tests (Hint: There are actually four, so see ...

A mail order supplier advertises same-day service on every

A mail order supplier advertises same-day service on every order. Recently, the movement of orders has not gone as planned. The director of customer service has completely redone the method of order handling. The goal of ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As