I am interested in using quantile regression to fit the following model at different quantiles of a response variable: (1) y = b0 + b1*g1 + b2*g2 + B*Z where b0 is an intercept, g1 and g2 are dummy variables for 2 of 3 independent groups, and Z is a matrix of covariates to be adjusted for in the estimation (e.g., age, gender). The problem is that estimates for g2 and g1 are not estimable at all quantiles. To overcome this, one option is to fit a separate model for each group (i.e., group 0, which is reflected by intercept above, group 1, and group 2): (2) y = b11 + B1*Z (model for group 0) (3) y = b12 + B2*Z (model for group 1) (4) y = b13 + B3*Z (model for group 2) This would correspond to fitting a single model in which group membership was interacted with all covariates, albeit some of the interaction terms would not be estimable for the reason noted above. However, I ultimately would like to base inferences on a single set of estimates. Can anyone suggest an approach to combine estimates from models (2)-(4), perhaps through weighted averaging, to generate estimates for the model presented in (1) above? An approach is not immediately clear to me since the group effects are subsumed in the intercepts in (2)-(4), whereas (1) includes separate estimates of group effects instead of a single weighted average. Regards, Jim [[alternative HTML version deleted]]
Not an answer to your question, but you should not be using "dummy" variables in R. Use factors instead. Please read a R tutorial or text -- there are many -- to learn how to fit models in R. You might also wish to consult a local statistician or post on a statistics list like stats.stackexchange.com for statistics questions, which are off topic here. Further, when you post here, please read and follow the posting guide (below) and post in plain text, not HTML. Cheers, Bert Bert Gunter "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." -- Clifford Stoll On Wed, Jun 24, 2015 at 3:27 AM, James Shaw <shawjw at gmail.com> wrote:> I am interested in using quantile regression to fit the following model at > different quantiles of a response variable: > > (1) y = b0 + b1*g1 + b2*g2 + B*Z > > where b0 is an intercept, g1 and g2 are dummy variables for 2 of 3 > independent groups, and Z is a matrix of covariates to be adjusted for in > the estimation (e.g., age, gender). The problem is that estimates for g2 > and g1 are not estimable at all quantiles. To overcome this, one option is > to fit a separate model for each group (i.e., group 0, which is reflected > by intercept above, group 1, and group 2): > > (2) y = b11 + B1*Z (model for group 0) > (3) y = b12 + B2*Z (model for group 1) > (4) y = b13 + B3*Z (model for group 2) > > This would correspond to fitting a single model in which group membership > was interacted with all covariates, albeit some of the interaction terms > would not be estimable for the reason noted above. However, I ultimately > would like to base inferences on a single set of estimates. > > Can anyone suggest an approach to combine estimates from models (2)-(4), > perhaps through weighted averaging, to generate estimates for the model > presented in (1) above? An approach is not immediately clear to me since > the group effects are subsumed in the intercepts in (2)-(4), whereas (1) > includes separate estimates of group effects instead of a single weighted > average. > > Regards, > > Jim > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
Thanks for the suggestions, Gunter. On Wed, Jun 24, 2015 at 10:33 AM, Bert Gunter <bgunter.4567 at gmail.com> wrote:> Not an answer to your question, but you should not be using "dummy" > variables in R. Use factors instead. Please read a R tutorial or text > -- there are many -- to learn how to fit models in R. You might also > wish to consult a local statistician or post on a statistics list like > stats.stackexchange.com for statistics questions, which are off topic > here. > > Further, when you post here, please read and follow the posting guide > (below) and post in plain text, not HTML. > > Cheers, > Bert > Bert Gunter > > "Data is not information. Information is not knowledge. And knowledge > is certainly not wisdom." > -- Clifford Stoll > > > On Wed, Jun 24, 2015 at 3:27 AM, James Shaw <shawjw at gmail.com> wrote: >> I am interested in using quantile regression to fit the following model at >> different quantiles of a response variable: >> >> (1) y = b0 + b1*g1 + b2*g2 + B*Z >> >> where b0 is an intercept, g1 and g2 are dummy variables for 2 of 3 >> independent groups, and Z is a matrix of covariates to be adjusted for in >> the estimation (e.g., age, gender). The problem is that estimates for g2 >> and g1 are not estimable at all quantiles. To overcome this, one option is >> to fit a separate model for each group (i.e., group 0, which is reflected >> by intercept above, group 1, and group 2): >> >> (2) y = b11 + B1*Z (model for group 0) >> (3) y = b12 + B2*Z (model for group 1) >> (4) y = b13 + B3*Z (model for group 2) >> >> This would correspond to fitting a single model in which group membership >> was interacted with all covariates, albeit some of the interaction terms >> would not be estimable for the reason noted above. However, I ultimately >> would like to base inferences on a single set of estimates. >> >> Can anyone suggest an approach to combine estimates from models (2)-(4), >> perhaps through weighted averaging, to generate estimates for the model >> presented in (1) above? An approach is not immediately clear to me since >> the group effects are subsumed in the intercepts in (2)-(4), whereas (1) >> includes separate estimates of group effects instead of a single weighted >> average. >> >> Regards, >> >> Jim >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code.