Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Statistics and Probability Expert

Knowledge Questions

1. When using pointer control to read data in fixed columns, the _____ symbol moves the pointer to a specific column? This method is considered _____________ pointer control.

2. When using pointer control to read data in fixed columns, the _____ symbol moves the pointer over a specific number of columns? This method is considered _____________ pointer control.

3. When used during a data step, the _______ statement selects specific variables to include in the output SAS dataset, while the _____ option in the SET statement selects specific variables to be read in from the input SAS dataset.

4. Using Label and Format statements during a data step ___________ assigns these attributes to variables, while using these statements during PROC PRINT __________ assigns these attributes to variables.

5. There are three statements that can be used to eliminate specific observations during a data step. These are the __________ statement, the __________ statement and the __________ statement.

Programming Assignment
1. Concatenating SAS Data Sets

The goal is to create a second-quarter data set for International Airlines' Vienna hub. Write a data step that combines target information for April, May, and June into one data set. This data is currently stored in separate data sets by month as follows:
· ia.aprtarget
· ia.maytarget
· ia.juntarget
a. As a first step, browse the descriptor portion of each data set to determine the number of observations, as well as the number of variables and their attributes. How many observations does each data set contain?
· ia.aprtarget _____
· ia.maytarget _____
· ia.juntarget _____
What are the names of the variables in each data set?
ia.aprtarget _____________________________________________________
ia.maytarget
___________________________________________________
ia.juntarget
________________________________________________

b. Now write a data step to concatenate the three data sets and create a new data set called work.q2vienna. Use the RENAME= option of the Set statement to rename any variables necessary to combine the datasets.

c. Browse the SAS log. There should be no warning or error messages.
· How many observations are written to the new data set?
· How many variables does the new data set contain?
d. Submit a PROC PRINT step to verify the data.
e. Now modify the DATA step to create two new variables: TotalTar and TotalRev.
· TotalTar is the total targeted number of economy and first class passengers.
· TotalRev is the total revenue expected from economy and first class passengers.
Keep only the variables FlightID, Destination, Date, TotalTar, and TotalRev.
Submit a PROC PRINT step to verify the data.

2. Merging SAS Data Sets
The weather in Birmingham, Alabama on December 15, 1999, might have caused some customers to alter their shipping plans. Investigate how much cargo revenue was lost on all flights out of Birmingham by comparing the targeted revenue with the actual revenue.

a) Sort the data set ia.target121999 into a temporary data set called work.sort_b. Sort by the variable FlightID. Use the WHERE statement to create a subset for Birmingham on December 15, 1999. where Date='15dec1999'd and Origin='BHM';

b) Sort the data set ia.sales121999 into a temporary data set called sort_s. Sort by the variable FlightID. Use the WHERE statement to create a subset for Birmingham on December 15,1999. where Date='15dec1999'd and Origin='BHM';

c) Create a new temporary data set called compare by merging the sort_b and sort_s data sets by the variable FlightID. Subtract CargoRev from CargoTarRev to create a new variable called LostCargoRev.

d) Print the merged data set compare (print only the variables CargoTarRev, CargoRev, and LostCargoRev) and label the LostCargoRev variable. Format the LostCargoRev variable with a dollar sign and two decimal digits.

3. Creating Frequency Reports
a. Use PROC FREQ to create a report using the data1.sanfran data set that displays the frequency count for each Destination, and a separate frequency count for each DepartDay. Add an appropriate title to each frequency table. Your output should look like this:
SAS Output

b. You can specify many options in the TABLES statement to control the calculations and appearance of
a frequency table. The NOCUM option suppresses the printing of the cumulative frequencies and cumulative percentages. Modify the program from Exercise 1.a above to repeat the frequency tables,  but without the cumulative frequencies. Part of your output will look like this:

Partial SAS Output
c. Use PROC FREQ to create a two-way frequency table using the data1.sanfran data set that displays the frequency count for each Destination by DepartDay combination.

SAS Output
4. Validating Data with PROC FREQ
a. PROC FREQ is useful in checking the validity and completeness of data (i.e., invalid values stand out). Use PROC FREQ to check the validity of the variables Gender and JobCode in the data1.mechanics data set.
1) What do you notice about the values of the variable Gender?
2) What do you notice about the values of the variable JobCode?
b. Modify the previous report to display the frequency count for each Gender by JobCode. What are the JobCode values for the invalid values of Gender? (The output is not shown because it provides the answer.)

5. Creating Basic Summary Statistics
a. Generate a PROC MEANS report using the data1.sanfran data set as input to display statistics for the variables CargoRev and TotPassCap only. Remove any titles currently in effect.
b. Modify the previous report to display the data for each Destination (note: you do NOT need to sort the sanfran dataset to do this). Include the following statistics (number of observations, mean, median, mode, range and standard deviation. Limit all output to two decimal places.

Partial SAS Output (not all statistics are shown)

c. Modify the previous report to display the data for each Destination (note: you do NOT need to sort the sanfran dataset to do this). Limit the statistics to number of observations, mean and standard deviation. Limit all output to two decimal places.

6. Creating a One-Dimensional Frequency Table

Use PROC TABULATE and the data1.employees data set to produce a summary report that displays a frequency count for the variable Division with an appropriate title.

7. Creating a Two-Dimensional Frequency Table
Modify the previous report to do the following:

  •  Use a WHERE statement to display only divisions that have the word OPERATIONS in the name
  •  display the variable City in the row dimension
  •  add row and column totals
  • add an appropriate title

8. Creating a Summary Table on an Analysis Variable - Modify the previous report to do the following:

  •  display the mean of the variable Salary in the column dimension
  • display the overall mean of the variable Salary in the column dimension (Use the ALL option)
  •  display the data with dollar signs, commas, and two digits after the decimal point
  • add an appropriate title

Statistics and Probability, Statistics

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

Have any Question?


Related Questions in Statistics and Probability

Now assume that i am talking about a normally distributed

Now assume that I am talking about a normally distributed set of data: An IQ test. This IQ test has a mean of 100 and a standard deviation of 15. Find the following probabilities What is the probability that someone scor ...

You decide to research further this seemingly contradictory

You decide to research further this seemingly contradictory guidance, hypothesizing that the  true population average core body temperature  amidst higher ambient temperature and humidity levels while using an electric f ...

Heightnbspinnbspinchesnbsp69nbsp67nbsp69nbsp71nbsp70nbsp72nb

Height in inches  69  67  69  71  70  72  Weight in lbs  164  161  189  192  184  198  a) Find the equation of the regression line with height as the explanatory variable and use the regression line to find the predicted ...

Te number of accidents in a day in town a is given by x

The number of accidents in a day in town A is given by X , and the number of accidents in a day in town B is given by  Y . The joint probability function for  X   and  Y Y is  f ( x , y )=964 x ! y !   for  x =0,1,2,3 an ...

You ask your roommate to mail a letter for you suppose

You ask your roommate to mail a letter for you. Suppose there is a 0.21 probability your roommate will forget to mail it.  Should your roommate mail your letter, there is a 0.9 probability that Canada Post will deliver t ...

Consider the study of two insect populations at two exper-

Consider the study of two insect populations at two exper- imental stations. At station A, the egg hatch rate (computed from a set of 100 eggs at a time) is known to follow approximately a normal distribution with mean 6 ...

According to an article in the american heart associations

According to an article in the American Heart Association's publication Circulation, 24% of patients who had been hospitalized for an acute myocardial infarction, did not fill their cardiac medication by the seventh day ...

Let random variable x represent the number of heads when a

Let random variable x represent the number of heads when a fair coin is tossed two times.  (a) Construct a table describing the probability distribution.   x P(x) 0  1  2   (b) Determine the mean and standard deviation o ...

Please help me find out how to calculate stock pricewhat is

Please help me find out how to calculate stock price. "What is the price of Company A's stock.We know company A pay dividend twice a year. And its beta=1.5 Government bond's Coupon is 8.8 and Yield is 5%(which one you sh ...

You work at patty king home of the cinnamon roll breakfast

You work at Patty King, home of the Cinnamon Roll Breakfast Sandwich, as the manager of the early morning shift. You want to estimate the probability that at least 5 customers enter the store in the next 10 minutes. Woul ...

  • 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