Excel Trend line (SLOPE() ) and CORREL() yields different coefficients - excel

I'm trying to use excel to get the coefficient for two financial market spreads using two methods on data series Sprd1 against data series Sprd2:
1) I used scatter plot and simply added a trend line, showing R^2 (0.4052) and Coefficient (0.614). Trend line should be using SLOPE() to get the coefficient...
2) I used =CORREL(Sprd1, Sprd2), showing 0.637; =RSQ(Sprd1, Sprd2), yielding 0.4052.
I understand that the R-sq values should be pretty close. But why would the coefficents differ? I'm trying to look for any difference in terms of excel's embedded methods or assumptions on the trendline and the CORREL.
Thank you very much!

While both RSQ and CORREL work from the same equation
the value returned by RSQ is the square of that result.
i.e. RSQ()=CORREL()^2
SLOPE, on the other hand, does not use (y-MEAN(y))^2, nor does it take a square root of the denominator:
so will give slightly different results, depending on the mean of y

Related

How to plot the correlation of two Cells in a scatter plot

Okay, I love to use excel to model my complex heat convection problem in a very visual way.
But now I want to compare the result for different input values. Is there a way to create a plot where x is my input variable (in a range i can decide) and y the result (which can be found in a different cell)?
I know, normally you would need to create a table that has all x values in one column and all y values are calculated in ONE STEP in an adjacent cell. But as my calculation is quite complex, this is not the case.
So in a very simplified way, this is how my excel looks like:
Simplified version of my problem
How would you create a scatter plot of such a relation?
I tried to google the problem, but I didn't find a similar question

Excel Interpolate with logarithmic prediction

Is there a function within Excel to Interpolate while taking into account a logarithmic prediction?
At the moment I am using linear interpolation but would like to find a better way to fill in the blanks if possible.
There's no logarithmic regression or interpolation in Excel, even in the Anlaysis ToolPak. You'll need much more advanced software for that, such as MatLab.
If you're stuck working in Excel... here's a possible mathematical solution:
Rather than working with the raw data x and y, instead try plotting x and a^y, where a is the base. (Or plotting log(x,a) against y.) If you have the correct base a (and there's no vertical offset), you will then have a linear relationship from which you can perform a linear interpolation as normal, then convert the interpolated values back to actual values by taking the log of them.
If you don't know what a is, then you can instead calculate a line of best fit for an arbitrary a, calculate the standard residuals, and then use Problem Solver to modify a until you get the lowest possible standard residuals, at which point you have the best estimate of a.
Similarly if there is a vertical offset b, you'll need to test some variables there that also result in a linear relationship. Plot x against a^(y-b)

How can I make a spectral plot in Excel?

I have two columns of data - first is fractions (goes on x-axis), second is integers (goes on y).
Is there a way to plot one against the other in a histogram type manner so it looks like a spectrum?
Use the "scatter plot" tool. It is also called a "scatter chart" tool. Once you have your chart in place, you can add a trend line to determine the formula for the relationship between x and y values. You will be able to find the formula in terms of y = mx+b. You can also determine the r squared value which will be important in the interpretation of the relationship. There are several options for scatter charts that might lead you off course, so experiment with the tool a bit to discover the correct options for your situation.

Averaging many curves with different x and y values

I have several curves that contain many data points. The x-axis is time and let's say I have n curves with data points corresponding to times on the x-axis.
Is there a way to get an "average" of the n curves, despite the fact that the data points are located at different x-points?
I was thinking maybe something like using a histogram to bin the values, but I am not sure which code to start with that could accomplish something like this.
Can Excel or MATLAB do this?
I would also like to plot the standard deviation of the averaged curve.
One concern is: The distribution amongst the x-values is not uniform. There are many more values closer to t=0, but at t=5 (for example), the frequency of data points is much less.
Another concern. What happens if two values fall within 1 bin? I assume I would need the average of these values before calculating the averaged curve.
I hope this conveys what I would like to do.
Any ideas on what code I could use (MATLAB, EXCEL etc) to accomplish my goal?
Since your series' are not uniformly distributed, interpolating prior to computing the mean is one way to avoid biasing towards times where you have more frequent samples. Note that by definition, interpolation will likely reduce the range of your values, i.e. the interpolated points aren't likely to fall exactly at the times of your measured points. This has a greater effect on the extreme statistics (e.g. 5th and 95th percentiles) rather than the mean. If you plan on going this route, you'll need the interp1 and mean functions
An alternative is to do a weighted mean. This way you avoid truncating the range of your measured values. Assuming x is a vector of measured values and t is a vector of measurement times in seconds from some reference time then you can compute the weighted mean by:
timeStep = diff(t);
weightedMean = timeStep .* x(1:end-1) / sum(timeStep);
As mentioned in the comments above, a sample of your data would help a lot in suggesting the appropriate method for calculating the "average".

Interpolate off a standard curve in Excel

Most simple thing to do on paper, but somehow near impossible to work out in Excel.
I need to interpolate off a standard curve in Excel.
I have a standard curve and need to find an unknown concentration of a known absorbance.
Just like this;
http://class.fst.ohio-state.edu/fst601/Lectures/spectt/Image161.gif
My lecturer would not give us any more hints than to either use the, linear regression equation (which i think i worked out but couldn't get it to calculate the concentration) or use the point finding/picking option (no idea what this could mean)
If anyone could help me out with this I would really appreciate it, and so would my whole class!
In excel, you can do it two ways:
Method 1: Use a standard interpolation/extrapolation formula. (Bingle)
Method 2: Plot any existing data points that you have as an x-y(scatter) plot. Right-click on the data line in the chart and choose 'Add trendline'. Excel will calculate a best-fit line for your data (using linear regression) and display the line over the top of your existing data. If you right-click on this trendline, you can adjust its settings and display properties of it, including the equation used to draw it. Once you have that equation, you can plug in any value of x and get the corresponding value of y.

Resources