Skip to main content

Posts

Showing posts from February, 2016

Recency, Frequency, Monetary (RTF) variable generation using Danish National Health Register data.

Description Below adaptable SAS code for generation of recency, frequency and monetary variables.
Algorithm may be applied in a lot of contexts in which records contain dates ('day of entry', 'day of exit', 'day of visit') id number and maybe even revenue or cost.

Citation Please cite this code as:
Laier, G.H. (2016) Recency, Frequency and Monetary SAS programming script  [computer software]. Denmark. Link: http://hellmund.blogspot.dk/2016/02/recency-frequency-monetary-rtf-variable.html

Thanks!
Gunnar Hellmund Laier,
PhD, MSc

Explanation In this context we form variable for analyses of Danish National Register data and form variables containing information on contacts, hospitalizations and days in hospital 14, 30, 91 and 180 days before a hospitalization or contact.

Key variables:
cpr (security number), pattype (patient type, in- or outpatient), inddto (day of entry), uddto (day of exit), ambdto (day of visit).

Data step program data calc.RFMdata(drop=dto_h…

Statistics site collection

General recommendations and programming examples:
http://support.sas.com/documentation/ (syntax lookup)
http://www.ats.ucla.edu/stat/ (combined best-practice/examples)
http://www.rseek.org

Emphasize on applications within psychology:
http://www.personality-project.org/ (development of R-package, documentation)
http://psych.unl.edu/psycrs/statpage/ (several small GUIs and dokumentation)

Structural equation modelling (both variance and covariance based):
http://www.ssicentral.com/lisrel/
http://www.pls-sem.com/ (with link to smartPLS)
https://youtu.be/Uwo2cBtT_xo (HTMT criterion)
https://www.youtube.com/user/Gaskination

Standards:

Publishing:
http://www.apastyle.org/learn/tutorials/basics-tutorial.aspx