Greetings!
I am trying to fit a multilevel regression model for 1,208 households nested in neighborhoods, with 20 neighborhoods (the level-2 N is, admittedly, on the low end) in Stata 15.1. The dependent variable is total outdoor water use for an entire year. The independent variables are income (dichotomous: $75,000 or above vs. less than $75,000) and the average cost of outdoor water use for each household. Given prior research, which has indicated a linear-log (or log-log, given the fact that household water use data are typically positively skewed) relationship between average cost and outdoor water use, and the fact that the AIC/BIC are drastically reduced by using the log transformed version of the cost variable (regardless of the model), I would like to use the log transformed version of cost in my model. I include an income-cost interaction to test the hypothesis is that lower-income households will be more responsive to changes in price than higher-income households in my study area. My ultimate goal is to visualize the income x cost interaction using actual values of cost and water use (which, in any case, will require some sort of back transformation).
I also have a significant number of zero values and values ranging from zero to one in the dependent variable, so log-transforming it and adding a constant of one -- ln(annualtotalOutdoor+1) -- yields the following distribution:
Array
Meanwhile, log-transforming the average cost variable yields the following distribution:
Array
I have read that using a Poisson regression with robust standard errors is preferable to using a log transformation for a skewed continuous dependent variable (https://www.stata.com/stata-news/new...ormed_outcomes). After using the following command:
mepoisson annualtotalOutdoor c.LOGAVECOSTJULY##i.INC75 , vce(robust) || Neighborhood: ||
I am unsure how to proceed with visualizing the interaction effect getting the expected value of outdoor water use based on average cost when INC75 = 0 and INC75 = 0. Meanwhile, visualizing the interaction in Stata using a linear regression (i.e., xtmixed) and margins/marginsplot is more straightforward, and yields the following graph:
Array
However, I am unsure how to obtain the back-transformed values, given that outdoor water use is log transformed (with a constant of 1 added) in addition to average cost being log transformed.
Any advice on how to obtain a visualization of this interaction from the margins command (or otherwise--Excel?) would be greatly appreciated!
Best wishes,
Matt
Related Posts with Visualizing the effect of an interaction term in a log-log model (or poisson model with transformed independent variable)
Meta-analysis of prevalence data using metaprop commandHi There, I am seeking some help regarding the meta-analysis of the prevalence data using the metap…
Creating an indexHey I want to create an index out of 10 variables, each of them has values on a scale from 1 to 5. I…
Difficulties in invoking python in stata 16I am trying to call python into the stata 16 environment but having the below error. Any help would …
is this a correct way to rescale a variable?Hi all, I have an independent variable in my regression that lies between .0000869 and .0610705. It…
How to generate a variable with the total number per year only?Good day all, I have a dataset with 3 variables: (survival status "survived/died", year, number of …
Subscribe to:
Post Comments (Atom)
0 Response to Visualizing the effect of an interaction term in a log-log model (or poisson model with transformed independent variable)
Post a Comment