convertFeatVecPortion: This function builds a feature vector for a specific subset...

Description Usage Arguments Details Value Examples

Description

This function builds a feature matrix for a specific subset of features, e.g. labs/visits/observations/drug exposures. Returns a feature matrix with all features from all patients included.

Usage

1
convertFeatVecPortion(featuresType, key, labIndic)

Arguments

featuresType

A set of patient data in the form of a list of data frames. Each data frame contains a pid to label the patient, the names of the features that the patient had present, and the frequency counts of these features in his/her record

key

String descriptor of type of feature (e.g. "obs:" or "visit:"). This will be used to label the feature

labIndic=0

Whether this is for a lab feature. If so, must be converted from factor to numeric. Default is 0=no conversion required; 1=conversion required.

Details

This function takes a list of patient data frames as input. Each patient's data frame contains the features that this patient has present in his/her record. This function flattens this information into the combined feature matrix, with all features (of a certain type - e.g. labs or visits) from all patients included. Clearly, many patients will not have data for many features; their feature counts for any feature that was not present in their record will be set as 0.

Value

An data frame of (pts) x (features of input type)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 

 FV_converted<-convertFeatVecPortion(featuresType, 'obs:')

 #OR

 FV_converted<-convertFeatVecPortion(featuresType, 'labs:', labIndic=1)


## End(Not run)

OHDSI/Aphrodite documentation built on Sept. 18, 2020, 10:26 p.m.