10
$\begingroup$

My situation is:

I have 1 continuous dependent and 1 continuous predictor variable that I've logarithmically transformed to normalise their residuals for simple linear regression.

I would appreciate any help on how I can relate these transformed variables to their original context.

I want to use a linear regression to predict the number of days that pupils missed school in 2011 based on the number of days they missed in 2010. Most pupils miss 0 days or just a few days the data is positively skewed to the left. Therefore, there is a need for transformation to use linear regression.

I've used log10(var+1) for both variables (I used +1 for pupils who had missed 0 days school). I'm using regression because I want to add in categorical factors - gender/ethnicity etc too.

My problem is:

The audience I want to feed back to wouldn't understand log10(y) = log(constant) + log(var2)x (and frankly neither do I).

My questions are:

a) Are there better ways of interpreting transformed variables in regression? I.e. for ever 1 day missed in 2010 they will miss 2 days in 2011 as opposed to for ever 1 log unit change in 2010 there will be x log units change in 2011?

b) Specifically, given the quoted passage from this source as follows:

"This is the negative binomial regression estimate for a one unit increase in math standardized test score, given the other variables are held constant in the model. If a student were to increase her mathnce test score by one point, the difference in the logs of expected counts would be expected to decrease by 0.0016 unit, while holding the other variables in the model constant."

I would like to know:

  • Is this passage saying that for every one unit increase in the score of the UNTRANSFORMED variable math leads to a 0.0016 decrease from the constant (a), so if UNTRANSFORMED maths score goes up by two points, I subtract 0.0016*2 from the constant a?
  • Does that mean that I get the geometric mean by using exponential(a)) and exponential(a+beta*2) and, that I need to calculate the percentage difference between these two to say what effect the predictor variable(s) has/have on the dependent variable?
  • Or have I got that totally wrong?

I'm using SPSS v20. Sorry for framing this in a long question.


$\endgroup$
  • 8
    $\begingroup$ Have you thought of using Poisson regression instead? It's naturally indicated with dependent count data and your success with a log transformation is consistent with Poisson distributions. The coefficients would be interpreted in terms of proportional increases in expected probability of missing a day of school. One advantage is that no special treatment of zeros is needed (although it's still a very good idea to look at a zero-inflated alternative model). $\endgroup$ – whuber Dec 30 '11 at 22:43
  • $\begingroup$ Hi Whuber, Yes, I was thinking about Poisson regression but wasn't sure about this or opting for negative binomial regression. I guess negative binomial as the data is over dispersed - i.e. the mean is lower than the variance in the dataset (hence positive skew). Also, strictly, there is an upper limit on the number of school session in the year, whereas Poisson assumes an unlimited denominator? Or do you still think Poisson is more appropriate? Unfortunately SPSS doesn't support zero inflated models as far as I've seen...) Thanks Whuber :) $\endgroup$ – JimBob Dec 31 '11 at 9:46
  • 3
    $\begingroup$ I don't see a problem with the unlimited support of Poisson distributions: it's similar to using Normal distributions to model, say, values that must be nonnegative. Provided the chances associated with impossible values are tiny, it can be a good model nevertheless. Negative binomial is the standard alternative to Poisson used to test goodness of fit and overdispersion; it's a good idea. If SPSS is too limited, use something else! (R has packages for zero-inflated models; search this site.) $\endgroup$ – whuber Dec 31 '11 at 14:19
  • 2
    $\begingroup$ I agree with @whuber I think you probably want a ZIP or ZINB model. I'd just add that they are also available in SAS via PROC COUNTREG (in ETS) and, starting with SAS 9.2, in PROC GENMOD (in STAT) $\endgroup$ – Peter Flom Dec 31 '11 at 16:50
  • 2
    $\begingroup$ There's very good info at stats.stackexchange.com/questions/18480/… . $\endgroup$ – rolando2 Dec 31 '11 at 22:36
7
$\begingroup$

I think the more important point is suggested in @whuber's comment. Your whole approach is misfounded because by taking logarithms you effectively are throwing out of the dataset any students with zero missing days in either 2010 or 2011. It sounds like there are enough of these people to be a problem, and I am sure your results will be wrong based on the approach you are taking.

Instead, you need to fit a generalized linear model with a poisson response. SPSS can't do this unless you have paid for the appropriate module, so I'd suggest upgrading to R.

You will still have the problem of interpreting coefficients, but this is secondary to the importance of having a model that is basically appropriate.

$\endgroup$
  • $\begingroup$ Why not use the transformation $x\mapsto\log(x + 1)$? This would solve the problem you bring up. However, inverse transformation would be slightly more involved, and interpretation would be more difficult. There is a post about it here: stats.stackexchange.com/questions/18694/… $\endgroup$ – toypajme Aug 3 '15 at 20:01
3
$\begingroup$

I agree with other respondents, especially with respect to the form of the model. If I understand the motivation of your question, however, you are addressing general audiences and want to convey the substantive (theoretical) meaning of your analysis. For this purpose I compare predicted values (e.g. estimated days missed) under various "scenarios." Based on the model you choose, you might compare the expected number or value of the dependent variable when the predictors are at some specific fixed values (their medians or zero, for instance) and then show how a "meaningful" change in of the predictors affects the predictions. Of course, you have to transform the data back into the original, understandable scale you start with. I say "meaningful change" because often the standard "one-unit change in X" doesn't convey the real import or lack thereof of an independent variable. With "attendance data," I'm not sure what such a change would be. (If a student missed no days in 2010, and one day in 2011, I'm not sure we would learn anything. But I don't know.)

$\endgroup$
2
$\begingroup$

If we have the model $Y = bX$, then we might expect that a 1 unit increase of $X$ yields a b unit increase in Y. Instead, if we have $Y = b \log(X)$, then we expect a 1 percent increase in $X$ to yield $b\log(1.01)$ unit increase in Y.

Edit: whoops, didn't realize that your dependent variable was also log transformed. Here's a link with a good example describing all three situations:

1) only Y is transformed 2) only the predictors are transformed 3) both Y and the predictors are transformed

http://www.ats.ucla.edu/stat/mult_pkg/faq/general/log_transformed_regression.htm

$\endgroup$
  • 1
    $\begingroup$ Hi JC, Thanks for your reply. I've taken the approach of transforming both my dependent and independent variables for consistency, but I've read that it's only the DV that really needs transforming for normality compared to its IVs. $\endgroup$ – JimBob Dec 31 '11 at 9:52
  • $\begingroup$ I've actually seen the link you suggested (thanks tho) but wasn't clear on a couple of points, especially regarding comparing the geometric mean with 'real-life', but I guess using the geometric mean is more to do with modelling the effect of change in x on y rather than the outcome of y per unit change in x? I think I need to go back and give it a second read... $\endgroup$ – JimBob Dec 31 '11 at 10:03
2
$\begingroup$

I often use the log-transform, but I tend to use binary covariates because it leads to a natural interpretation in terms of multipliers. Assume you want to predict $Y$ given, say 3 binary covariates $X_1$, $X_2$ and $X_3$ taking values in $\{0,1\}$. Now, instead of presenting:

$log(Y) \approxeq log(C) + X_1W_1 + X_2W_2$,

you can simply show:

$Y \approxeq C \ M_1^{X_1}\ M_2^{X_2}\ M_3^{X_3}$,

where: $M_1=e^{W_1}$, $M_2=e^{W_2}$ and $M_3=e^{W_3}$ are multipliers. That is to say, each time the covariate $X_i$ equals 1, the prediction is multiplied by $M_i$. For example, if $X_1=0$, $X_2=1$ and $X_3=1$, your prediction is:

$Y \approxeq C \ M_2\ M_3$.

I'm using $\approxeq$ because this is not exactly the prediction of the mean of $Y$: the mean parameter of a log-normal distribution is not in general the mean of the random variable (as it is the case for classical linear regression without the log-transform). I do not have precise reference here, but I think this is straightforward reasoning.

$\endgroup$
  • 3
    $\begingroup$ You needn't worry about the lognormal issues: the multipliers are correct regardless. (There would be an issue with heteroscedastic models.) This is because $E[Y]=C e^{\sigma^2/2}e^{(X_1W_1+X_2W_2+X_3W_3)}$ where $\sigma^2$ is the variance of $\log(Y)$. BTW, please scan your definitions of the $M_i$ for typos. $\endgroup$ – whuber Sep 25 '12 at 8:35

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.