Plotly sildes

Yaswanth Pulavarthi

9/18/2020

Required data and lib

library(plotly)
## Warning: package 'plotly' was built under R version 4.0.2
## Loading required package: ggplot2
## Warning: package 'ggplot2' was built under R version 4.0.2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout
data(trees)

Lm model fit

lm(Girth~.-1, trees)->modfit
summary(modfit)
## 
## Call:
## lm(formula = Girth ~ . - 1, data = trees)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -1.8640 -0.6006 -0.1073  0.7941  2.7749 
## 
## Coefficients:
##        Estimate Std. Error t value Pr(>|t|)    
## Height 0.107632   0.006089   17.68  < 2e-16 ***
## Volume 0.166131   0.013566   12.25 5.52e-13 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.118 on 29 degrees of freedom
## Multiple R-squared:  0.9937, Adjusted R-squared:  0.9932 
## F-statistic:  2279 on 2 and 29 DF,  p-value: < 2.2e-16

Slide with R Output

options(warn=-1)
plot_ly(x = ~Girth, y = ~Height, z = ~Volume, data = trees,
        type = "scatter3d",color = ~Girth)

Summary

By seeing this data, we can clearly say that Girth is increasing by increase in data of Height and Volume of tree