Scripting Resources for DigitalMicrograph™

banner

Dave Mitchell's DigitalMicrograph™ Scripting Website

Home | Scripts | Examples | Functions | Recent Updates | Tutorials | Resources | Publications | Consulting | Projects | Contact & Bio | Private | 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:20100422, v1.1

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.
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.