Presentation on theme: "Calculations and Branching Logic By J Kevan Essmyer Acknowledgements: J. Phil Miller (WUSM Biostatistics) Paul Harris (Vanderbilt CTSA) Jack Baty (WUSM."— Presentation transcript:
Calculations and Branching Logic By J Kevan Essmyer Acknowledgements: J. Phil Miller (WUSM Biostatistics) Paul Harris (Vanderbilt CTSA) Jack Baty (WUSM REDCap Admin) Yu Tao (WUSM REDCap Admin)
Overview REDCap Overview Calculations Branching Logic Expanded Data Validation Types Data Quality Module External Links functionality Data Search Tool
Development “Try it” and Production “Study Data” Servers – REDCap User Request forms – REDCap Project Request forms (IRB #) – Sidedoor security certificate (External Access) Both servers are WUSM HIPAA compliant web-based data capture systems REDCap Policy: Study data should only be collected on the Production server
Project Creation Flow Chart Create Project –Project Name, Longitudinal or Cross-Sectional/ Survey Excel Spreadsheet Or Online Form Designer Data Entry Forms Add Users and Set User Rights Test Forms Move to Production Status and start Data Collection Define Study Events (Longitudinal) add Schedule (optional)
Recent Changes Hardware – Improved Dedicated MySQL Database server Software (REDCap 4.8.x) – Data Query Module – New data validation types – Search Tool – External Links
File Server Host Server WEB Server Uploaded Files Installation Files WEB Server WU Campus Sidedoor Server https://redcapsurvey.wustl.edu... REDCap Survey Data Entry /Admin MySQL Server MySQL Slave Server Data Sync Biostatistics Secure Domain Authenticated Access Public HTTPS Access
Calculations Variable Referrence: [event_id][variable name] – Event Id obtained from events grid Logic Statement: (if(expression),True Result,False Result) Simple – [weight]*10000/([height]*[height]) Complex Calculating the Mean of groups with null valid range includes zero The following equation will calculate the Mean of a list of variables – ( (if(Math.abs([A])>0,[A],0)) +(if(Math.abs([B])>0,[B],0)) +(if(Math.abs([C])>0,[C],0)) ) / ( (if(Math.abs([A])>0,1,if([A]=0,1,0)) +if(Math.abs([B])>0,1,if([B]=0,1,0)) +if(Math.abs([C])>0,1,if([C]=0,1,0)) )
Built in Functions "y"years 1 year = days "M"months 1 month = days "d"days "h"hours "m"minutes "s"seconds "ymd"Y-M-D (default) "mdy"M-D-Y "dmy"D-M-Y Type of calculationNotes / examples round(number,decimal places) Round roundup(number,decimal places) Round Up rounddown(number,deci mal places) Round Down sqrt(number)Square Root (number)^(exponent)Exponents abs(number)Absolute Value min(number,number,...)Minimum max(number,number,...)Maximum mean(number,number,... ) Mean median(number,number,...) Median sum(number,number,...)Sum stdev(number,number,...)Standard Deviation datediff([date1], [date2], "units", "dateformat", returnSignedValue) datediff([dob],[date_enrolled],"d") datediff([dob]," ","h","mdy",true) Units Date Formats DATEDIFF F(x)
Pitfalls of Calculations Changes made to equations after the start of data collection – Correct new calculated value will display on page load – Each form must be individually submitted to re-apply calculation Calculations should be considered a tool not data. – Calculation should be reapplied during data analysis. Multiple calculations on a form. – Order of execution is determined by the alphabetical ordering of it’s associated variable/field name. Calculation 1 [weight_met] =[weight]* Calculation 2 [BMI]=[weight_met]/([height]^2) !!!Calculation 2 will occur before calculation 1 – Calculate BMI in one step (Best Solution) or – Rename variable to change order (only other option)
Branching Logic Exposes form question if logic expression is true – [Event Id][Variable Name] = "0" Checkboxes Format – [Event Id] [variablename(code)] To check the value of the checkboxes: '1' = checked '0' = unchecked – [race(2)] = "1" [sex] = "0"display question if sex = female; Female is coded as 0, Female [sex] = "0" and [given_birth] = "1"display question if sex = female and given birth = yes; Yes is codesd as 1, Yes ([height] >= 170 or [weight] < 65) and [sex] = "1" display question if (height is greater than or equal to 170 OR weight is less than 65) AND sex = male; Male is coded as 1, Male [last_name] <> ""display question if last name is not null (aka if last name field is empty)
Branching Logic Calculation with in branching logic – [kwdays] > (10+1) Prevent deletion of – With existing logic (other logic statements) or <>"“ – Stand alone <>""
Branching logic warning about hiding existing data Can be a dangerous situation and is best avoided.
Expanded Field Validation Types
Data Quality Module (data queries)
Data Quality Module (data queries)
External Links Embed hyperlinks in the REDCap project menu. – Websites, Other REDCap Projects, web tools
Data Search Tool
“?!!?” User Rights Branching Logic Scheduling API Data Dictionary Data Validation
REDCap Lifelines Built-in tutorial videos Built-in Frequently Asked Question (FAQ) guide Demonstration Databases (Some Online, more to come) WUSM Biostat REDCap Help Queue – – Monitored by 4 to 5 Administrators
REDCap Goals Easy to use Metadata Driven Adaptable Features Data entry validation Self service tool Questions?