Brian-Elbel-s-Research-Projects / project-overview

A summary of current and past research projects in Elbel lab
0 stars 0 forks source link

Dropping Bespoke Unit for Reviewer #89

Open EmilHafeez opened 1 year ago

EmilHafeez commented 1 year ago

Dropping filter(!(regression_index=="3028cain_store12531" & monthno == 264 & daypart == 6 & treat == 1))

produces a strange effect on some specific restaurant-months on the daypart output graph

ggplot() + geom_path( data=trend %>% filter(daypart%in%c(3,4,5,6)) %>% distinct() %>% mutate(daypart=as.factor(daypart)), aes(x=month, y=mean, color=daypart)) +

geom_point(data=trend%>%filter(p<.05)%>% filter(daypart%in%c(3,4,5,6)) %>% distinct() %>% mutate(daypart=as.factor(daypart)), aes(x=month, y=mean, color=daypart),size=1) +

ggplot2::annotate(geom="label", x=6, y=50, label=" p<0.05", size=3) +

geom_point(aes(x=5.75,y=50),color="black",size=1) +

coord_cartesian(expand = FALSE, clip = "off") + geom_hline(yintercept = 0, color="grey", linetype="dashed", size=0.5) + scale_y_continuous(limits=c(-120,120,20),breaks=seq(-120,120,20)) + scale_x_continuous(breaks=seq(3,30,1)) + labs(title="", caption = "" ,x="Month", y="Difference-in-Difference Estimate") + scale_color_manual(name = "Time of Day", labels=item_daypart_percent_sales_label_vector, values = ggplot_palette_named_daypart) + theme_light(base_size = 20) + theme(plot.margin = unit(c(1, 1, 1, 1), "lines"),

plot.title = element_text(hjust = 0.5, size = 16), #position/size of title

    #axis.title.x = element_text(vjust=-1, size = 12), #vjust to adjust position of x-axis
    # axis.title.y = element_text(size = 12),
    # legend.text=element_text(size=10), 
    panel.grid.minor = element_blank())