importDREAM: importDREAM

Description Usage Arguments Details Value Author(s) See Also Examples

Description

The DREAM dataset is a SAS dataset where all in the Danish population that have received public funding are recorded. A number of variables are presen- ted. For a detailed description of DREAM refer to www.dreammodel.dk/ The current function can output 2 datasets from the DREAM database

The description provided must be merged from a text file with matching code and description. These text-files can be found in statistics Denmark in the area holding standard Statistics Denmark formats: "//srvfsenas1/formater/ SAS formater i Danmarks Statistik/txt_filer". Multiple formats are available for more or less crude grouping.

Usage

1
importDREAM(dreamData,explData=NULL,type="support",pnr="PNR")

Arguments

dreamData

Name of dataset holding DREAM data. Typically product of the importSAS function. In most cases it will be useful to add a set.hook to the importSAS function - set.hook="keep PNR branch:" for type of work and set.hook="keep=PNR y_:" for support

explData

Name of data holding relation between codes and explanatory text. Typically read from "//srvfsenas1/formater/SAS formater i Danmarks Statistik/txt_filer" using "read.csv2". The data is expected to hold two variables: the code and the explanation - in that order. The variable holding the code MUST be named "branche" or "support" as appropriate.

type

- "support" extracts weekly public support and "branche" supplies montly type of work. Other names cause error.

pnr

- name of person identifier in DREAM dataset, typically "PNR"

Details

DREAM data are organized in a special way. From the start of recording there is a weekly recording of receipt of support from the state. These are in se- parate variables. Then there is a montly recording of type of work also in separate variables. Other data are in DREAM, but not extracted by current function which either selects public support or type of work. The result is either occupation (branche) or support-type with start and end dates and in long format.

Value

the function returns a data.table with the following variables:

Author(s)

Christian Torp-Pedersen

See Also

importSAS

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# The following is a minute version of DREAM
library(data.table)
microDREAM <-data.table(PNR=c(1,2),branche_2008_01=c("","3"),
  branche_2008_02=c("1","3"), branche_2008_03=c("1",""),
  y_9201=c("","1"),y_9202=c("","2"),y_9203=c("","2"))
# Explanation of codes for "branche" 
branche <- data.table(branche=c("1","2","3"),
            text=c("school","gardening","suage"))   
support <- data.table(support=c("1","2"),text=c("education","sick")) 
temp <- importDREAM(microDREAM,branche,type="branche",pnr="PNR")   
temp[]
temp2 <- importDREAM(microDREAM,support,type="support",pnr="PNR")
temp2[]         

tagteam/heaven documentation built on June 21, 2019, 6:37 p.m.