An R Introduction to Statistics

Adjusted Coefficient of Determination

The adjusted coefficient of determination of a multiple linear regression model is defined in terms of the coefficient of determination as follows, where n is the number of observations in the data set, and p is the number of independent variables.

R2adj = 1 - (1- R2)-n--1--
                 n - p- 1

Problem

Find the adjusted coefficient of determination for the multiple linear regression model of the data set stackloss.

Solution

We apply the lm function to a formula that describes the variable stack.loss by the variables Air.Flow, Water.Temp and Acid.Conc. And we save the linear regression model in a new variable stackloss.lm.

> stackloss.lm = lm(stack.loss ~ 
+     Air.Flow + Water.Temp + Acid.Conc., 
+     data=stackloss)

Then we extract the coefficient of determination from the adj.r.squared attribute of its summary.

> summary(stackloss.lm)$adj.r.squared 
[1]  0.89833

Answer

The adjusted coefficient of determination of the multiple linear regression model for the data set stackloss is 0.89833.

Note

Further detail of the adj.r.squared attribute can be found in the R documentation.

> help(summary.lm)