Using the definition of R squared, we can also confirm that this is simply

the ratio of the explained variability to total variability.

Remember, explained variability is the sum of squares of the regression, 132.57,

and the total variability is sum of squares totaled, that's 480.25.

And we actually get the same value for R squared as expected of 28%.

Now that we have our base line model, we can add another variable to it, and

let's start with percentage white.

So we need to do in R is use the same linear model function.

And add white as an additional predictor to our model, and

then we can take a look at the summary output for this model,

as well as the anova output for the model, and for that we use the function anova,

that's wrapped around the regression model that we had specified earlier.

That looks something like this,

it's very similar to what we saw before except with an additional line

in both of our tables for the new variable that we've added as a predictor.

Note that the total variability,

sum of square's total has not changed, because this is the inherent variability

that is in our response variable percentage living in poverty.

So, regardless of how many variables you're using

in your model the total variability should not change.

However, what has changed is how this variability is being partitioned.

In this case, part of it is can be attributed to female householder, and

a much smaller part of it can now be attributed to a percentage white.

So if we wanted to calculate our square based on this output, and, keeping

in mind that R squared is the percentage of variability in the response variable,

that is explained by the model.

And in this case, our model is comprised of two explanatory variables.

We could calculate that as 132.57 + 8.21 to get us

the total explained variability in the model divided by the total

variability in our response variable which comes out to be roughly 29%.

We can see that adding another variable to our model now explains one more

percent of the variability in our response variable.

The R squared used to be 0.28 and now, it's 0.29.