A.Izquierdo
27/5/2020
This is a presentation showing a quick data analysis App published in ShyniApps.io in this link. The github repo with the source files is in this link We’ve used the diamonds dataset as source of information. In this presentation we’ll go through the application and explain its usage.
The user interface file contains four tabs.
Basic data. Shows a summary of the Diamonds dataset and the first three rows of values. The information can be filtered by diamond cut clicking the checkbox and selecting the cut type in the dropdown list. In case the checkbox is not selected, no filter is applied.
Simple plot and model. Displays a carat vs. price plot and a linear model fitting prices based on the number of carats. With a slider, the user can move along the model selecting the number of carats and get an estimation of the price (based on the model prediction.
Filtered plot and model. In this tab the user can select the diamond color and both the plot and a liner model (carats vs. price) will be filtered with the selection. Like in tab 2, the user can move along the linear fit selecting the number of carats with a slider to see the estimated diamond price.
How-to. Finally the last tab shows the basic documnentation you’re reading on how to use the aplication
In the first tab, the user can get a summary of the diamonds data. Data can be filtered by cut type.
In the second tab, the user gets a plot of price vs. carats and a linear model that fits both variables. Selecting the carat mass, the user can get the predicted diamond value.
The lineal model and plot generated plus moving point for the prediction based on the selected carats
#linear model
model<- lm(price ~ carat, data = diamonds)
plot(diamonds$carat, diamonds$price, xlab = "Mass(carats)", ylab = "Price (Sin$)",
bg="lightblue",cex=1,pch=21,frame=FALSE,col = alpha("blue", 0.05),
xlim = c(0, 3.5))
# plot line with the model
abline(model, col = "red", lwd = 2)
#}
points(caratInput, modelpred(), col = "red", pch = 16, cex = 2)The slider plus tabs show like this:
In the third tab, the user gets a plot of price vs. carats and a linear model that fits both variables after filtering the diamond color. Like in the previous tab, the user can select the carat mass, the user can get the predicted diamond value. This second analysis provides an interesting insight compared to the previous one.