{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CH12 exercise - STAT1303A Data Management 12 Data...

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

View Full Document Right Arrow Icon
STAT1303A Data Management 12. Data Presentation Exercise 12 1. Run the program here to create a temporary SAS data set called VOTER. data voter; input Age Party : $1. (Ques1-Ques4)($1. + 1); datalines; 23 D 1 1 2 2 45 R 5 5 4 1 67 D 2 4 3 3 39 R 4 4 4 4 19 D 2 1 2 1 75 D 3 3 2 3 57 R 4 3 4 4 ; Add formats for AGE (0°30, 31°50, 51°70, 71+), PARTY (D = Democrat, R = Republican), and QUES1-QUES4 (1=Strongly Disagree, 2=Disagree, 3=No Opinion, 4=Agree, 5=Strongly Agree). In addition, label QUES1-QUES4 as follows: QUES1 The president is doing a good job QUES2 Congress is doing a good job QUES3 Taxes are too high QUES4 Government should cut spending Note: Use PROC PRINT to list the observations in this data set and PROC FREQ to list frequencies for the four questions. (The default action of PROC PRINT is to head each column with a variable name, not the label. To use labels as column headings, use the LABEL option with PROC PRINT.) 2. You want to see frequencies for Questions 1 to 4 from the previous question. However, you want only three categories: Generally Disagree (combine Strongly Disagree and Disagree), No Opinion, and Generally Agree (combine Agree and Strongly Agree). Accomplish this using a new format for QUES1-QUES4. HKU STAT1303A (2009-10, Semester 1) 12 ° 1
Background image of page 1

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

View Full Document Right Arrow Icon
STAT1303A Data Management 12. Data Presentation 3. Use the data set COLLEGE for Q3-Q11. Produce the following table. Note that the last row in the table represents all subjects. Demographics from COLLEGE Data Set __________________________________ | | SchoolSize | | |____________________| | |Large |Medium|Small | |_____________|______|______|______| |Gender | | | | |_____________| | | | |F | 10| 23| 26| |_____________|______|______|______| |M | 8| 18| 11| |_____________|______|______|______| |Scholarship | | | | |_____________| | | | |No | 16| 36| 32| |_____________|______|______|______| |Yes | 2| 5| 5| |_____________|______|______|______| |All | 18| 41| 37| |_____________|______|______|______| 4. Produce the following table. Note that the ALL column has been renamed Total. Demographics from COLLEGE Data Set ________________________________________________ | | Gender | Scholarship | | | |_____________|_____________| | | | F | M | No | Yes |Total | |_____________|______|______|______|______|______| |SchoolSize | | | | | | |_____________| | | | | | |Large | 10| 8| 16| 2| 18| |_____________|______|______|______|______|______| |Medium | 23| 18| 36| 5| 41| |_____________|______|______|______|______|______| |Small | 26| 11| 32| 5| 37| |_____________|______|______|______|______|______| |Total | 59| 37| 84| 12| 96| |_____________|______|______|______|______|______| HKU STAT1303A (2009-10, Semester 1) 12 ° 2
Background image of page 2
STAT1303A Data Management 12. Data Presentation 5. Produce the following table. Note that the ALL column has been renamed Total and GENDER has been formatted.
Background image of page 3

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

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}