CB.LockFitParm Example

The following macro statements define a variable named Result, lock the Location parameter of the gamma distribution, clear any previous values from the Shape parameter of the gamma distribution, run the fit and return results. Notice that CB.SetFitRange is used before CBLockFitParm:

Dim Result as Double
'Define a range of data for fitting
CB.SetFitRange ("A1:A30")
'Lock the Location of Gamma to 0
CB.LockFitParm cbDfaGamma, True, 1, 0
'Clear any locked values for the Shape of Gamma
CB.LockFitParm cbDfaGamma, True, 3, cbParmUndefined
'Run the fit and return the result
Result = CB.Fit(cbDfaGamma, cbFitAndersonDarling, False)