Hi, I have a problem modeling a multinomial regression. This is the tentative function: multinom(resp ~ age + sex + ... + I(log(wage)),data=work) resp is a factor with 4 levels. My problem is that the variable wage should only go into the equation for certain levels of resp and should be zero for the others. I would be very grateful if somebody could tell me how I can model this in R. Thanks a million, Werner
Modeling problem with Multinomial Logit
2 messages · Werner Wernersen, David Barron
Do you mean something like this (assuming that it is levels 1 and 2 that should be zero): resp <- factor(sample(1:4,100,replace=TRUE)) wage <- rnorm(100,100,5) new.wage <- ifelse(resp==1|resp==2,0,log(wage)) multinom(resp ~ new.wage)
On 10/12/06, Werner Wernersen <pensterfuzzer at yahoo.de> wrote:
Hi, I have a problem modeling a multinomial regression. This is the tentative function: multinom(resp ~ age + sex + ... + I(log(wage)),data=work) resp is a factor with 4 levels. My problem is that the variable wage should only go into the equation for certain levels of resp and should be zero for the others. I would be very grateful if somebody could tell me how I can model this in R. Thanks a million, Werner
______________________________________________ R-help at stat.math.ethz.ch mailing list 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.
================================= David Barron Said Business School University of Oxford Park End Street Oxford OX1 1HP