Description Usage Arguments Details Value Examples
Computes the adjusted R2 value
1 | adjR2(pred, truth, d)
|
pred |
a numeric vector of predicted/fitted values |
truth |
a numeric vector of true/observed values |
d |
number of prediction variables used |
Uses 2 numeric vectors pred and truth to compute an adjusted R2 value, adjusted by number of parameters
adjusted r2-value
1 2 3 4 5 | #using the ISLR::Credit database for this example
truth <- ISLR::Credit$Limit
reg_model <- lm(ISLR::Credit$Limit~ISLR::Credit$Income + ISLR::Credit$Cards)
pred <- reg_model$fitted.values
adjR2(pred, truth, 2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.