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
supportA long version data.table providing a record per week for all registered individual with start/end/supportcode and support description
brancheA long version data.table providing a record per month for type of profession with start/end/work-code and description
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.
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
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.
- "support" extracts weekly public support and "branche" supplies montly type of work. Other names cause error.
- name of person identifier in DREAM dataset, typically "PNR"
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.
the function returns a data.table with the following variables:
pnr - person identificer from call
start - start of each period
end - end of each period
code - coding of period
explanation - text to eplain coding if a text dataset was specified
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.