Exploring the swiss data set

Introduction:

  1. We presented an interactive app to explore the swiss data set (this data set is provided by default by R).

  2. The app was designed using shiny http://shiny.rstudio.com/

  3. The app was can be found at http://hong.shinyapps.io/Explore/

Characteristics of the app

Data set

This data set contains 6 variables or features:

names(swiss)
## [1] "Fertility"        "Agriculture"      "Examination"     
## [4] "Education"        "Catholic"         "Infant.Mortality"

And all variables are numerical:

head(swiss,3)
##              Fertility Agriculture Examination Education Catholic
## Courtelary        80.2        17.0          15        12     9.96
## Delemont          83.1        45.1           6         9    84.84
## Franches-Mnt      92.5        39.7           5         5    93.40
##              Infant.Mortality
## Courtelary               22.2
## Delemont                 22.2
## Franches-Mnt             20.2

Characteristics of the app

Creating linear models between user selected variables

plot of chunk unnamed-chunk-4

## Error in eval(expr, envir, enclos): could not find function "textxy"

Characteristics of the app

Creating polynomial fits of the linear model residuals

plot of chunk unnamed-chunk-5

Characteristics of the app

Displaying a summary of the fitted linear model

## 
## Call:
## lm(formula = swiss[, var2] ~ swiss[, var1])
## 
## Residuals:
##      Min       1Q   Median       3Q      Max 
## -11.4895  -5.3618  -0.9056   4.0360  24.0653 
## 
## Coefficients:
##               Estimate Std. Error t value Pr(>|t|)    
## (Intercept)   46.81788    6.11244   7.659 1.08e-09 ***
## swiss[, var1] -0.51095    0.08582  -5.954 3.66e-07 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 7.271 on 45 degrees of freedom
## Multiple R-squared:  0.4406, Adjusted R-squared:  0.4282 
## F-statistic: 35.45 on 1 and 45 DF,  p-value: 3.659e-07