Create a generalized linear model that can be used in the PatientLevelPrediction package.

createGlmModel(coefficients, intercept = 0, finalMapping = "logistic")

Arguments

coefficients

A dataframe containing two columns, coefficients and covariateId, both of type numeric. The covariateId column must contain valid covariateIds that match those used in the /codeFeatureExtraction package.

intercept

A numeric value representing the intercept of the model.

finalMapping

A string representing the final mapping from the linear predictors to outcome probabilities. For generalized linear models this is the inverse of the link function. Supported values is only "logistic" for logistic regression model at the moment.

Value

A model object containing the model and the prediction function.