13 December 2016

Prestige Dataset

In statistics, polynomial regression is a form of linear regression in which the relationship between the independent variable x and the dependent variable y is modelled as an nth degree polynomial. Polynomial regression fits a nonlinear relationship between the value of x and the corresponding conditional mean of y. The predictors resulting from the polynomial expansion of the "baseline" predictors are known as interaction features.

The dataset used is called Prestige and comes from the car package library(car). The Prestige dataset is a data frame with 102 rows and 6 columns. Each row is an observation that relates to an occupation. The columns relate to predictors such as average years of education, percentage of women in the occupation, prestige of the occupation, etc.

App and interface

  • This app gives a fast visual represantation of several regression models to the Prestige dataset.
  • Our response variable is Income while women, prestige and education are the predictor variables.
  • The user can choose one out of three predictors in order to fit a simple regression model. The degree of the polynomial model can also be configured by the user.

Examine the Prestige dataset

library(car)
data(Prestige)
head(Prestige)
##                     education income women prestige census type
## gov.administrators      13.11  12351 11.16     68.8   1113 prof
## general.managers        12.26  25879  4.02     69.1   1130 prof
## accountants             12.77   9271 15.70     63.4   1171 prof
## purchasing.officers     11.42   8865  9.11     56.8   1175 prof
## chemists                14.62   8403 11.68     73.5   2111 prof
## physicists              15.64  11030  5.13     77.6   2113 prof

Example education as a predictor and 3 Degrees of freedom

If the user chooses:

  1. education, as a predictor a

  2. 3 degrees of freedom

the model that will be fitted is: \(income = b_0 + b_1*education + b_2*education^2+b_3*education^3\)

The plot we get as a result from the previous example