# Fitting data involving units

I want to fit some data to a model. However, if the data involves units in the independent variable, fitting seems not to work. As an example, consider the code

data = Table[{Quantity[t, "d"], Exp[-.1*RandomReal[{.9, 1.1}]*t]}, {t,0, 100}];
nlm = NonlinearModelFit[data, Exp[-a*t], a, t]


The goal is to have parameter estimates with the right units depending on the units appearing in data to minimize the risk of performing incorrect unit conversions manually.

Any suggestions?

-
I'm assuming that nlm = NonlinearModelFit[QuantityMagnitude@data, Exp[-a*t], a, t] isn't what you are looking for, but I'm not entirely clear on what you actually want to output. Is the problem that items in data may not have the same units? –  bobthechemist Apr 12 at 12:23