1
$\begingroup$

I'm interested in differences in tasks performed per hour worked across a dataset of 50,000 work records (each of a different length of time). Each work observation has 3 variables:

  • hours - the number of hours worked (again, this is not a standard)
  • tasks - the number of tasks performed
  • experience - the cumulative number of hours accrued as of the beginning of the work record

What is the appropriate linear model for me to run in R on this kind of "rate" dependent variable?

What have I tried?

Move the rate's denominator (i.e. hours) to the right hand side and express it as an interaction effect, as such:

work.fit <- lm(tasks ~ hours + experience:hours, data=labour)

in which case I'd think I can interpret the regression as such:

$tasks/hour = \beta_{hours} + \beta_{experience}*experience$

I've also tried the following regression in R to force the intercept to 0, but I believe this to be a bad idea (complete conjecture).

work.fit <- lm(tasks ~ 0 + hours + experience:hours, data=labour)
$\endgroup$
  • $\begingroup$ It should be the case that the number of tasks should be a concave function of hours and a concave function of experience. Do you have total hours per day or do you have lunch and break information? $\endgroup$ – Dave Harris Dec 16 '16 at 4:52
  • $\begingroup$ Hours is only worked time, so it excludes any lunch or break. The individual records are likely short enough that I don't have "burnout" within tasks, but there could certainly be an accumulated effect within day. Point taken on experience, though. $\endgroup$ – MikeRand Dec 16 '16 at 5:00
3
$\begingroup$

So let me make a couple of suggestions then. Your goal should not be "best fit," as measured by $R^2$, which is fit to the observed data, but best fit to the data generation process. So I have a suggestion. At the least the number of tasks completed as a function of hours and experience should be non-convex. This leads to a couple simple models that have simple interpretations. They are NOT the true model in nature unless you get amazingly lucky.

There are three categories of models to consider, linear, quadratic and logarithmic. Each have an important interpretation. The linear models imply the flow of work is even throughout the day and that there is no work that is long enough to cause a slowdown. The quadratic model implies that there is an optimal amount of work, and/or experience and that after that point the average unit output begins to fall. Not only do people wear out, or in the case of experience, stay too long, but there is a penalty created by it. The logarithmic model implies that you have declining marginal output and that the impact of experience is multiplicative.

If $t$ is tasks, $h$ is hours and $x$ is experience then you have a couple of possible models such as $$t=\beta_hh+\beta_xx+\alpha$$ $$t=\beta_hh+\alpha$$ $$t=\beta_{h_1}h+\beta_{h_2}h^2+\beta_{x_1}x+\beta_{x_2}x^2+\alpha$$ $$t=\beta_{h_1}h+\beta_{x_1}x+\beta_{x_2}x^2+\alpha$$ $$t=\beta_{h_1}h+\beta_{h_2}h^2+\beta_{x_1}x+\alpha$$ $$t=\beta_{h_1}h+\beta_{h_2}h^2+\alpha$$ $$t=\beta_h\log(h)+\beta_x\log(x)+\alpha$$ $$t=\beta_h\log(h)+\alpha$$

If you notice this is not all possible combinations of variables, but experience without work hours makes no sense. Likewise there are no squared terms with the logarithmic terms because of one is log, the other is probably log too.

This gives you many possible models, you will want to use the BIC command to choose which model is closes to the data generating function in nature. That is, which model has the least divergence from reality. The Bayesian information criterion will give you that. Now the degrees of freedom will be slightly wrong, but you have 50,000 observations so making the slight manual adjustment isn't necessary. It won't really impact you.

There are several information criterion out there, but the BIC has some advantages in this case. It is an approximation of the Bayesian posterior distribution under a cost function, so it is "coherent," which means you can gamble money on it. It works best when the sample size is much larger than the number of models. Here you have eight models. It also solves a hopeless problem that you would face otherwise.

With null hypothesis methods, the null is assumed to be true, but here you have eight possible nulls and only one can be true. The BIC effectively turns this into a reduced form Bayesian problem and Bayesian problems do not have a null hypothesis and you can have as many as you need.

You choose the model with the smallest BIC.

Instead of simple division, you will need to take the derivative to find the tasks per hour for any point in time. For the exponential model, it would be $$\frac{dt}{dh}=\frac{\beta_h}{h}$$ because as more work is done the rate of additional work is declining as an indirect function of time. For the quadratic, it is simply $$\frac{dt}{dh}=\beta_{h_1}+2\beta_{h_2}h$$.

$\endgroup$
0
$\begingroup$

If you are solely interested in a predictive model exploiting the statistical relationships then you can ignore my answer.

This is an identificarion issue. Do employees perform more tasks because they work more hours or because they are more experienced? At the same time you can ask, are employees working more days because they have to complete more tasks? Thus tasks and days are endogenous. There are a whole bunch of ways you can get around this problem somewhat but I can't give you details without knowing more about the data.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.