180 likes | 197 Views
Query your data with QD. B. van der Holt / W.L.J. van Putten University Hospital Rotterdam - Daniel Department of Trials & Statistics / HOVON Data Center. Introduction. Correct data are crucial for any analysis;
E N D
Query your data with QD B. van der Holt / W.L.J. van Putten University Hospital Rotterdam - Daniel Department of Trials & Statistics / HOVON Data Center Stata Users Meeting, Maastricht
Introduction • Correct data are crucial for any analysis; • Ideally data should come cleaned and error free, but this is hardly ever the case. • In clinical trial data may be distributed among several files. • One way to check is to use if-expressions Stata Users Meeting, Maastricht
Example • Data from trial with over 400 patients • t1 Randomisation/On study • t2 PA form • t3 Treatment form ** • t4 Evaluation form ** • t5 Off treatment form • t6 Follow-up form ** • t7 Infection form ** • t8 Side effects form ** Stata Users Meeting, Maastricht
Checks for t1.dta Stata Users Meeting, Maastricht
Checks for t3.dta Stata Users Meeting, Maastricht
Disadvantage of if-expressions • Errors in data of one patient may be found anywhere in the ouput: not neatly sorted by patient number. This will hamper easy admission of the data. (Remember that in this trial there were more than 400 patients) Stata Users Meeting, Maastricht
Solution QD.ADO Stata Users Meeting, Maastricht
QD (Query Data) • Is a program by which one may query the quality and validity of data; • Developed for clinical trials, but not restricted to it; • Define a series of tests on the data in dta-files; • The data may be in one ore more dta-files, linked by a common index variable (a unique case-identifier); Stata Users Meeting, Maastricht
QD (Query Data) - continued • Generates formatted reports of variable- values with messages associated with the test; • And, very important: the reports are organised by case (e.g. patient), and not listwise by test! All tests that are true for a single case are displayed together. Stata Users Meeting, Maastricht
QD output for patient 2 Stata Users Meeting, Maastricht
QD output for patient 5 Stata Users Meeting, Maastricht
Syntax of QD.ADO • The general syntax of the program is: qd options • The commands that were used to generate the previous output will be used for illustration Stata Users Meeting, Maastricht
* QDCHECK.DO - 1 • qd clear • removes all previously defined QD parameters (global macro’s) from memory • qd files(t1 t2 t3) • required. Contains the (valid) names of one or more dta-files. The same dta-file may appear more than once. The files are numbered by QD in the natural order of appearance in the string as file 1, file 2, ... Stata Users Meeting, Maastricht
* QDCHECK.DO - 2 • qd by(hvnr) • required. Defines an ordering on file 1 and variable by which the records in the different files are linked • qd title(HOVON xx NHL Checks on data) • This title will be printed on top of the output of the data of each case Stata Users Meeting, Maastricht
* QDCHECK.DO - 3 Stata Users Meeting, Maastricht
* QDCHECK.DO - 4 Stata Users Meeting, Maastricht
* QDCHECK.DO - 5 • qd log(qdcheck.log) • defines the name (path) of the file that will serve as a log file to which the output will be written. When not defined, the output will only be shown on the screen • qd print(if hvnr<=5) • this is the instruction to display the results of all the tests on the screen and, if defined, to a log-file. Stata Users Meeting, Maastricht
Further information • findit qd • email: holt@stah.azr.nl Stata Users Meeting, Maastricht