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

Introduction to epidemiology assignment -assignment should

Introduction to Epidemiology Assignment - Assignment should be typed, with adequate space left between questions. Read the following paper, and answer the questions below: Sundquist K., Qvist J. Johansson SE., Sundquist ...

Question 1 many high school students take the ap tests in

Question 1. Many high school students take the AP tests in different subject areas. In 2007, of the 144,796 students who took the biology exam 84,199 of them were female. In that same year,of the 211,693 students who too ...

Basic statisticsactivity 1define the following terms1

BASIC STATISTICS Activity 1 Define the following terms: 1. Statistics 2. Descriptive Statistics 3. Inferential Statistics 4. Population 5. Sample 6. Quantitative Data 7. Discrete Variable 8. Continuous Variable 9. Qualit ...

Question 1below you are given the examination scores of 20

Question 1 Below you are given the examination scores of 20 students (data set also provided in accompanying MS Excel file). 52 99 92 86 84 63 72 76 95 88 92 58 65 79 80 90 75 74 56 99 a. Construct a frequency distributi ...

Question 1 assume you have noted the following prices for

Question: 1. Assume you have noted the following prices for paperback books and the number of pages that each book contains. Develop a least-squares estimated regression line. i. Compute the coefficient of determination ...

Question 1 a sample of 81 account balances of a credit

Question 1: A sample of 81 account balances of a credit company showed an average balance of $1,200 with a standard deviation of $126. 1. Formulate the hypotheses that can be used to determine whether the mean of all acc ...

5 of females smoke cigarettes what is the probability that

5% of females smoke cigarettes. What is the probability that the proportion of smokers in a sample of 865 females would be greater than 3%

Armstrong faber produces a standard number-two pencil

Armstrong Faber produces a standard number-two pencil called Ultra-Lite. The demand for Ultra-Lite has been fairly stable over the past ten years. On average, Armstrong Faber has sold 457,000 pencils each year. Furthermo ...

Sppose a and b are collectively exhaustive in addition pa

Suppose A and B are collectively exhaustive. In addition, P(A) = 0.2 and P(B) = 0.8. Suppose C and D are both mutually exclusive and collectively exhaustive. Further, P(C|A) = 0.7 and P(D|B) = 0.5. What are P(C) and P(D) ...

The time to complete 1 construction project for company a

The time to complete 1 construction project for company A is exponentially distributed with a mean of 1 year. Therefore: (a) What is the probability that a project will be finished in one and half years? (b) What is the ...

  • 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