############################################## # # exp2_prep.R GRaab July 04 # # This file in d:/aprojects/peas/web/exemp2/pre-processing # # Assume that R is first started from this directory and # this file sourced into R # # data stored in d:/aprojects/peas/web/exemp2/data/ex2.Rdata # # system must download and install the foreign library # ############################################## library(foreign) shs_nc<-read.xport("../data/ex2_nc.xpt") shs_nc$SHS_6CLA<-factor(shs_nc$SHS_6CLA,levels=1:6,labels=c('large urban','oth urban', 'accessible towns','remote towns','accessible rural','remote rural')) shs_nc$COUNCIL<-factor(shs_nc$COUNCIL,levels=c(100,110,120,130,150,170,180,190,200,210,220, 230 , 235, 240, 250, 260, 270 , 280 , 290 , 300 , 310 , 320 , 330 , 340, 350, 355, 360 , 370, 380 ,390 ,395,400), labels=c("Aberdeen City","Aberdeenshire","Angus","Argyll & Bute","Clackmannanshire", "Dumfries & Galloway","Dundee City","East Ayrshire","East Dunbartonshire","East Lothian","East Renfrewshire", "Edinburgh, City of","Eilean Siar","Falkirk","Fife","Glasgow City","Highland","Inverclyde","Midlothian", "Moray","North Ayrshire","North Lanarkshire","Orkney Islands","Perth & Kinross","Renfrewshire","Scottish Borders", "Shetland Islands","South Ayrshire","South Lanarkshire","Stirling","West Dunbartonshire","West Lothian")) shs_nc$SEX<-factor(shs_nc$SEX,levels=1:2,labels=c("male","female")) shs_nc$RC5<-factor(shs_nc$RC5,levels=1:5,labels=c("Up to 1 hour a week","Over 1 hour, up to 5 hours ", "Over 5 hours up to 10 hours" , "Over 10 hours up to 20 hours","Over 20 hours")) shs_nc$EMP_STA<-factor(shs_nc$EMP_STA,levels=1:13,labels=c( "Self employed","Employed full time","Employed part time", "Looking after the home or family","Permanently retired from work","Unemployed and seeking work ", "At school ","In further/higher education","Gov't work or training scheme","Permanently sick or disabled", "Unable to work because short-term ill","Pre school","Other")) shs_nc$GROUPINC<-factor(shs_nc$GROUPINC,levels=1:6,labels=c("missing","under 10K","10-20K","20-30k","30-50k","50K+")) save.image("C:/Documents and Settings/gillian raab/My Documents/aprojects/peas/web/exemp2/ex2_nc.RData")