In This Topic
Gets values along a linear trend. Fits a straight line (using the method of least squares) to the arrays known_y's and known_x's. Gets the y-values along that line for the array of new_x's that you specify.
Syntax
'Declaration
Public Function Trend( _
ByVal As Object, _
Optional ByVal As Object, _
Optional ByVal As Object, _
Optional ByVal As Object, _
Optional ByVal As IWorksheet, _
Optional ByVal As Integer, _
Optional ByVal contextColumn As Integer _
) As Object
'Usage
Dim instance As WorksheetFunction
Dim knowY As Object
Dim knowX As Object
Dim newX As Object
Dim constant As Object
Dim worksheet As IWorksheet
Dim contextRow As Integer
Dim contextColumn As Integer
Dim value As Object
value = instance.Trend(knowY, knowX, newX, constant, worksheet, contextRow, contextColumn)
Parameters
- knowY
- Known_y's - the set of y-values that you already know in the relationship y = mx + b.
- knowX
- Known_x's - an optional set of x-values that you may already know in the relationship y = mx + b.
- newX
- New_x's - new x-values for which you want Trend to return corresponding y-values.
- constant
- Const - a logical value specifying whether to force the constant b to equal 0.
- worksheet
- The context worksheet to calculate.
- contextRow
- The context row to calculate.
- contextColumn
- The context column to calculate.
See Also