Data to project exam in STK4900/9900 spring 2012
# Below are given commands for reading the data sets of the project exam 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 (both STK4900 and STK9900)
lungfunction=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v12/lungfunction.txt",header=T)
# PROBLEM 2 (both STK4900 and STK9900)
insurance=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v12/insurance.txt",header=T)
# PROBLEM 3 (both STK4900 and STK9900)
drug=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v12/drug.txt",header=T)
# In questions a and b of the problem you should group according to the values of the numeric covariates age and number of earlier treatments.
# You may create a categorical variable "agegroup" for groped age (20-24 years, 25-29 years, 30-39 years, 40 years or more) by the command:
drug$agegroup=cut(drug$age,breaks=c(20,25,30,40,60),right=F,labels=1:4)
# You may create a categorical variable "nogroup" for groped number of previous treatments (0-1, 2-4, 5-9, 10 or more) by the command:
drug$nogroup=cut(drug$no,breaks=c(0,2,5,10,50),right=F,labels=1:4)
# PROBLEM 4 (only STK9900)
birthweight=read.table("http://www.uio.no/studier/emner/matnat/math/STK4900/v12/birthweight.txt", header=T)