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

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