Data to the project exam for the new/deferred exam in STK4900 and STK9900

 

# Below are given commands for reading the data sets into R.

# If you use another program than R, you should send an e-mail to borgan@math.uio.no to get the data.

 

#PROBLEM 1

fuel=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v14/fuel.txt", header=T)

 

#PROBLEM 2

birthweight=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v14/birthweight.txt", header=T)

 

#PROBLEM 3

drug=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v14/drug.txt", header=T)

 

# In questions a and b of the problem you shall use a categorical covariate for age group and number of previous treatments.

 

# In order to create a categorical variable for the age groups 20-27 years, 28-32 years, 33-37 years, and 38-59 years, you may give the command:

drug$agegr<-cut(drug$age,breaks=c(19,27,32,37,59),labels=1:4)

 

# Similarily the command

drug$nogr<-cut(drug$no,breaks=c(-1,1,3,7,40),labels=1:4)

creates a categorical variable corresponding to 0-1, 2-3, 4-7, and 8-40 previous treatments.