The definition of variables table is a way to describe each variable from a database in a table where each line represent a variable, and each column one of its characteristic. The idea is to be explicit about each variable by describing these characteristics :
An explicit name of the variable, but short enough to be displayed on figures and tables. Example : Date of birth or Creatinine Clearance
An explicit description of the variable, if the varlabel is not explicit enough. It helps the statistician to understand the meaning of the variable. Example : The Creatinine Clearance measured at the entry of the patient in the hospital
An commentary to help the statistician. Example : This quantitative variable can't have value superior to 20.
The unit of the variable, when applicable. For dates, put the format like in R. Example : for the Creatinine Clearance, ml/min, for the Date of birth, %d%m%Y
A level of a factor or ordered variable. Each level must be placed in a separated column. Then there are as much flevel as levels of the variable
A label of a factor or ordered variable. Each level must be placed in a separated column. Then there are as much flevel as levels of the variable
Class of the variable. Could be numeric, integer, factor, ordered, date, character or not_used
The name of the variable in R. If not given, the varlabel
will be used and transformed to a compatible name
To create a definition of variables table skeleton from a existing data.frame, use the descvars_skeleton
function. To read a definition of variables table from a data.frame to a DatabaseDef object, use the import_vardef
. Variable definition table could be used directly as a data.frame
by create_script
. A built-in example of a complete definition of variables table is the variables_description_bad_database
that describes the bad_database
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.