Variance of experimental data, compared to Theory

1. Nov 26, 2009

I'm looking for a way to compare experimental and theoretical data and determining if it obeys a certain law.

In particular, I'm writing a computer program that does this and at the moment what I'm doing is, I'm calculating the ratio of each reading with the theoretical result and calculating the standard deviation of the various resultant ratios.

I compare each ratio with the mean to see if its within one standard deviation. Are there any better approached than this? I'm not really a mathematician, and am more of a programmer so any help would be much appreciated.

2. Nov 26, 2009

bpet

Welcome to the world of statistics!

Some more information about the problem is needed. In particular, are you looking to test a formula to see how accurate it is (e.g. whether the errors are "acceptable"), or are you looking to confirm is a sample of random values has a specific distribution?

3. Nov 26, 2009

Basically I'm looking to confirm Benford's law in various files the user wishes to open.

4. Nov 26, 2009

awkward

If you are looking to confirm Benford's Law, then you have the expected distribution of numbers starting with 1,2,3,...,9, and you have the actual distribution given by your data.

I think a Chi-Square test for goodness of fit would be good here.

5. Nov 26, 2009

I just tried the Chi-square test, but the various online calculators basically tell me the total of my Observed and Expected frequences isn't the same. Is this because this test will fail if the observed freq. are too low than expected?

Thanks for all the help.

6. Nov 27, 2009

awkward

If your total expected does not equal your total observed, you have made some mistake in setting things up.

If you have $$N$$ (observed) numbers in total and the fraction predicted by Benford's Law to start with i is $$f_i$$, then the number expected to start with i is $$e_i = f_i \cdot N$$. Since the $$f_i$$'s sum to 1, the $$e_i$$'s sum to $$N$$.