This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| VO2i_methode1 = fcast$fcst[1]; VO2i_methode1 | |
| x = VO2i_methode1$VO2i_methode1[,1]; x | |
| VO2i_methode1inv =ts(c(mymts[,1], x)) | |
| plot(VO2i_methode1inv) | |
| fit = nnetar(mymts[,1]);fit | |
| nnetforecast <- forecast(fit, h = 400, PI = T) | |
| plot(nnetforecast) | |
| fit2 = nnetar(mymts[,1], xreg = mymts[,2]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mymts<-dataset%>%dplyr::select(VO2i_methode1,DO2i_methode1,RQ_methode1)%>%ts(.) | |
| mymts | |
| plot(mymts) | |
| theme_set(theme_bw()) | |
| autoplot(mymts) + | |
| ggtitle("Time Series Plot of the `mymts' Time-Series") + | |
| theme(plot.title = element_text(hjust = 0.5)) #for centering the text | |
| class(mymts) | |
| apply(mymts, 2, adf.test) | |
| plot.ts(mymts) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dataset%>% | |
| summarise_by_time(Tijdstip,.by="minute",VO2i_verschil_mean=mean(VO2i_verschil,na.rm=TRUE))%>% | |
| plot_time_series_regression(.date_var = Tijdstip, | |
| .formula = VO2i_verschil_mean~ as.numeric(Tijdstip) + | |
| minute(Tijdstip), | |
| .interactive = FALSE, | |
| .facet_ncol=2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(dataset, aes(x=as.factor(ID))) + | |
| geom_boxplot(aes(y=VO2i_methode1, fill="red"),alpha=0.5, color="black") + | |
| geom_boxplot(aes(y=VO2i_methode2, fill="darkgreen"), alpha=0.5, color="black") + | |
| scale_y_continuous("VO2 method 1 (red) & 2 (darkgreen)")+ | |
| theme_bw()+ theme(legend.position = "none") | |
| ggplot(dataset, aes(x=as.factor(Meting))) + | |
| geom_boxplot(aes(y=as.numeric(VO2i_methode1-VO2i_methode2))) + | |
| theme_bw() + theme(legend.position = "none") | |
| ggplot(dataset, aes(x=as.factor(ID))) + | |
| geom_boxplot(aes(y=VO2i_methode1-VO2i_methode2, fill="purple"),alpha=0.5, color="black") + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(dataset, aes(x=Tijdstip, y=PO2art, colour=as.factor(PO2art_bin))) + | |
| geom_point() + | |
| facet_wrap(~ID, scales="free")+ | |
| theme_bw()+ theme(legend.position = "bottom") | |
| ggplot(dataset, aes(x=Tijdstip, y=DO2i_methode1, colour=as.factor(DO2i_methode1_gen_bin))) + | |
| geom_point() + | |
| facet_wrap(~ID, scales="free")+ | |
| theme_bw()+ theme(legend.position = "bottom") | |
| ggplot(dataset, aes(x=Tijdstip, y=DO2i_methode1,colour=as.factor(DO2i_methode1_cath_bin))) + | |
| geom_point() + |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(dataset, aes(x=as.numeric(ElapsedTime), y=VO2cdi,colour=as.factor(ID))) + | |
| geom_line() + | |
| theme_bw()+ theme(legend.position = "none") | |
| ggplot(dataset, aes(x=as.numeric(ElapsedTime), y=VO2cdi,colour=as.factor(ID))) + | |
| geom_point() + | |
| theme_bw()+ theme(legend.position = "none") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ggplot(dataset, aes(x=Tijdstip, y=Flow, colour=as.factor(ID))) + | |
| geom_line() + | |
| theme_bw() | |
| ggplot(dataset, aes(x=as.numeric(ElapsedTime), y=Flow,colour=as.factor(ID))) + | |
| geom_line() + | |
| theme_bw()+ theme(legend.position = "none") | |
| ggplot(dataset, aes(x=Tijdstip, y=Flow, colour=as.factor(ID))) + | |
| geom_line() + | |
| facet_wrap(~ID, scales="free")+ | |
| theme_bw() + theme(legend.position = "none") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(readxl) | |
| library(skimr) | |
| library(tidyverse) | |
| library(dplyr) | |
| library(ggplot2) | |
| library(caret) | |
| library(car) | |
| library(skimr) | |
| library(forecast) | |
| library(lubridate) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| dataset <- read_excel(".xlsx", col_types = c("numeric", "numeric", "date", | |
| "numeric", "numeric", "numeric","numeric", "numeric", "numeric", | |
| "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", | |
| "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", | |
| "numeric", "numeric", "numeric", "numeric", "numeric", "numeric", | |
| "numeric", "numeric")) | |
| str(dataset) | |
| skim(dataset) | |
| attach(dataset) | |
| dataset$ID<-as.factor(dataset$ID) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| results <- resamples(list(PR=pm1, | |
| EN=enet1, | |
| NN=brnn1)) | |
| summary(results) | |
| bwplot(results) | |
| dotplot(results) |