Este análisis interpreta la variación mediante regresión lineal la densidad seca máxima y humedad óptima obtenidas en laboratorio más el grado de compactación determinada por la relación entre ρdcampo y ρdmax expresado en porcentaje.

Base de datos y ajuste del modelo lineal

library(tidyverse)
densidad<-c(1.6800,1.5687,1.8620,1.9487)
GC<-c(72,80,74,85)
Humedad<-c(14.70,18.00,12.65,13.00)
GRADO_COMPACTACION_HUMEDAD<-data.frame(densidad,GC,Humedad)
print(GRADO_COMPACTACION_HUMEDAD)
##   densidad GC Humedad
## 1   1.6800 72   14.70
## 2   1.5687 80   18.00
## 3   1.8620 74   12.65
## 4   1.9487 85   13.00
modelo1=lm(densidad~GC+Humedad,data =GRADO_COMPACTACION_HUMEDAD)
summary(modelo1)
## 
## Call:
## lm(formula = densidad ~ GC + Humedad, data = GRADO_COMPACTACION_HUMEDAD)
## 
## Residuals:
##         1         2         3         4 
## -0.011492  0.004708  0.011441 -0.004657 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)  
## (Intercept)  1.842772   0.143094  12.878   0.0493 *
## GC           0.011459   0.001715   6.681   0.0946 .
## Humedad     -0.066415   0.004145 -16.023   0.0397 *
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 0.01752 on 1 degrees of freedom
## Multiple R-squared:  0.9965, Adjusted R-squared:  0.9896 
## F-statistic: 144.4 on 2 and 1 DF,  p-value: 0.05874

Gráfico de Regresión lineal en 3D

library(scatterplot3d)
graf_3d<-scatterplot3d(x=GC,y=Humedad,z=densidad,pch=16, cex.lab=1,
                       highlight.3d=TRUE, type="h",title='Regresión lineal 3D', xlab='grado de compactación',
                       ylab='humedad óptima', zlab='densidad seca max')
graf_3d$plane3d(modelo1,lty.box = "solid",col='purple')

Superficie en función de la regresión

library(plotly)
mod_loess <- loess(densidad ~GC + Humedad, data=GRADO_COMPACTACION_HUMEDAD, 
                   degree=1, span=0.85)
gc <- with(GRADO_COMPACTACION_HUMEDAD, seq(min(GC), max(GC), len=25))
hum <- with(GRADO_COMPACTACION_HUMEDAD, seq(min(Humedad), max(Humedad), len=25))
newdata <- expand.grid(Humedad=hum, GC=gc)
fit.prestige <- matrix(predict(mod_loess, newdata), 25, 25)
plot_ly(x=gc, y=hum, z=fit.prestige) %>% add_surface() %>%
  layout(scene = list(xaxis = list(title = 'grado de compactación'),
                      yaxis = list(title = 'humedad óptima'),
                      zaxis = list(title = 'densidad seca máxima')))