Learn R Programming

BSDA (version 1.2.2)

Gpa: High school GPA versus college GPA

Description

Data for Example 2.13

Usage

Gpa

Arguments

Format

A data frame/tibble with 10 observations on two variables

hsgpa

high school gpa

collgpa

college gpa

References

Kitchens, L. J. (2003) Basic Statistics and Data Analysis. Pacific Grove, CA: Brooks/Cole, a division of Thomson Learning.

Examples

Run this code

plot(collgpa ~ hsgpa, data = Gpa)
mod <- lm(collgpa ~ hsgpa, data = Gpa)
abline(mod)               # add line
yhat <- predict(mod)      # fitted values
e <- resid(mod)           # residuals
cbind(Gpa, yhat, e)       # Table 2.1
cor(Gpa$hsgpa, Gpa$collgpa)

if (FALSE) {
library(ggplot2)
ggplot2::ggplot(data = Gpa, aes(x = hsgpa, y = collgpa)) + 
           geom_point() + 
           geom_smooth(method = "lm") + 
           theme_bw()
}


Run the code above in your browser using DataLab