library(tidyverse) library(fixest) WELLS <- read_csv("Data/Output_Data/Full_Data_Set.csv") WELLS$post <- WELLS$year>=2011 WELLS$I <- WELLS$year-2011 feols(af~sbd1*post|ditch_2000812+ ditch_2000631+ditch_other+ditch_2000829+ditch_2000798+ditch_2000816+ditch_2000753+ditch_2000623+ditch_2200627+contacts+year+sbd2+sbd3+sbd4+sbd5+sbd6,data=WELLS) iplot(feols(log(af+0.0001)~i(I,sbd1)|ditch_2000812+ ditch_2000631+ditch_other+ditch_2000829+ditch_2000798+ditch_2000816+ditch_2000753+ditch_2000623+ditch_2200627+contacts+year+sbd2+sbd3+sbd4+sbd5+sbd6,data=WELLS)) iplot(feols(af~i(year,sbd1,2010)+per_alfalfa+per_potatoes+per_alfalfa|year+sbd2+sbd3+sbd4+sbd5+sbd6+ditch_2000812^year+ditch_2000631^year+ditch_2000829^year+ditch_2000798^year+ditch_2000816^year+ditch_2000753^year+ditch_2000623^year+ditch_2200627^year,data=WELLS)) ?i WELLS <-WELLS %>% group_by(year,sbd1) %>% summarize(af=sum(af)) %>% ungroup ggplot(WELLS,aes(x=year,y=af,group=sbd1,color=(sbd1)))+geom_point()+geom_line()