I am by no means a mathematician (I am a software developer by trade), but I am trying to find out if there is a relationship between two data sets. I have referral sources the provide us customers, and I am trying to find out if there is a relationship between the number of calls we make to the referral source and the number of customers they give us, and if so, what is the best number of calls to make to yield the most number of patients. I have a year's worth of call and customer data to use, but am not sure how to proceed.

If someone could point me in the right direction, I would be very appreciative.



1 Answer 1


The usual form of such analysis is some kind of regression - where $E(Y)$ is modeled as some function of $x$ - so strictly speaking I mean modeling $E(Y|X=x)$

If "number of customers" is your variable of interest (response, or sometimes dependent variable, $y$), and "number of calls" is the predictor (independent variable, $x$), then both variables are counts.

There are a number of possible approaches, but you probably don't want ordinary regression models.

First, as I mentioned, the data are counts. They're discrete, almost certainly right skewed, and their variance will change with their mean.

Further, in this case you would probably expect a curvilinear relationship (1 call will get you more customers than 0 calls, 2 may get more still, but 100 calls is probably drastically counterproductive)

This leads me to suggest either generalized nonlinear models (GNM), if you know the general form of the functional relationship in the means (or at least have some form in mind), and generalized additive models (GAM), if you don't have some functional form.

I'd suggest trying a quasi-Poisson model.

Even though the number of calls is discrete, since you're trying to optimize, you're probably best off trying to fit a smooth function -- essentially as if it were continuous.

Of the two GAMs are probably easiest from several points of view.

If your expected counts are moderate to large you could get a reasonable first approximation by modelling the square roots of the customer counts, or perhaps the related Anscombe or Freeman-Tukey transformations, and treating that as normal with nearly constant variance (though you'd check that); it should still let you identify a maximum. You'd still be either looking at nonlinear least squares (NLS) or additive models (perhaps via splines or by local linear smoothing). If the expected counts are very small (often less than three, say), then this may not work so well.

  • $\begingroup$ thanks for the help Glen. I will definitely start looking into these GAMs (since you suggested they may be easiest) $\endgroup$
    – Mike
    Commented Mar 1, 2013 at 23:17
  • $\begingroup$ "easiest" kind of depends on a bunch of things. But they can be at least fitted fairly easily (in R, for example - there's the packages mgcv and gam, to get started with). $\endgroup$
    – Glen_b
    Commented Mar 1, 2013 at 23:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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