Guest User

Untitled

a guest
Jan 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. 1 156 m³ 1,4 °C
  2. 2 199 m³ 0,3 °C
  3. 3 173 m³ 2,3 °C
  4. 4 69 m³ 9,6 °C
  5. 5 63 m³ 12,2 °C
  6. 6 9 m³ 16,9 °C
  7. 7 9 m³ 20,8 °C
  8. 8 9 m³ 18,5 °C
  9. 9 15 m³ 14,3 °C
  10. 10 19 m³ 11,4 °C
  11. 11 83 m³ 5,2 °C
  12. 12 62 m³ 4,2 °C
  13.  
  14. cons <- structure(c(156, 199, 173, 69, 63, 9, 9, 9, 15, 19, 83, 62), .Tsp = c(1,
  15. 1.91666666666667, 12), class = "ts")
  16. temp <- structure(c(1.4, 0.3, 2.3, 9.6, 12.2, 16.9, 20.8, 18.5, 14.3,
  17. 11.4, 5.2, 4.2), .Tsp = c(1, 1.91666666666667, 12), class = "ts")
  18.  
  19. fit <- lm(c(cons) ~ poly(c(temp), 2))
  20. summary(fit)
  21. #Residuals:
  22. # Min 1Q Median 3Q Max
  23. #-52.340 -7.920 -2.102 17.963 34.661
  24. #Coefficients:
  25. # Estimate Std. Error t value Pr(>|t|)
  26. #(Intercept) 72.167 7.451 9.686 4.66e-06 ***
  27. #poly(c(temp), 2)1 -201.911 25.810 -7.823 2.65e-05 ***
  28. #poly(c(temp), 2)2 69.987 25.810 2.712 0.0239 *
  29. #---
  30. #Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
  31. #Residual standard error: 25.81 on 9 degrees of freedom
  32. #Multiple R-squared: 0.8839, Adjusted R-squared: 0.8582
  33. #F-statistic: 34.28 on 2 and 9 DF, p-value: 6.18e-05
  34.  
  35. plot(c(temp), c(cons), pch = 16)
  36. lines(c(sort(temp)), predict(fit)[order(temp)], type = "b", col = "blue")
  37.  
  38. p <- predict(fit, newdata = data.frame(temp = c(5, 15)), se.fit = TRUE)
  39. res <- cbind(p$fit - 1.96 * p$se, p$fit, p$fit + 1.96 * p$se)
  40. colnames(res) <- c("lower limit", "pred", "upper limit")
  41. res
  42. # lower limit pred upper limit
  43. #1 83.072304 102.5629 122.05356
  44. #2 -5.487951 14.9201 35.32816
Add Comment
Please, Sign In to add comment