help for cprdlsoautil(Roger Newson)

Inputting Clinical Practice Research Datalink (CPRD) LSOA-linkage datasets into Stata

cprdlsoa_patient_index using filename [ , clear nokey

delimiters("chars"[, collapse|asstring])

index(index_name) year(#)
]

where index_name may be

imd | townsend

Description

The cprdlsoautil package is designed for use with the cprdutil package,
which creates Stata datasets from text data files
produced by the Clinical Practice Research Datalink (CPRD).
cprdlsoautil is a suite of utility programs for inputting linkage text data files produced by CPRD
to contain social-deprivation data on patients from these patients' home lower layer super output areas (LSOAs),
and creating equivalent Stata datasets in the memory.
cprdlsoautil {like cprdutil) uses the SSC packages keyby and chardef,
which need to be installed for cprdlsoautil to work.

Options

clear specifies that any existing dataset in memory will be replaced.

nokey specifies that the dataset produced will not be sorted by a primary key of variables.
If nokey is not specified for a command that has a nokey option,
then the dataset will be sorted by a primary key of variables,
whose values will normally identify the observations uniquely,
with each value combination present in only one observation.

delimiters("chars"[, collapse|asstring])
specifies the delimiters used in the input text file.
This option functions as the option of the same name for import delimited.

index(index_name) specifies the name of the index to be used.
This name may be imd for the index of multiple deprivation (IMD) (the default),
or townsend for the Townsend index.

year(#) specifies the year for which deprivation data are recorded.
In default, it is set to 2004.
The index() and year() options are used to define the names of variables containing deprivation indices,
which may be given as quintiles, deciles or twentiles.
For instance, a variable containing twentiles of the IMD for year 2010
will be named imd2010_20.
Higher values of IMD quintiles, deciles or twentiles
correspond to higher levels of social deprivation for the lower super-output area (LSOA).

Remarks

The Clinical Practice Research Datalink (CPRD) is a database of information
from primary-care practices in the British Health Service.
Tab-delimited text data files of various types can be produed by CPRD,
containing data on things known to these practices,
such as practices, patients, staff members, clinical events, additional details on clinical events,
consultations, immunisations, referrals, tests, and prescribed therapies.
These text datafiles can then be converted to Stata datasets using the SSC package cprdutil.

Researchers sometimes aim to answer questions about the incidence of events experienced by CPRD patients,
but recorded by data sources other than CPRD, such as lower super-output areas (LSOAs) in which patients live.
The cprdlsoautil package allows users to do this,
creating datasets with 1 observation per patient,
and data on deprivation measures for the patient's home neighbourhood.
For example, the cprdlsoa_patient_imd module creates datasets containing variables
giving the quintile, decile or twentile of the index of multiple deprivation (IMD)
for the patient's neighbourhood.
The higher the IMD or Townsend index, the more deprived the patient's neighbourhood is thought to be.
IMD and Townsend index variables are named informatively to specify the year and percentile.
For instance, a variable containing twentiles of the IMD for year 2010
will be named imd2010_20.
cprdlsoautil should be used in combination with the cprdlinkutil package,
also downloadable from SSC.

Examples

The following examples assume that the current folder has a sister folder ../cprdlsoadata,
containing a tab-delimited data file death_patient_18_109_Request4.txt,
with the correct variables for a CPRD LSOA patient deprivation dataset.

Input a dataset containing IMD data for the year 2010, keyed by patient ID:

. cprdlsoa_patient_index using "../cprdlsoadata/patient_imd2010_18_109_Request4.txt", clear year(2010)

Input an unkeyed dataset containing Townsend index data for the year 2001:

. cprdlsoa_patient_index using "../cprdlsoadata/patient_townsend2001_18_109_Request4.txt", clear nokey index(townsend) year(2001)

Author

Roger Newson, Imperial College London, UK.

Email: r.newson@imperial.ac.uk

Also see

Help: Clinical Practice Research Datalink (CPRD)

cprdutil, cprdlinkutil, keyby, chardef, lablist if installed