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)
Granger causalityHi, I just had a quick question about how to compare the results of different granger causality tes…
using bsample, cluster in conjunction with bootstrap (Stata 15)Hi, I'd been trying to set up a simple bootstrap that involves a small code that I'd written and I w…
Creating multiple new variable columns from an existingi have a dataset example below id visit_number date value test 1 2 2020-10-01 16:00 140 sodium 79 3…
Plotting a line graph of frequency of flipping a coin on different number of trialsHi All, As a newbie, I have been trying to write a code on flipping a coin. More specifically, I wri…
K-S test for Pareto distributed data.Hello everyone, for my master's thesis I am working with a survey dataset on wealth distribution wh…
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