Calculate the sum of cal for each group

Assignment Help Basic Statistics
Reference no: EM131142141

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.

Reference no: EM131142141

Questions Cloud

Which of the following securities are correctly priced : The market has an expected return of 10% and the risk-free rate is 4%. Based on the security market line implied by this information, which of the following securities are correctly priced and which areover/underpriced?
Calculate the primary voltage and load impedance : (a) primary voltage, (b) load impedance, (c) load impedance referred to the primary, and (d) the real and reactive power supplied to the primary winding.
Analyze the process available after adverse medical events : Analyze the stages and impact of malpractice in health care (provide examples of malpractice cases and their impact on health care). Analyze the process available after adverse medical events in health care.
Create and communicate the company vision : What does leadership mean in the 21st century? Are you a leader or a manager? Create and communicate the company vision and Establish strategic goals related to the vision
Calculate the sum of cal for each group : Split the dataset into two groups by variable Gender. Calculate the sum of Cal for each group. Use variable Lname and Fname as the identification variables (Use ID statement).
What was nominal gdp in 2002 for this economy : What was nominal GDP in 2002 for this economy? What was it in 2003? What was the percentage rate of change in nominal GDP between 2002 and 2003?
Why did the court uphold the will inzimmerman : What law flows from these cases? What "precedent" was relied upon by the courts in these cases? If the facts were slightly different, you can still "apply" the law from the case and try to analyze what a judge would do with the new facts, by apply..
Compute the percent voltage regulation : If the applied voltage at the terminals of the primary is 1000 V, determine V2 at the load terminals of the transformer, neglecting magnetizing current.
What is the value of the company’s stock if the required : The company wishes to continue this dividend growth indefinitely. What is the value of the company’s stock if the required rate of return is 12 percent?

Reviews

Write a Review

Basic Statistics Questions & Answers

  Average braking distance for a small car

It is advertised that the average braking distance for a small car traveling at 65 miles per hour is less than 120 feet. A transportation researcher wants to determine if the statement made in the advertisement is false. She randomly test drives 3..

  Confidence interval to estimate average age of all golfers

The owner of a local golf course wanted to determine the average age of the golfers that played on the course. In a random sample of 30 golfers that visited his course, the sample mean was 48.34 and the standard deviation was 9.327. Calculate a 90..

  An artist sells her works at the east lansing art festival

an artist sells her works at the east lansing art festival. suppose that 5 of those who stop by her booth will buy a

  Analysis of standard deviation

How do you find the z-score corresponding to a score of X = 100 for the distributions given below? How do you know what direction they are going?

  According to the national association for college

according to the national association for college admissions counseling and usa today. 19.8 of college students take at

  Partial anova table

Assume the data for the three groups are independent and the data are approximately Normal. The P-value is less than 0.01. The correct conclusion is that

  Confidence interval for simple random sample

A simple random sample of 50 items from a population with σ 6 resulted in a sample mean of 32.

  Organise the data in appropriate class intervals

Organise the data in appropriate class intervals and draw a histogram of the frequency distribution and find the Mean, Median, Range, Standard Deviation and Coefficient of Variation of the yield for the top 40 Australian companies.

  A survey on british social attitudes asked respondents if

a survey on british social attitudes asked respondents if they had ever boycotted goods for ethical reasons. the survey

  The pilots final score s is the average speed minus any

question a race pilots average rate of speed over a 720-mi course is inversely proportional to the time in minutes t

  With any statistical model we assess the fit does the model

with any statistical model we assess the fit. does the model accurately depict the truth? explain how standard

  What is the probability that a randomly chosen child has a

in the country of united states of heightlandia the height measurements of ten-year-old children are approximately

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd