Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio |PyJEM| Search

 

Functon: Linear Regression
Function
Function to perform a linear regression on an array of data passed in to it. Calculates the constants a and b in y=a+bx, the 95% confidence interval and the R parameter. Note the function returns R not R squared. It also returns the standard error.
Version

version:20220311, v1.2

Author
D. R. G. Mitchell
Acknowledgements
Bill Bertram is thanked for providing assistance with algorithm development.
Comments

Data should increase monotonically in x. The format in which the data should be passed into the function is detailed in the script.

Updated in v1.2 to remove commands for the results (output) window, which are no longer supported.

System Requirements
Should be compatible with all recent versions of DigitalMicrograph.
Known Issues
Supported
Yes
Included Files
Main script file.
Source Code

See attached script file.