CH8 exercise

CH8 exercise - STAT1303A Data Management 8. Rearranging...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
STAT1303A Data Management 8. Rearranging Data Exercise 8 1. Run the program here to create a temporary SAS data set (MONTHSALES): data monthsales; input month sales; /* add your line(s) here */ datalines; 1 4000 2 5000 3 . 4 5500 5 5000 6 6000 7 6500 8 4500 9 5100 10 5700 11 6500 12 7500 ; Modify this program so that a new variable, SUMSALES, representing Sales to date, is added to the data set. Be sure that the missing value for Sales in month 3 does not result in a missing value for SUMSALES. 2. Modify the program here so that each observation contains a subject number (SUBJ), starting with 1. data test; input Score1-Score3; /* add your line(s) here */ datalines; 90 88 92 75 76 88 88 82 91 72 68 70 ; 3. Count the number of missing values for the variables A, B, and C in the MISSING data set. Add the cumulative number of missing values to each observation (use variable names MISSA, MISSB, and MISSC). Use the MISSING function to test for the missing values. HKU STAT1303A (2009-10, Semester 1) 8 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STAT1303A Data Management 8. Rearranging Data 4. Create and print a data set with variables N and LOGN, where LOGN is the natural logarithm of N (the function is LOG). Use a DO loop to create a table showing values of N and LOGN for values of N going from 1 to 20. 5. Repeat Q4, except have the range of N go from 5 to 100 by 5. 6. Use an iterative DO loop to plot the following equation y = 3 x 2 5 x + 10 . Use values of x from 0 to 100, with an increment of 10. Use the following program to display the resulting equation. proc gplot; plot y * x; run; quit; 7. Use an iterative DO loop to plot the following equation Logit = log( p= (1 p )) . Use values of p from 0 to 1 (with a point at every .05). Using the following GPLOT statements will produce a very nice plot. proc gplot; plot Logit * p; run; quit; 8. You have the following seven values for temperatures for each day of the week, starting with Monday: 70, 72, 74, 76, 77, 78, and 85. Create a temporary SAS data set (TEMPERATURES) with a variable (DAY) equal to Mon, Tue, Wed, Thu, Fri,
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

CH8 exercise - STAT1303A Data Management 8. Rearranging...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online