Hi Bitli,
In the Format Explorer window, select the RAW format and click Edit Preferences. On the RAW Format Preferences dialog, make sure both White Balance options are disabled, and the three Color Adjustment sliders are set to 1.0. With these settings dcraw will load just the raw data without any transformation. You may also want to select the "Create RAW Bayer Picture" option in order to load the true raw image without any interpolation. You can then obtain statistics for each channel with the Statistics tool.
Any suggestion for the cause of the discrepancies ?
Different decoders may apply different transformations to the raw data. AFAIK, In the case of dcraw, if you select the above settings the raw data are not changed in any way.
I did not find a very easy way to calculate the mean of a set of images.
Do you refer to the mean of each pixel in a stack of images? Of course this can be done with a script. However, we are now working on a new tool: ImageIntegration. This tool will perform the integration of a set of images using the mean or median with common pixel rejection algorithms (sigma clipping, min/max, etc.). I hope it will be ready in the next version.
If you are interested in a script, I can write it for you; it's quite easy (though a bit slow, of course). Please let me know.