12/25/2023 0 Comments Excel scatter plot with trend line![]() Finally, apply the formatting to the other columns by highlighting the cells containing the upper and lower error bounds, and dragging the blue square on the bottom right of the box across the rest of your data columns. Function TrendLineValue (x As Double) As Double Dim c As Chart Dim t As Trendline Dim s As String Get the trend line object this code assumes the first chart on the active sheet, and the first series, first. In this example, I subtracted the standard error (cell c4) from the average (cell C2).įind the upper and lower error bound for every time series in your data. You can write a vba user defined function to use the trend line formula to evaluate a given x. Similarly, subtract the error from the average to find the lower bound. ![]() So in our example, I added the average (cell C2) and the standard error (cell c4). So the trend line would show a value of -890.431 at the x value of 5757. This wont look quite as nice on your chart, especially since it becomes negative at a value of 3428. To find the upper bound of an error band, simply add the error to the average. Using the LINEST function, the linear equation that maps to your true x-axis data and to your true y-axis data is: y -0.38223x+1310.073. ![]() STEP 2: FIND THE UPPER AND LOWER BOUNDS OF EACH ERROR BAND ![]() In the example above, I use standard error but you could also use a confidence interval, standard deviation, variance, or any other measurement of uncertainty.īelow the rows containing the averages and standard deviations, we will add additional rows for the upper and lower bound of each error band. The rows should contain the averages and uncertainty measurements associated with each condition and the columns should contain measurements over time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |