tabulka <- read.table (file = "C3H6O3.txt", skip = 3, header = TRUE) tabulka summary (tabulka) names (tabulka) dim (tabulka) length (tabulka) model <- lm (Y ~ x, data = tabulka) model$coefficients coef (model) model$residual residuals (model) model$fitted.values fitted.values (model) model$model model.matrix (model) summary (tabulka) plot (c (0, 70), c (-5, 60), type = "n", xlab = "matka", ylab = "novorozenec", main = "linearni regresni model") points (tabulka$x, tabulka$Y, col = 4, pch = 24, lwd = 1.5, cex = 1.0) xx <- seq (0, 70, by = 0.1) length (xx) YY <- predict (model, data.frame (x = xx)) lines (xx, YY, col = 2, lwd = 1.5, lty = 2) dev.copy2pdf (file = "LRM.pdf")