April 1, 2017

Introduction

This is an RStudio shiny application developed as a course project for Coursera's Developing Data Products course in the Data Science Specialization track. The application developed is a simple diamonds price calculator. The user inputs the four diamonds characteristics: carat, cut, color and clarity. The application outputs 95% confidence intervals of linear regression model on dataset diamonds included in the ggplot2 package.

Shiny application url: https://owy1.shinyapps.io/week4_project/

Application UI

Sidebar

Shiny widget Select box menu:

  • Carat: 1 thru 5
  • Cut: Ideal, Premium, Very Good, Good, Fair
  • Color: D thru J
  • Clarity: I1, SI1, SI2, VS1, VS2, VVS1, VVS2, IF

Main Panel

  • Cut, Color and Clarity guide illustrations
  • Output

Application Server

library(ggplot2)
myvars = c("carat","cut","color","clarity","price")
newdata=diamonds[myvars]
newdata$carat <- as.factor(newdata$carat)
result = lm(price ~ ., data=newdata)
anova(result)
Analysis of Variance Table

Response: price
             Df     Sum Sq    Mean Sq F value    Pr(>F)    
carat       272 7.5147e+11 2762749564  2578.6 < 2.2e-16 ***
cut           4 4.7707e+09 1192683255  1113.2 < 2.2e-16 ***
color         6 1.3772e+10 2295380173  2142.4 < 2.2e-16 ***
clarity       7 3.0981e+10 4425851955  4130.9 < 2.2e-16 ***
Residuals 53650 5.7481e+10    1071412                      
---
Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Application Illustration