Here is the subset of data from my dataframe which is used in this plot;
Year region gear Species.Code query LPUE 1974 Cyprus creel LOB Pre 0.31 1975 Cyprus creel LOB Pre 0.26 1976 Cyprus creel LOB Pre 0.33 1977 Cyprus creel LOB Pre 0.17 1978 Cyprus creel LOB Pre 0.2 1979 Cyprus creel LOB Pre 0.22 1980 Cyprus creel LOB Pre 0.38 1981 Cyprus creel LOB Pre 0.51 1982 Cyprus creel LOB Pre 0.57 1983 Cyprus creel LOB Pre 0.45 1984 Cyprus creel LOB Post 0.43 1985 Cyprus creel LOB Post 0.33 1986 Cyprus creel LOB Post 0.21 1987 Cyprus creel LOB Post 0.69 1988 Cyprus creel LOB Post 0.65 1989 Cyprus creel LOB Post 0.37 1990 Cyprus creel LOB Post 0.35 1991 Cyprus creel LOB Post 0.15 1992 Cyprus creel LOB Post 0.21 1993 Cyprus creel LOB Post 0.17 I have generated a line plot of time-series data and fitted two linear regressions one for the data up to 1984 and one for the data after 1984. Using the following code;
ggplot(subset(A7,region=="Cyprus"&gear=="creel"&Species.Code=="LOB"),aes(x=Year,y=LPUE,shape=query))+ geom_line()+ geom_smooth(method="lm")+ theme(panel.background = element_rect(fill = 'white', colour = 'black')) I would like to know firstly how I can print the equations on the plot (other examples I have found on stack overflow only deal with one lm) and secondly how I can save the lm models so that I can do a statistical test of the significance between them.