Compare two histograms

Hi,
I try to compare two histograms(the histograms havs same bin) by function Chi2Test(…), because there are some bins with content 0 in histograms, so it always return
"Error in TH1D::ChistatTestX: Hist2: zero events in bin (13,1,1)", and the return chi2/ndf =0
Anyone know how to do in this case? thanks
best regards
—Haiping

Lorenzo will process your message

Rene

Hi,
when you comparing two histogram and one of the two (or both of them) have been filled with weights different than one, you must NOT have bins with zero entries in one of the histogram otherwise the comparison does not make much sense. You should probably re-bin your histogram.

Best Regards

Lorenzo

If i want to compare two histograms, these two histograms maybe have bin with content 0 or minus, which function can I use. thanks
haiping

If you have a negative content your histogram has not anymore a statistical meaning, so you cannot use anymore any of the comparison test functions.

If you have zero contents, try to rebin your histogram to avoid this, by merging with adjacent bins.

Best Regards

Lorenzo