# NOT RUN {
# Simulate data set with continuous outcome (use all default values)
dfContinuous <- quickSim()
# Use multiple linear regression as algorithm to predict the outcome.
lmRes <- lm(y~x1+x2,data=dfContinuous)
# Extract measured outcome and the predicted outcome (fitted values)
# from the regression output, put both in a data.frame.
lmDf <- data.frame(measOutcome=dfContinuous$y,
fitted=lmRes$fitted.values)
# Apply function binContinuous, generate 5 equal bins (transformed
# outcome 0-100, bin width = 20, yields 5 bins).
x100c <- binContinuous(x=lmDf, measColumn = 1, binWidth = 20)
# }
Run the code above in your browser using DataLab