Statistics 4910/6250: Homework 


Homework 10:

Read the remaining 4 Chapters, 21, 22, 23, 24.  I would suggest paying attention to Ch. 24, this is a Chapter that is full of potentially useful ideas.  The other chapters are useful also.  Do some of the problems.  This hw will not be collected.

Homework 9:

Read Chapter 25, do problem 1, 2

Read Chapter 26, do problems 1, 4, 5

Homework 8:

Read Chapter 18, do problem 1, 2, 3, 6

Read Chapter 19, do problem 4

Read Chapter 20, do problems 8, 9

Homework 7:

Read Chapter 16, do problems 1, 2, 3 college.sas  college.sas7bdat

Read Chapter 17, do problem 5

Homework 6:

Read Chapter 14, do problems 2, 4

Read Chapter 15, do problems 1, 4, 5

From the Create_Datasets.sas file from the book files you can find the Mixed data.

*Data set BLOODPRESSURE;

data learn.bloodpressure;

input Gender : $1.

Age

SBP

DBP;

datalines;

M 23 144 90

F 68 110 62

M 55 130 80

F 28 120 70

M 35 142 82

M 45 150 96

F 48 138 88

F 78 132 76

;

From the Create_Datasets.sas file from the book files you can find the college data.

*Data set COLLEGE;

proc format library=learn;

value $yesno 'Y','1' = 'Yes'

'N','0' = 'No'

' ' = 'Not Given';

value $size 'S' = 'Small'

'M' = 'Medium'

'L' = 'Large'

' ' = 'Missing';

value $gender 'F' = 'Female'

'M' = 'Male'

' ' = 'Not Given';

run;

data learn.college;

length StudentID $ 5 Gender SchoolSize $ 1;

do i = 1 to 100;

StudentID = put(round(ranuni(123456)*10000),z5.);

if ranuni(0) lt .4 then Gender = 'M';

else Gender = 'F';

if ranuni(0) lt .3 then SchoolSize = 'S';

else if ranuni(0) lt .7 then SchoolSize = 'M';

else SchoolSize = 'L';

if ranuni(0) lt .2 then Scholarship = 'Y';

else Scholarship = 'N';

GPA = round(rannor(0)*.5 + 3.5,.01);

if GPA gt 4 then GPA = 4;

ClassRank = int(ranuni(0)*60 + 41);

if ranuni(0) lt .1 then call missing(ClassRank);

if ranuni(0) lt .05 then call missing(SchoolSize);

if ranuni(0) lt .05 then call missing(GPA);

output;

end;

format Gender $gender1.

SchoolSize $size.

Scholarship $yesno.;

drop i;

run;

 

 

Homework 5b: (due Nov. 4)

Read Chapter 12, do problems 2, 6, 13, 17

Read Chapter 13, do problems 3

Download the free NoteTab Lite or Crimson Editor and install the software.  Open a SAS program in NoteTab or Crimson Editor to view a SAS program.  Using Windows Explorer locate the program and run the SAS program by right-clicking and using Batch Submit with SAS 9.2.  Load the .log and .lst files into NoteTab or Crimson Editor.  Try this a couple of times to get the feel for how this works.  This is sometime called running SAS in batch mode.

From the Create_Datasets.sas file from the book files you can find the Mixed data.

*Data set MIXED;

data learn.mixed;

input Name & $20. ID;

datalines;

Daniel Fields 123

Patrice Helms 233

Thomas chien 998

;

*Data set SOCIAL;

data social1;

input SS1 $11.;

datalines;

123-45-6789

001-34-9876

007-77-6767

102-43-9182

;

*Data set SOCIAL2;

data social2;

input SS2 $11.;

datalines;

123-45-6789

001-43-9876

007-77-6767

485-46-1182

102-43-9188

;

proc sql;

create table learn.social as

select *

from social1, social2;

quit;

*Data set PERSONAL;

data learn.personal;

infile datalines missover;

input #1

SS $11.

Gender : $1.

AcctNum : $5.

DOB : mmddyy10.

#2 (Food1-Food8)(: $10.);

format DOB mmddyy10.;

label SS = "Social Security Number"

AcctNum = "Account Number"

DOB = "Date of Birth";

datalines;

123-45-6789 M 0192M 11/15/1949

Eggs Pancakes Sausage Toast Milk Coffee Beef Chicken

013-54-9388 F 9981S 1/2/1981

Pancakes Milk Chicken

112-11-1309 M 1322M 03/29/1988

Beef Toast Eggs Coffee

778-44-4655 F 9899M 7/4/1981

Pancakes Sausauge Coffee Beef

445-45-4455 M 2938S 8/9/1977

Tea Toast

;

Homework 5a: (due Oct. 28)

Read Chapter 11, do problems 1, 5, 8

From the Create_Datasets.sas file from the book files you can find the Health and Psych data.

*Data set HEALTH;

data learn.health;

input Subj : $3.

Height

Weight;

datalines;

001 68 155

003 74 250

004 63 110

005 60 95

;

*Data set PSYCH;

data learn.psych;

input ID : $3. Ques1-Ques10 Score1-Score5;

datalines;

001 1 3 2 4 5 4 3 4 5 4 90 92 93 90 88

002 3 3 . . 3 4 5 5 1 . 95 . . 86 85

003 . . . . 5 5 4 4 3 3 88 87 86 85 84

004 5 3 4 5 . 5 4 3 3 . 78 78 82 84 .

005 5 4 3 2 1 1 2 3 4 5 92 93 94 95 99

;

Homework 4:

Read Chapter 8, do problems 1, 2, 7, 8, 11, 13

Read Chapter 9, do problems 8, 9

Read Chapter 10, do problems 1, 2, 3    blood.txt    hosp_Suess.xls

Homework 3:

Read Chapter 5, do problems 1, 2, 4

Read Chapter 6, do problems 1    drugtest.xls

Read Chapter 7, do problems 1

Homework 2:

Read Chapter 3, do problems 1, 2, 7, 10

Read Chapter 4, do problems 1, 2

Homework 1:

Read Chapter 1, do problems 3, 4, 5

Read Chapter 2, do problems 1, 2