help for cprdentutil(Roger Newson)

Utilities for converting CPRD entity data variables to numeric variables

cprdent_enttype [ , dofile(filename) ]

where enttype is an integer identifying a CPRD entity type.

Description

The cprdentutil library of programs is intended for use in datasets produced by the cprdutil package.
The programs are used to input string variables with names of form datax, where x is an integer,
found in Stata datasets produced using the cprdutil modules cprd_test or cprd_additional,
and to output labelled numeric variables,
containing the same information in a form usable by Stata statistical programs and understandable by human users.
The names and values of these numeric variables are chosen to define CPRD entities of types indicated by the entity type number,
such as test results for a specific kind of test (such as a blood metabolite measurement),
or additional information for a specific kind of clinical event (such as a height measurement).

Options for commands in the cprdentutil library

dofile(filename) specifies the name of an existing Stata do-file,
usually created using the dofile() option of the cprd_xyzlookup module of the cprdutil package.
This do-file is executed by the cprdentutil module,
and usually creates a set of value labels,
some of which are then allocated to variables generated by the cprdentutil module.

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 retrieved,
containing data on things known to these practices,
such as clinical events, additional information on clinical events, and tests.
These files can be read into Stata datasets, using the modules of the cprdutil package.

The cprd_additional and cprd_test modules of the cprdutil package create datasets
containing a numeric variable enttype, which specifies a CPRD entity type,
and also containing string variables with names beginning with data,
such as data1 and data2.
These string variables contain information on CPRD entities, of a type indicated by enttype.
These entity types determine how the datax variables should be read,
in order to evaluate new variables containing information on those entities.
For instance, entity type 1 is a blood pressure measurement,
and the datax variables in an observation whose enttype value is 1
contain information on the blood pressure measurement,
such as the systolic and diastolic values, the time of day when the measurement was made,
and the posture of the patient when the measurement was made.
There is a cpdent_enttype module for each of a list of commonly used enttype values.
For instance, cprdent_1 inputs the existing string variables data1 to data7,
and creates new variables describibg a blood pressure measurement,
with variable labels and value labels.

Modules of the cprdentutil library

The modules of the cprdentutil library, and the CPRD entities for which they are used, are listed as follows:

Module Entity description

cprdent_1 Blood pressure

cprdent_4 Smoking

cprdent_5 Alcohol

cprdent_13 Weight

cprdent_14 Height

cprdent_26 Current Diabetes status

cprdent_87 Family History

cprdent_147 Cardiovascular disease risk

cprdent_163 Serum cholesterol

cprdent_175 High density lipoprotein

cprdent_177 Low density lipoprotein

There are many other CPRD enttypes.
Some are more commonly used than others.
A list of all entity types recognised by CPRD
can be found in the Stata datasets produced by cprd_entity,
which inputs a CPRD tab-delimited text dataset with 1 row per entity type,
and outputs a Stata dataset to memory, with 1 observation per entity type,
and data on the variables stored in the datax variables
for test records or additional clinical records of that entity type.

Examples

The following example asumes that the user has created a do-file myxyzlookups.do,
using the cprd_xyzlookup module of the cprdutil paclage,
to create variable labels for all the CPRD XYZ lookups.
It inputs a CPRD test dataset using the cprd_test module of the cprdutil package
to create a dataset with1 observation per test event in memory.
It then drops all observations with a value of enttype other than 163,
which indicates a serum cholesterol measurement.
It then uses the cprdent_163 module of cprdentutil
to create a list of 7 new variables, labelled informatively,
containing information on the serum cholesterol measurements.
It then uses summarize to summarize the values of the serum cholesterol measurements,
and tabulate to tabulate the units in which these values are measured.

. cprd_test using ./nonLookups/test.txt, clear dofile(myxyzlookups.do)

. keep if enttype==163

. describe, full

. cprdent_163, dofile(myxyzlookups.do)

. summarize value, de format

. tabulate unitofmeasure, miss

Note that a cprdentutil module such as cprdent_163 should only be used
in a dataset of observations with the correct entity type,
as specified by the variable enttype.

Saved results

The modules of cprdentutil all save the following results in r():

Macros

r(datavars) list of input text data variables used

r(newvars) list of generated output variables

Author

Roger Newson, Imperial College London, UK.

Email: r.newson@imperial.ac.uk

Also see

Help: Clinical Practice Research Datalink (CPRD)

cprdutil if installed