Explore BrainMass

Matlab statsitics

This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

Two related questions.

First - I need a good way to display error bars on a
scatter plot. I have a set of x and y data, that I have attached as a text file along with y+err and y-err data (denoted +/-). The err values vary from point to point, and +err and -err are not necessarily the same.

Second - I am using the data to get a slope and an intercept. Once I
know. I need an easy way to calculate the errors in
slope and intercept? (This may be more of a math question than a MatLab
question, but I assume someone here knows the solution.)


Please do an example In full detail since I will be doing this for my physics lab reports for the next two months and I really need to know how to do proper linear regression using Matlab.

Also I need a Chi square test to verify that my fit is in fact good. Can you also please explain that to me thanks! As you can see, I am not so great in Statistics so I need help.

© BrainMass Inc. brainmass.com March 21, 2019, 5:05 pm ad1c9bdddf


Solution Preview

The attached Matlab script has examples of how to plot error bars and how to estimate errors in slope and intercept of a linear fit.

File Rb85_N_mod.txt contains your original data with the "+/-" column removed.

Note that I ADDED ERRORS to you original data to make the illustration more visible, as your original errors ...

Solution Summary

This provides methods of working with errors and Chi square in Matlab.