Here, we’re just setting a few options.
knitr::opts_chunk$set(
warning = TRUE, # show warnings during codebook generation
message = TRUE, # show messages during codebook generation
error = TRUE, # do not interrupt codebook generation in case of errors,
# usually better for debugging
echo = TRUE # show R code
)
ggplot2::theme_set(ggplot2::theme_bw())
Now, we’re preparing our data for the codebook.
library(codebook)
codebook_data <- rio::import("Medici19.sav")
# to import an SPSS file from the same folder uncomment and edit the line below
# codebook_data <- rio::import("mydata.sav")
# for Stata
# codebook_data <- rio::import("mydata.dta")
# for CSV
# codebook_data <- rio::import("mydata.csv")
# omit the following lines, if your missing values are already properly labelled
codebook_data <- detect_missing(codebook_data,
only_labelled = TRUE, # only labelled values are autodetected as
# missing
negative_values_are_missing = FALSE, # negative values are missing values
ninety_nine_problems = TRUE, # 99/999 are missing values, if they
# are more than 5 MAD from the median
)
# If you are not using formr, the codebook package needs to guess which items
# form a scale. The following line finds item aggregates with names like this:
# scale = scale_1 + scale_2R + scale_3R
# identifying these aggregates allows the codebook function to
# automatically compute reliabilities.
# However, it will not reverse items automatically.
codebook_data <- detect_scales(codebook_data)
## Warning in detect_scales(codebook_data): i items found, but no aggregate
Create codebook
compact_codebook(codebook_data)
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
## Warning in max(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für max;
## gebe -Inf zurück
## Warning in min(x$labels, na.rm = TRUE): kein nicht-fehlendes Argument für min;
## gebe Inf zurück
Dataset name: results
The dataset has N=529 rows and 36 columns. 0 rows have no missing values on any column.
|
The following JSON-LD can be found by search engines, if you share this codebook publicly on the web.
{
"name": "results",
"datePublished": "2021-05-25",
"description": "The dataset has N=529 rows and 36 columns.\n0 rows have no missing values on any column.\n\n\n## Table of variables\nThis table contains variable names, labels, and number of missing values.\nSee the complete codebook for more.\n\n|name |label | n_missing|\n|:--------|:------------------------------------|---------:|\n|id |ST ID | 0|\n|i10021 |Blutentnahme #1 (Tag) | 52|\n|i10022 |Blutentnahme #1 (Monat) | 52|\n|i10023 |Blutentnahme #1 (Jahr) | 52|\n|i10024 |Blutentnahme #1 (Std.) | 52|\n|i10025 |Blutentnahme #1 (Min.) | 53|\n|i10026 |Nuechternheit | 0|\n|i10027 |Position bei BE | 0|\n|i10028 |Art der BE | 0|\n|i10029 |Transportdauer der Blutproben (Min.) | 129|\n|i10030 |Weiterverarbeitung Labor | 52|\n|i10046 |NA | 529|\n|i10047 |NA | 529|\n|i10048 |NA | 529|\n|i10049 |NA | 529|\n|i10050 |NA | 529|\n|i10051 |NA | 529|\n|i10052 |NA | 529|\n|i10053 |NA | 529|\n|i10054 |NA | 529|\n|i10055 |NA | 529|\n|i1liage |Alter | 0|\n|i1lichol |Gesamtcholesterin(NW:120-200 mg/dl) | 34|\n|i1litri |Triglyceride (NW:75-175mg/dl) | 34|\n|i1lihdl |HDL-Cholesterin (mg/dl) | 34|\n|i1lildl |LDL-Cholesterin (mg/dl) | 34|\n|i1lilhq |LDL-HDL-Quotient | 34|\n|i1liai |Apolipoprotein A I (mg/dl) | 34|\n|i1liaii |Apolipoprotein A II (mg/dl) | 34|\n|i1lib |Apolipoprotein B (mg/dl) | 34|\n|i1limb |Messmerkmal Apoprotein B | 34|\n|I1liapoe |Apolipoprotein-E | 42|\n|i1lilpa |Lipoprotein(a) (mg/dl) | 34|\n|i1limlp |Messmerkmal Lipoprotein(a) | 34|\n|i1limzab |Messzeitpunkte Apoproteine | 34|\n|i1lif |NA | 34|\n\n### Note\nThis dataset was automatically described using the [codebook R package](https://rubenarslan.github.io/codebook/) (version 0.9.4.9000).",
"keywords": ["id", "i10021", "i10022", "i10023", "i10024", "i10025", "i10026", "i10027", "i10028", "i10029", "i10030", "i10046", "i10047", "i10048", "i10049", "i10050", "i10051", "i10052", "i10053", "i10054", "i10055", "i1liage", "i1lichol", "i1litri", "i1lihdl", "i1lildl", "i1lilhq", "i1liai", "i1liaii", "i1lib", "i1limb", "I1liapoe", "i1lilpa", "i1limlp", "i1limzab", "i1lif"],
"@context": "http://schema.org/",
"@type": "Dataset",
"variableMeasured": [
{
"name": "id",
"description": "ST ID",
"@type": "propertyValue"
},
{
"name": "i10021",
"description": "Blutentnahme #1 (Tag)",
"@type": "propertyValue"
},
{
"name": "i10022",
"description": "Blutentnahme #1 (Monat)",
"value": "1. Januar,\n2. Februar,\n3. Maerz,\n4. April,\n5. Mai,\n6. Juni,\n7. Juli,\n8. August,\n9. September,\n10. Oktober,\n11. November,\n12. Dezember,\n98. weiss nicht,\nNA. [99] KA",
"maxValue": 98,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i10023",
"description": "Blutentnahme #1 (Jahr)",
"value": "9998. weiss nicht,\n9999. KA",
"maxValue": 9999,
"minValue": 9998,
"@type": "propertyValue"
},
{
"name": "i10024",
"description": "Blutentnahme #1 (Std.)",
"@type": "propertyValue"
},
{
"name": "i10025",
"description": "Blutentnahme #1 (Min.)",
"@type": "propertyValue"
},
{
"name": "i10026",
"description": "Nuechternheit",
"value": "1. ja,\n2. nein,\n3. fraglich,\n9. keine Angabe",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i10027",
"description": "Position bei BE",
"value": "1. liegend,\n2. sitzend,\n3. sonstiges,\n9. WN",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i10028",
"description": "Art der BE",
"value": "1. Poliklinik/auf Eis,\n2. Zuhause/auf Eis,\n3. Poliklinik/ohne Eis,\n4. Zuhause/ohne Eis,\n9. keine Angabe",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i10029",
"description": "Transportdauer der Blutproben (Min.)",
"@type": "propertyValue"
},
{
"name": "i10030",
"description": "Weiterverarbeitung Labor",
"value": "1. Zentrallabor,\n2. Blutbank,\n9. keine Angabe",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i10046",
"@type": "propertyValue"
},
{
"name": "i10047",
"@type": "propertyValue"
},
{
"name": "i10048",
"@type": "propertyValue"
},
{
"name": "i10049",
"@type": "propertyValue"
},
{
"name": "i10050",
"@type": "propertyValue"
},
{
"name": "i10051",
"@type": "propertyValue"
},
{
"name": "i10052",
"@type": "propertyValue"
},
{
"name": "i10053",
"@type": "propertyValue"
},
{
"name": "i10054",
"@type": "propertyValue"
},
{
"name": "i10055",
"@type": "propertyValue"
},
{
"name": "i1liage",
"description": "Alter",
"@type": "propertyValue"
},
{
"name": "i1lichol",
"description": "Gesamtcholesterin(NW:120-200 mg/dl)",
"value": "NA. [999] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1litri",
"description": "Triglyceride (NW:75-175mg/dl)",
"value": "9999. keine Analyse",
"maxValue": 9999,
"minValue": 9999,
"@type": "propertyValue"
},
{
"name": "i1lihdl",
"description": "HDL-Cholesterin (mg/dl)",
"value": "NA. [999] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1lildl",
"description": "LDL-Cholesterin (mg/dl)",
"value": "NA. [999] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1lilhq",
"description": "LDL-HDL-Quotient",
"value": "9. keine Analyse",
"maxValue": 9,
"minValue": 9,
"@type": "propertyValue"
},
{
"name": "i1liai",
"description": "Apolipoprotein A I (mg/dl)",
"value": "NA. [999] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1liaii",
"description": "Apolipoprotein A II (mg/dl)",
"value": "NA. [99] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1lib",
"description": "Apolipoprotein B (mg/dl)",
"value": "NA. [999] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1limb",
"description": "Messmerkmal Apoprotein B",
"value": "1. normale Messung,\n2. Messung nach Verduenn,\n3. < Calc Range,\n4. < Test Range,\n5. Sign,\n9. keine Analyse",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "I1liapoe",
"description": "Apolipoprotein-E",
"value": "22. Phaenotyp E2/E2,\n23. Phaenotyp E2/E3,\n24. Phaenotyp E2/E4,\n33. Phaenotyp E3/E3,\n34. Phaenotyp E3/E4,\n44. Phaenotyp E4/E4",
"maxValue": 44,
"minValue": 22,
"@type": "propertyValue"
},
{
"name": "i1lilpa",
"description": "Lipoprotein(a) (mg/dl)",
"value": "NA. [999] keine Analyse",
"maxValue": "-Inf",
"minValue": "Inf",
"@type": "propertyValue"
},
{
"name": "i1limlp",
"description": "Messmerkmal Lipoprotein(a)",
"value": "1. normale Messung,\n2. Messung nach Verd0nn,\n3. < Calc Range,\n4. < Test Range,\n5. Sign,\n9. keine Analyse",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i1limzab",
"description": "Messzeitpunkte Apoproteine",
"value": "1. 27.07.1990,\n2. 20.11.1990,\n3. 17.04.1991,\n4. 27.12.1991,\n5. 09.10.1992,\n6. 16.10.1992,\n7. 21.05.1993,\n8. 26.05.1993,\n9. keine Analyse",
"maxValue": 9,
"minValue": 1,
"@type": "propertyValue"
},
{
"name": "i1lif",
"@type": "propertyValue"
}
]
}`