# Which measures of statistical dispersion should be used to estimate dispersion of slope of a trendline

Although I know how to calculate many of the statistical values, I have some difficulties understanding which one should I use in a specific situation. Here is my example:

In my experiment I tried to find out how fast does the Water evaporate from 8 different nonvowen Materials. To achieve this I prepared 4 Testobject's for each Material (that makes a total of 32) and moisturized them. Afterwards i let them dry in a controled enviroment (Laboratory was airconditioned and the Temperature and rel. air humidity was recorded). Every hour I measured the weight of each Testobject. I calculated the relation betwen weight of water and weight of a dry Testobject to be able to compare the results to each other and presented them in a diagram (Water/dry ratio to time diagramm). I made a linear Trendline for each of 32 Testobjects with gaussian least square method. The slope of the Graph represents the Evaporative rate per hour of a given Object. I used Excel to calculate.

I can approximate the observational error for measured Weight and the corresponding measurement time. Given that

-calculated trendline is defined as:

$m = a \times t + b$

-the measured weight and time are

$m_{i}$ and $t_{i}$

and the vertikal distance between measured data and the trendline is defined as:

$e_{i} = a \times t_{i} + b - m_{i}$

one can calculate the error of the slope a with following equation:

So here comes my problem: I have 4 trendlines for each material with 4 slopes each. I calculated an average for each material. All of the slopes have their error. Also each average has its statistical dispersion. I would like to presents those averages with some kind of +- range, like standard deviation or something. What kind of measure of statistical dispersion should i use?

Not directly answering this, but I would take a different approach; but you won't be able to do it in Excel.

I suggest a multilevel regression model. Your data is like a textbook example of this method. Your dependent variable could be weight (or water weight = total weight - dry weight). Your independent variables would be time, material and their interaction. And testobject would be a random effect.

• hmmm sounds interesting. Unfortunately I never heard of it and wikipedia doesn't gives any definition to "multilevel regression". Could you be more specific or point to some source so I can look this up and search for german translation of this term? Edit: Never mind I just found it. I gues I was blind for a moment:P – Smiling_Man Feb 6 '14 at 14:40
• Sorry, i'm not sure how does the multilevel analysis help in this situation. It's a bit thought to learn it alone i guess. I don't want to make average evaporation rate from all 32 test objects so i don't see where is the structure in this. I could as well take only one material, then I would have 4 Trendlines and an average of their slopes. Its just a case of multiple errors adding on top of each other. – Smiling_Man Feb 6 '14 at 15:39

I discussed my issue with calculating accuracy of the result of my experiment with my colleagues and some professors at my University and one of them had a very simple and interesting solution that I want to share.

First let's make it clear what did I wrong. I have made direct measurements and processed them to calculate my result. So in the end I made an indirect measurement of average vaporization rate. So normal aproach would be to find out how accurate were all te factors that were used to calculate the end result. Then use the gaussian propagation of uncertainty to calculate how accurate my results are. But instead of doing it, I calculated uncertainty of values half way through getting to end result and then didn't know what's next. So in my case: Ignore the uncertainty of the slope angle, calculate the uncertainty of vaporisation rate in one swoop.

To calculate the propagation of uncertainty one would need to formulate a single formula where you enter all measured data and the end result pops out, then calculate derivatives for all variables. But not always it is possible. In my case there was no single formula, it was rather a step by step calculation. But there is a way to make ones life much simpler:

There is one pre condition - the whole calculation should be parametrically connected. It means if I would change some input values, then the end result would be recalculated. So using "isert a trendline" option in excel and then typing the slope of regression line for further calculation is not possible. You have to calculate regression line parameters yourself and then link to them in further calculation.

Then you make a fixed copy of the end result per copy -> paste -> only values after that you chande value of one input parameter by a small amount. For example increase weight of one measurement by dm = 0,1 g. Then make another fixed copy of the freshly calculated result. Substract both results from another to get dE (E stands for end result). You divide dE/dm and voilà there you have a derivative for weight. You continue for all input data and proceed with the gaussian propagation of uncertainty.

It may look suspicous to you, this skipping of analytical derivation and doing it numericaly, but it is commonly used when dealing with complex systems like when calculating a power plant and it gives just the same results as analitycal approach.