I have 2 raster datasets, crop yield and elevation for the same field. I want to find out whether there is a correlation between them, and, if possible, to produce a plot or table which I can plot to produce a liner of best fit. I haven't been able to find a tool in ArcGIS which allows me to compare two raster datasets. Any ideas?

there are tools in the Spatial Analyst tools

Exploratory Regression—Help | ArcGIS for Desktop

but you need to assess spatial autocorrelation

Spatial Autocorrelation tool graphical output—Help | ArcGIS for Desktop

There is a cavaet that doing regression on spatial data at the best of times, has a large number of conditions

Geographically Weighted Regression (GWR)—Help | ArcGIS for Desktop

An overview is An overview of the Spatial Statistics toolbox—Help | ArcGIS for Desktop

But I suspect that you are really looking to see whether there is a pattern in the results and not needing a predictive pattern because the basic tennant of simple regression are not met by using two rasters as input since the 'observation points' are not uncorrelated.

If you classify your inputs into nominal classes, you could use the Combine—Help | ArcGIS for Desktop to show whether the association between the variables results in combinations of the classes. The class divisions, however will affect the outcomes.

I would venture forth carefully to avoid suggesting that there is a 'correlation' between these two variables using interval ratio data since you could end up implying that an increase in elevation by 5 meters resulted in a 2% decrease in crop yield. A ridiculous statement, even if the numbers supported the results. How to Lie with Statistics - Wikipedia, Spurious correlation - Wikipedia a required read and there are many other examples of the misappropriation or inappropriate use of statistical tests. Spurious correlations: Margarine linked to divorce? - BBC News