library(dplyr)
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
library(reshape2)
library(ggplot2)

dat = read.csv("/home/michael/Downloads/x_1_jan_hdo.csv", stringsAsFactors = FALSE)

dat = dat[dat$id == 800, ]

# Plot 1
ggplot(dat, aes(x = hours, y = panel_output, group = days)) +
  geom_line(alpha = 0.5) +
  theme_bw()

# Plot 2
ggplot(dat, aes(x = factor(hours), y = panel_output)) +
  geom_boxplot() +
  theme_bw()

dat1 = 
  dat %>% 
  group_by(hours) %>% 
  summarize(
    min = min(panel_output),
    q10 = quantile(panel_output, 0.1),
    q25 = quantile(panel_output, 0.25),
    median = median(panel_output),
    q75 = quantile(panel_output, 0.75),
    q90 = quantile(panel_output, 0.9),
    max = max(panel_output)
  ) %>% 
  ungroup %>% 
  as.data.frame
dat1 = melt(dat1, id.vars = "hours")

# Plot 3
ggplot(dat1, aes(x = hours, y = value, colour = variable)) +
  geom_line() +
  geom_point() +
  theme_bw()