diff --git a/M1/General Linear Models/TP1/.RData b/M1/General Linear Models/TP1/.RData deleted file mode 100644 index 4cc005e..0000000 Binary files a/M1/General Linear Models/TP1/.RData and /dev/null differ diff --git a/M1/General Linear Models/TP1/.Rhistory b/M1/General Linear Models/TP1/.Rhistory deleted file mode 100644 index 6534365..0000000 --- a/M1/General Linear Models/TP1/.Rhistory +++ /dev/null @@ -1,363 +0,0 @@ -library(rmarkdown) -health <- read.table("health.txt", header = TRUE, sep = " ", dec = ".") -paged_table(health) -library(dplyr) -names(health) -library(dplyr) -names(health) -Health<-health[,2:4] -names(Ozone) -library(dplyr) -names(health) -Health<-health[,2:4] -names(Health) -library(dplyr) -names(health) -Health<-health[,2:5] -names(Health) -library(ggplot2) -library(plotly) -p1<-ggplot(health) + aes(x = T12, y = maxO3) + geom_point(col = 'red', size = 0.5) + geom_smooth(method = "lm", se = FALSE) -ggplotly(p1) -library(ggplot2) -library(plotly) -p1<-ggplot(health) + aes(x = age, y = y) + geom_point(col = 'red', size = 0.5) + geom_smooth(method = "lm", se = FALSE) -ggplotly(p1) -library(rmarkdown) -health <- read.table("health.txt", header = TRUE, sep = " ", dec = ".") -paged_table(health) -library(rmarkdown) -health <- read.table("health.txt", header = TRUE, sep = " ", dec = ".") -paged_table(health) -library(dplyr) -library(corrplot) -install.packages("corrplot") -library(dplyr) -library(corrplot) -correlation_matrix<-cor(Health) -library(dplyr) -library(corrplot) -correlation_matrix<-cor(health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -GGally -install.packages("GGally") -library(dplyr) -library(corrplot) -correlation_matrix<-cor(health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -library(GGally) -ggpairs(Ozone) -library(dplyr) -library(corrplot) -correlation_matrix<-cor(health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -library(GGally) -ggpairs(health) -library(dplyr) -library(corrplot) -correlation_matrix<-cor(health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -library(GGally) -ggpairs(health) -library(dplyr) -library(corrplot) -correlation_matrix<-cor(health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -Health <- health[2:5] -library(dplyr) -library(corrplot) -correlation_matrix<-cor(Health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -model <- lm(y ~ ., data = Health) -coefficients(model) -summary(model) -library(ggfortify) -install.packages("ggfortify") -library(ggfortify) -autoplot(mod,1) -library(ggfortify) -autoplot(model,1) -library(ggfortify) -autoplot(model,1) -autoplot(model,3) -library(ggfortify) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -install.packages("car") -library(ggfortify) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -library(ggfortify) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -library(ggfortify) -library(car) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -library(ggfortify) -library(car) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -library(ggfortify) -library(car) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -autoplot(model,2) -model <- lm(y ~ age, data = Health) -coefficients(model) -library(ggfortify) -library(car) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -autoplot(model,2) -model <- lm(y ~ ., data = Health) -coefficients(model) -library(ggfortify) -library(car) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -autoplot(model,2) -library(ggfortify) -library(car) -autoplot(model,1) -autoplot(model,3) -set.seed(0) -durbinWatsonTest(model) -autoplot(model,2) -model <- lm(y ~ ., data = Health) -coefficients(model) -summary(model) -model <- lm(y ~ age, data = Health) -coefficients(model) -summary(model) -library(ggfortify) -library(car) -autoplot(model,1) -model <- lm(y ~ ., data = Health) -coefficients(model) -summary(model) -library(ggfortify) -library(car) -autoplot(model,1) -library(GGally) -ggpairs(model) -library(GGally) -ggpairs(health) -library(GGally) -ggpairs(Health) -library(GGally) -ggpairs(Health, mapping = F) -library(GGally) -ggpairs(Health, progress = F) -model2 <- lm(y ~ age**2 + tri + chol, data = Health) -model2 <- lm(y ~ age**2 + tri + chol, data = Health) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -autoplot(model2,3) -set.seed(0) -durbinWatsonTest(model2) -autoplot(model2,2) -model2 <- lm(y ~ sqrt(age) + tri + chol, data = Health) -summary(model2) -coefficients(model2) -model2 <- lm(y ~ sqrt(age) + tri + chol, data = Health) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -Health2 <- Health -Health2[1] <- Health2[1]^2 -model2 <- lm(y ~ ., data = Health) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -View(Health) -View(Health) -View(Health2) -View(Health2) -Health2 <- Health -View(Health2) -View(Health2) -Health2 <- Health -Health2[2] <- Health2[2]^2 -model2 <- lm(y ~ ., data = Health) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -View(Health2) -View(Health2) -autoplot(model2,3) -Health2 <- Health -Health2[2] <- Health2[2]^2 -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -autoplot(model2,3) -set.seed(0) -durbinWatsonTest(model2) -autoplot(model2,2) -Health2 <- Health -Health2[2] <- sqrt(Health2[2]) -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -Health2 <- Health -Health2[2] <- Health2[2]^2 -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -Health2 <- Health -Health2[2] <- Health2[2]^2 -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -autoplot(model2,3) -Health2 <- Health -Health2[6] <- Health2[2]^2 -View(Health2) -View(Health2) -Health2 <- c(Health, c()) -Health2[6] <- Health2[2]^2 -Health2 <- c(Health, c()) -Health2[5] <- Health2[2]^2 -View(Health2) -View(Health2) -Health2 <- Health -Health2 <- append(Health2, Health[2]^2) -model2 <- lm(y ~ ., data = Health2) -View(Health2) -Health2 <- Health -Health2 <- append(Health2, Health[2]^2) -model2 <- lm(y ~ ., data = Health2) -Health2 <- Health -# Add to Health a new column with the square of the age named age_sq -Health2$age_sq <- Health2$age^2 -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -View(Health2) -Health2 <- Health -the age named age_sq -library(ggfortify) -library(car) -autoplot(model2,1) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -autoplot(model2,3) -autoplot(model2,2) -View(Health2) -View(Health2) -Health2 <- Health -Health2$age_sq <- sqrt(Health2$age) -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -View(Health2) -View(Health2) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -Health2 <- Health2[1:99,] -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -Health2 <- Health2[1:5,24] -model2 <- lm(y ~ ., data = Health2) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -Health2 <- Health2[1:5,] -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -View(Health2) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -Health2 <- Health2[1:24,] -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(ggfortify) -library(car) -autoplot(model2,1) -autoplot(model2,3) -set.seed(0) -durbinWatsonTest(model2) -autoplot(model2,2) -Health2 <- Health -Health2$age_sq <- Health2$age^2 -Health2 <- Health2[1:24,] -model2 <- lm(y ~ ., data = Health2) -summary(model2) -coefficients(model2) -library(rmarkdown) -health <- read.table("health.txt", header = TRUE, sep = " ", dec = ".") -paged_table(health) -Health <- health[2:5] -library(dplyr) -library(corrplot) -correlation_matrix<-cor(Health) -corrplot(correlation_matrix, order = 'hclust',addrect = 3) -model <- lm(y ~ ., data = Health) -coefficients(model) -summary(model) -library(ggfortify) -library(car) -autoplot(model2,1:4) -library(ggfortify) -library(car) -autoplot(model,1:3) -install.packages(c("askpass", "boot", "data.table", "evaluate", "foreign", "fs", "glue", "gtable", "jsonlite", "MASS", "Matrix", "nlme", "quantreg", "Rcpp", "rmarkdown", "rstudioapi", "survival", "sys", "tinytex", "withr", "xfun")) diff --git a/M1/General Linear Models/TP1/TP1.Rproj b/M1/General Linear Models/TP1/TP1.Rproj deleted file mode 100644 index 8e3c2eb..0000000 --- a/M1/General Linear Models/TP1/TP1.Rproj +++ /dev/null @@ -1,13 +0,0 @@ -Version: 1.0 - -RestoreWorkspace: Default -SaveWorkspace: Default -AlwaysSaveHistory: Default - -EnableCodeIndexing: Yes -UseSpacesForTab: Yes -NumSpacesForTab: 2 -Encoding: UTF-8 - -RnwWeave: Sweave -LaTeX: pdfLaTeX