Ex1 - ** **; ** AUTHOR: Cheolwoo Park **; ** PURPOSE:...

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

View Full Document Right Arrow Icon
dm 'log;clear;output;clear;'; options ps=50 ls=75 pageno=1; o ods rtf file="K:\6360\InClassExercise\Exercise1\Ex1solution.rtf"; o *1-1; *The following title will appear as the first line of every page in the output window; title1 'Problem 1-1'; t *a. Write a DATA step to read in these values.; data grades; infile 'K:\6360\InClassExercise\Exercise1\grades.txt'; input Gender $1. Eng Hist Math Sci; run; r *b. Enter the data by using DATALINES statement.; data grades; input Gender $1. Eng Hist Math Sci; datalines; M 80 82 85 88 F 94 92 88 96 M 96 88 89 92 F 95 80 92 92 ; run; r *c. Add labels to the above variables. ; data grades; set grades; label Gender = 'Gender' Eng = 'English Score' Hist = 'History Score' Math = 'Math Score' Sci = 'Science Score'; run; r *d. Include an assignment statement computing the average of the four test scores.; data grades; set grades; Avg=(Eng+Hist+Math+Sci)/4; run; r *e. List the contents of this data set; proc print data=grades label; run; r *1-2; *********************************************************************;
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ** **; ** AUTHOR: Cheolwoo Park **; ** PURPOSE: Problem 2 **; *********************************************************************; *The following title will appear as the first line of every page in the output window; title1 'Problem 1-2'; t *a; data portfolio; infile 'K:\6360\InClassExercise\Exercise1\stocks.txt'; input Symbol $ Price Number; value=Number*Price; run; r *b; title "listing of Portfolio"; proc print data=portfolio; run; r *c; data portfolio; set portfolio; drop Price Number; run; r *d; title "listing of Portfolio"; proc print data=portfolio (obs=3); run; r *1-3; *a; proc import out= Vote DATAFILE= "K:\6360\InClassExercise\Exercise1\political.xls" DBMS=EXCEL REPLACE; GETNAMES=NO; run; r data Vote; set Vote; State=F1; Party=F2; Age=F3; keep State Party Age; run; r *b; title "listing the last two obs."; proc print data=Vote (firstobs= 4 obs=5); run; r ods rtf close;...
View Full Document

This note was uploaded on 06/06/2011 for the course STAT 4360 taught by Professor Park during the Spring '11 term at University of Georgia Athens.

Page1 / 2

Ex1 - ** **; ** AUTHOR: Cheolwoo Park **; ** PURPOSE:...

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

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