Add a trend line to a scatter graph

for my physics work i had to plot a graph and i need to add a trendline to the graph. I have plotted the graph as a scatter chart but dont know how to add a line of best fit, please help

Search "linear regression' in Numbers Help.
The FORECAST() function can be used to calculate the end points for the trend line using the minimum and maximum X values in your data set for the x value argument.
For example, with your data pairs listed in B3:B12 (x values) and C3:C12 (y values), add these values and formulas:
D3: 0
E3: =FORECAST(D3, C3:C$12, B3:B12)
D4: =MAX(B3:B12)
E4: =FORECAST(D4, C3:C$12, B3:B12)
The data pair on row 3 mark the y axis intercept of the trend line.
The pair on line 4 mark the position of the trend line where its x value is equal to the maximum x value of the data set. As plotting this pair may obscure the data point at this x value, you may want to move the trend line point to the right. To do this, add an arbitrary amount to the value in D4. The size of the added amount will depend on the scale of your graph.
eg. D4: =MAX(B3:B12)+2
If your data set includes negative x values, replace the formula in D3 with the mirror of the one in D4:
D3: =MIN(B3:B12)-2
Again, the "-2" is an arbitrary value used to extend the trend line beyond the collected x values.
This will allow you to plot these two points onto your scatter graph as a second data set. I don't see a means of making Numbers connect the points, so you will have to add the line manually.
Regards,
Barry

Similar Messages

  • Other lines parallel to a Best fit line on a scatter graph?

    Can you put Lines of equal gradient to the best fit line on a scatter graph going through to points furthest above and below the best fit line?

    Simplified a bit so I am not so ashamed
    I2=SLOPE(C2:C9,B2:B9)
    I3=INTERCEPT(C2:C9,B2:B9)
    Y Linear (column D) =$I$3+B2×$I$2
    Y - YLinear (column G) is what it says
    Max Line (column E) = $D2+MAX(G)
    Min Line (column F) = =$D2+MIN(G)
    You have to format the "trend" lines with connecting lines and no data symbol

  • How do i generate the formula line for a scatter graph?

    While using Numbers_08 to create a scatter graph, I am able to easily create the graph, but cannot generate the graph formula line (the line which shows the average of the points for the graph).
    Is there a way to do this, as with Excel and Quattro Pro?

    I have just found out from the Archives, it is not possible to generate a formula line (trend line) in Numbers_08.
    I am currently upgrading to Numbers_09.

  • Displaying a trend line (in line chart) in SSRS

    We have a line graph which plots the actual data points (x,y), everything is working fine with this graph. Now we need to add a trend line to this existing graph after going thro. the articles we came to know that there is no direct option in SSRS to draw a trend line. So we need to calculate the trend values ourselves which we need to plot as atrend line. This trend line is similar to the trend line which comes in Excel chart, do anyone know how to calculate the trend values from the actual data points. We got through several formulas, but were not clear, have anyone tried out exactly the same, if so please help us out by providing an example to calculate the trend values.

    The default functionality of Reporting Services does not support trend lines.  There are some additional tools you can purchase to achieve this though, which is talked about in the first link below.
    You can take a look at this post:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1148970&SiteID=1
    and this one:  http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=322398&SiteID=1
    Jarret

  • Trend line in scatter chart

    Hi,
    Is it possible to add a trend line to an existing scatter chart?
    Thanks.
    Andy

    The Regression/Trend Line is calculated using the Least Squares Regression method. You can get all the information on what goes into the calculations for Least Squares Regression on wikipedia.
    Then create an actionscript class (its not particularly complicated) that does the Least Squares Regression calculations on a series of x and y observations (that you used to create your plot chart).
    Once you have calculated the Least Squares Regression data for your plot series, you add a line series to your plot chart. Each observation in the lineSeries data should use the x value (independant variable) from the plot data and the calculated y value from your Least Squares Regression class.

  • Numbers 3.1 restricting the period for moving average trend lines

    Numbers 3.1 is restricting the period I can specify for a moving average trend line for a scatter plot series. The max is 6. This limitation was not present in the previous version of Numbers.
    Charts imported from the previous version retain larger periods, but there is no way I can see to specify periods >6 for any new series. Is there a way to allow a period >6? That is clearly necessary for many applications.
    Thanks.

    Hi Bill,
    Numbers 3.1
    If you want a 14 day moving average over the prior 14 days, the formula in C10 is
    =AVERAGE(B2:B15) (and Fill Down)
    The formula will eventually run out of cells. Hence the red error triangles.
    Plotting columns A, B and C:
    X axis is Day (column A)
    Blue circles and blue line are Actual Y (column B and as expected, they jump around).
    Black circles and black line are calculated moving averages on a 14 day period (column C)
    Red line is Numbers Trendline (Moving Average, Period 6). How it predicts into the future (Moving Average over 6 days) I have no idea.
    I would more trust a calculated moving average, because I know what it is calculating.
    Regards,
    Ian.

  • How to get trending line in the graph

    Hi,
    I am using 10g. I have requirement as the following :
    Name Date Metric
    I can have bar graph against Date and Metric. My requirement is to have a trending line, so I calculated slope and regression line y=mx+c but I am not getting the right trend line. I can use regr_slope function to create a view in rpd but it doesnt support date values. Can you guys let me know how to get trending line like same in Excel.
    Thanks

    Hi,
    It's better to do at UI level.
    Can you please check the below link:
    http://kpipartners.blogspot.in/2009/04/linear-regression.html
    Hope this helps.
    Thanks,
    Pramod.

  • Hi can I use apple pages to create a line or scatter graph ?

    Hi can I use apple pages to create a line or scatter graph ?

    If you need to see the legal document that makes this OK see this Apple document, section 2C

  • Trend Line/Regression Capabilities

    Does BIP have the ability to create trend/regression lines?
    I have a scatter plot graph, and I want to create a trend line for the existing scatter plot data set (similar to how excel does it).
    I don't see any options in the wizard, so I assume this requires coding.
    thanks

    chart:
    <Graph stylePath="/oracle/dss/graph/styles/executive.xml" graphType="SCATTER"><LegendArea visible="true" />*<SeriesItems defaultFitlineType="FT_LINEAR"/>*<X1Title text="Sales" visible="true" /><Y1Title text="% Market Share" visible="true" /><LocalGridData colCount="2" rowCount="{count(.//ROW)}"><RowLabels><xsl:for-each select=".//ROW" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><Label><xsl:value-of select="_Broker_Facts_._DEALER" /></Label></xsl:for-each></RowLabels><DataValues><xsl:for-each select=".//ROW" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><RowData><Cell><xsl:value-of select="_Broker_Dealer_Facts_.WHOLESALE_FUND" /></Cell><Cell><xsl:value-of select="_Broker_Dealer_Facts_._Share___" /></Cell></RowData></xsl:for-each></DataValues></LocalGridData></Graph>
    Returns a blank graph area in the .pdf

  • Why doesn't the scatter graph display properly??

    Hi,
    I've already posted a thread regarding scatter graph
    but nobody (not even from Macromedia!) has been able to give me
    an answer and I've been trying on my own since then, but to no
    avail!
    I refer to WhazzInAName said on Dec 31, 2004 at 9:51 AM on
    Cfchart
    Livedocs
    I copied only the scatter graph part, pasted it in a CFM page
    and run it. It displayed fine.
    However, if I try to add more than 1 value for a particular
    chartdata item, e..g.
    <cfchartdata item="25" value="99.357">
    <cfchartdata item="25" value="90">
    <cfchartdata item="25" value="65">
    The graph only displays the value 65, but not the other 2!
    I tried plotting the same values in an Excel chart and there
    was no problem at all. All points displayed correctly!!!
    What's wrong with this cfchart?? Why isn't it displaying the
    other 2 values???
    Also, there is no possibility with the chart in Report
    Builder to specify sortxaxis="yes" xaxistype="scale"
    yaxistype="scale", or is it available somewhere?
    Thanks and regards,
    Yogesh Mahadnac

    Hi Ted,
    Thanks for replying.
    Too bad CF Report Builder can't handle such issues.
    Hope it's going to be
    MUCH BETTER with CF8?
    Thanks and regards,
    Yogesh Mahadnac

  • How to create trend line in cfchart?

    I can create a scatter chart in cfchart - but I do not know how to create a linear regression trend line in the same chart as a second data series. Kodemonki provided an answer in a forum discussion a few years ago (http://forums.adobe.com/message/192848#192848) - but I am not able to make it work (I have a dangerously small knowledge of coldfusion and statisitcal formulas). Can someone tell me where i put in my to data query variables - such as for a query that gives results for two data fields, "Item1" and "Item2".
    Here is Kodemonki's solution:
    <!--- The min setting is a preference based on how you want the data to be displayed. --->
    <!---<cfset min = arrayMin(grabData["value"]) - 5>--->
         <cfset min = 0>
         <cfset max = ceiling(arrayMax(grabData["value"])) + 1>
         <cfset n = grabData.recordCount>
         <cfset sum_x = 0>
         <cfset sum_x2 = 0>
         <cfset sum_xy = 0>
         <cfloop from="1" to="#grabData.RecordCount#" index="i">
              <cfset sum_x = sum_x + i>
              <cfset sum_xy = (i*grabData.value[i]) + sum_xy>
              <cfset sum_x2 = sum_x2 + (i*i)>
         </cfloop>
         <cfset sum_y = arraySum(grabData["value"])>
         <cfset slope = round(((n*sum_xy) - (sum_x*sum_y))/((n*sum_x2) - (sum_x*sum_x)))>
         <cfset intercept = round((sum_y - (slope*sum_x))/n)>
         <cfset best_fit = QueryNew("id, value")>
         <cfloop from="1" to="#grabdata.RecordCount#" index="i">
              <cfset queryAddRow(best_fit)>
              <cfset value = round((slope*i) + intercept)>
              <cfset QuerySetCell(best_fit, "id", grabData.xlabel[i])>
              <cfset QuerySetCell(best_fit, "value", value)>
         </cfloop>
         <cfchart scalefrom="#min#" scaleto="#max#" title="#GrabDatapointInfo.label#" format="jpg" chartHeight="450" chartwidth="500" xaxistitle="Month/Year">
              <cfchartseries type="line" query="best_fit" valuecolumn="value" itemcolumn="id"/>
              <cfchartseries type="line" query="grabData" valuecolumn="value" itemcolumn="xlabel"/>
         </cfchart>

    Have you read the docs for CFCHART, CHCHARTSERIES, etc?  Did you mess around with the example code sufficiently so you understand how the tags work?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79 30.html
    Adam

  • How to create a trend line in cfchart?

    I  can create a scatter chart in cfchart - but I do not know how to create  a linear regression trend line in the same chart as a second data  series.
    Kodemonki provided an answer in a forum discussion a few years  ago (http://forums.adobe.com/message/192848#192848).
    But I am not able to make it work (I have a dangerously small  knowledge of coldfusion and statisitcal formulas).
    Can someone tell me  where i put in my to data query variables - such as for a query that  gives results for two data fields, "Item1" and "Item2".
    Thanks!
    Here is Kodemonki's solution:
    <!--- The min setting is a preference based on how you want the data to be displayed. --->
    <!---<cfset min = arrayMin(grabData["value"]) - 5>--->
         <cfset min = 0>
         <cfset max = ceiling(arrayMax(grabData["value"])) + 1>
         <cfset n = grabData.recordCount>
         <cfset sum_x = 0>
         <cfset sum_x2 = 0>
         <cfset sum_xy = 0>
         <cfloop from="1" to="#grabData.RecordCount#" index="i">
              <cfset sum_x = sum_x + i>
              <cfset sum_xy = (i*grabData.value[i]) + sum_xy>
              <cfset sum_x2 = sum_x2 + (i*i)>
         </cfloop>
         <cfset sum_y = arraySum(grabData["value"])>
         <cfset slope = round(((n*sum_xy) - (sum_x*sum_y))/((n*sum_x2) - (sum_x*sum_x)))>
         <cfset intercept = round((sum_y - (slope*sum_x))/n)>
         <cfset best_fit = QueryNew("id, value")>
         <cfloop from="1" to="#grabdata.RecordCount#" index="i">
              <cfset queryAddRow(best_fit)>
              <cfset value = round((slope*i) + intercept)>
              <cfset QuerySetCell(best_fit, "id", grabData.xlabel[i])>
              <cfset QuerySetCell(best_fit, "value", value)>
         </cfloop>
         <cfchart  scalefrom="#min#" scaleto="#max#" title="#GrabDatapointInfo.label#"  format="jpg" chartHeight="450" chartwidth="500"  xaxistitle="Month/Year">
              <cfchartseries type="line" query="best_fit" valuecolumn="value" itemcolumn="id"/>
              <cfchartseries type="line" query="grabData" valuecolumn="value" itemcolumn="xlabel"/>
         </cfchart>

    Have you read the docs for CFCHART, CHCHARTSERIES, etc?  Did you mess around with the example code sufficiently so you understand how the tags work?
    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-79 30.html
    Adam

  • Can You Create Trend Line in CFCHART?

    Have pretty much got CF7 Charts and WebCharts3D down, at
    least to the point where they can do what I need the most. However,
    the one thing I'd like to be able to do, but not sure if it's
    possible, is create a TREND LINE.
    This would be a LINE charts with 2 series. The first series
    would be a line with the actual counts covering a period of time.
    I'd like to add a 2nd line, using the same data from the
    first series, but have it displayed as a TREND line. In Excel, you
    can easily create a TREND line, it's even offered as an option.
    I've seen somehwere (CFCHART or WebCharts3D) something to so
    with "logarithmic" options, which is one of the options for Excel
    charts.
    Two more quick questions:
    Q1. Is there any way to control the margin between the left
    and right borders of the charts, and the bars? Have tried
    experimenting, but can't seem to get this to work. Reason is, when
    I try to show a chart in 3D, the first bar on the left is "butted
    up" against the left chart border. Would like to add a little space
    there.
    Q2. Rather than display rectangular bars, I'd like to display
    rounded cylinders. I've tried setting the chart type in CFCHART to
    "cylinder" but it still displays a bar. When I try to change the
    type to "cylinder" in WebCharts3D, the chart STILL displays
    rectangular bars. Yet I've seen many examples of rounded, cylinder
    bars.
    Don't mean to push my luck with too many questions. Thanks
    for any advice, help.
    Gary

    Trend Lines:
    CFChart does not do trend lines of any type. However, it is
    not too difficult to compute the regression of your choice and to
    plot it as a second series.
    Logarithmic:
    Not sure what you are asking here.
    In theory, cfchart does do log-lin and log-log charts.
    However, it is so buggy, and the scaling problems are so
    great, that we have never been able to get it to work well.
    We use ChartDirector for anything that requires a log scale.
    Side margins:
    You cannot control these directly. Here are some workarounds:
    For "Category" axis:
    Make sure the "isBucketed" property is set to true (this is the
    default).
    If that is not enough, add extra bars to your data series,
    usually value zero. It's not ideal but it may be good enough.
    For "Scale" axis:
    Usually this works well enough. Otherwise, try toggling the
    "isAbsolute" property.
    The only other recourse is to manually scale the plot using the
    "scaleMin" and "scaleMax" properties. This can be a real pain for
    obvious reasons and also because cfchart scaling is fraught with
    bugs and "quirks".
    Cylinder Bars:
    These work. Perhaps there was a setting conflict within the
    XML or between the CFChartSeries setting and the XML?
    Also the cylinders will only look round when 3D is turned on.
    (Side view of a cylinder is just a shaded bar.)
    Anyway, I've said it before: cfchart is barely usable for a
    very limited range of charts.
    For real business or common engineering and scientific needs,
    you need to step up to something better.
    The package we use (has all the features and very reasonably
    priced) is ChartDirector (
    http://www.advsofteng.com/cdcoldfusion.html).
    (And, no, I'm not affiliated.)

  • How do I do a line of best fit graph!!?

    Hi guys, I need to do a line of best fit graph comparing two sets of numbers. I have the info on a scatter graph but can not find how to insert a line of best fit. The other graph options dont represent the data correctly. any help would be appreciated, thanks, Nick.

    Here's a link to how we did it in the "old days":
    http://www.regentsprep.org/Regents/math/data/linefit.htm
    http://mathdemos.gcsu.edu/mathdemos/lsq-demonew/indexnew.html
    Regards,

  • Dates not recognised in scatter graphs

    I have some data consisting of date-value pairs which I want to graph on what I would call an x-y graph, but which some call a scatter graph.
    So I want each date plotted along the x-axis with the value up the y-axis.
    However, when I create a graph, Numbers doesn't recognise the dates as dates, so uses them as discrete categories, ie with each date equally spaced across the x-axis, even though the dates themselves aren't evenly spaced.
    For example, if I had dates of 1-Jan-14, 3-Jan-14, 15-Jan-14, 6-Jun-14, Numbers would space them all evenly.
    The cells containing the dates are properly formatted as dates. It's only the graph that doesn't seem to pick up on the data being date-based.
    I read various other threads which say this was a problem with earlier versions of Numbers 3 but was fixed (in version 3.1 IIRC). I'm using 3.2, and it's not fixed for me!
    I'm a UK-based user and therefore use international date formats (as opposed to US date format). Could this be part of the problem?
    TIA
    David

    Hi David,
    A Scatter Plot requires that X and Y are not in Header Columns. You can have a Header Row for the axis titles (but they don't appear as titles on the plot; not sure how to make that happen without manually entering the titles on each axis).
    X values need not be evenly spaced. X axis label values will be linear and will not be categories. Nor will they line up with individual X values (which is how a Scatter Plot should behave).
    Column B looks like it is a Header Column, but it isn't. That grey fill happens after clicking on Edit Data References (non-intuitive IMHO).
    Regards,
    Ian.

Maybe you are looking for

  • Startup takes me to 10.5.8, restart take me to 10.6.1!!

    Anyone know what's happening here? I've got 10.6.1 installed on one drive and it's been working well. Upon start up this morning it boots into 10.5.8 on another drive. Shut down normally and start up again does this every time. Repaired disk permissi

  • I no longer can get the rijks museum widget. Why? And how to restore?

               Hallo There. Some time a go ,during an update .I lost my Rijksmuseum widget,which was part of Apples widget program.Does anyone know how to fix this dellema? Thank You for looking in to this. Greetings: John Basso.

  • Guid not set for a step

    Hi, I am facing a probleme where in a step of workflow is not getting executed properly. If i check the container for that step, the import parameter for it 'Guid' shows as '<not set>'. I am new to workflows, so I may not be aware of the basics or de

  • Payroll run process is not showing any results

    We have Oracle Applications 11.5.10.2 with vision demo database with US legislation. After completing all the required setups for Payroll and defining a new payroll and all the requirements for the payroll, when we submit the request Payroll Process

  • Fonts

    I currently use the full version of Adobe Acrobat 7 on a Mac. I understand if the fonts are not embedded in the document when the PDF is created, there will be font issues for the end user when printing. Someone told me this is not the case in Adobe