Learn R Programming

AgeTopicModels (version 0.1.0)

longdata2diseasematrix: Title

Description

Title

Usage

longdata2diseasematrix(rec_data)

Value

a disease matrix with first column being the individual ids, columns follows are diseases with 0,1 coding.

Arguments

rec_data

A diagnosis data frame with three columns; format data as HES_age_example; first column is individual ids (eid), second column is the disease code (diag_icd10); third column is the age at diagnosis (age_diag). Note for each individual, we only keep the first onset of each diseases. Therefore, if there are multiple incidences of the same disease within each individual, the rest will be ignored.

Examples

Run this code
disease_matrix <- longdata2diseasematrix(HES_age_example)

Run the code above in your browser using DataLab