add_fit_line
Fit an ordinary least-squares trend line to your data, write fitted values to a new variable, and optionally save or attach to a live STATISTICA session.
Instructions
Fit an ordinary least-squares line of y on x (x defaults to the case number) and write the fitted values to a new variable, so the trend can be plotted next to the data (a scriptable substitute for the interactive graph fit).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | Predictor variable. Omit to use the case number 1..N. | |
| y | Yes | Dependent variable. | |
| name | No | Name of the new fitted variable. Default "<y>_fit". | |
| path | Yes | ||
| save | No | Optional destination path to persist the result as .sta. | |
| sheet | No | ||
| attach | No | Attach to the already-running STATISTICA instance and edit it live (no new process, the app is not closed). | |
| degree | No | Polynomial degree. Default 1 (linear). |