Created
August 2, 2010 23:20
-
-
Save aufrank/505500 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rms) | |
library(ggplot2) | |
ddiamonds <- datadist(diamonds) | |
options(datadist = "ddiamonds") | |
fit.ols <- ols(price ~ carat * cut, diamonds) | |
## can specify a range on a continuous predictor | |
Predict(fit.ols, carat = seq(2,4,.25)) | |
## can specify a single level for a categorical predictor | |
Predict(fit.ols, cut = "Good") | |
## can specify multiple levels for a categorical predictor | |
Predict(fit.ols, cut = c("Fair", "Good")) | |
## Is there a way to collapse across multiple levels of a categorical predictor? | |
## Would like to see the effect of carat, averaging over all cuts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment