View source: R/convert_nurseinterview_to_episodedata.r
convert_nurseinterview_to_episodedata | R Documentation |
This function takes data fields containing illness codes/time of diagnosis distributed in multiple with each row representing one individual. It processed the data and return in episodes of event for all individuals
convert_nurseinterview_to_episodedata(
df,
field_sr_diagnosis = "20002",
field_sr_date = "20008",
field_sr_date_type = "interpolated_year",
qc_threshold_year = 10,
event_code = 2,
codetype = "numeric"
)
df |
dataframe containing the fields |
field_sr_diagnosis |
data field number for illness code, default: 20002 |
field_sr_date |
data field number for corresponding time of diagnosis, default: 20008 |
field_sr_date_type |
type of time of diagnosis - interpolated_year/interpolated_year/interpolated_year, default:interpolated_year |
qc_threshold_year |
in case of multiple episodes for same illness code, if time difference is larger than qc threshold between the oldest and newest episodes, eventdate will be discarded i.e. set to NA, default:10 |
event_code |
code number to indicate if the episodes is a true event 1, self-reported/interpolated event 2 , for which a mean date is taken as event date in case of multiple occurence, or non-event 0 , for which date does not correspond to occurence of illness code. These codes are used in time-to-event analysis, default: 2 |
a data.table object with all episodes
convert_nurseinterview_to_episodedata(dfukb,field_sr_diagnosis = "20001",field_sr_date = "20006",qc_treshold_year = 10)
convert_nurseinterview_to_episodedata(dfukb,field_sr_diagnosis = "20002",field_sr_date = "20008",qc_treshold_year = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.