Hello, I wanted to do the multiple regression on categorical predictor data there's variable x1,x2,x3 and x3 is categorical one. so i just used as.factor(x3) and then ran multiple regression is it a good way to do the multiple regression on categorical predictor data? and how can I interpret the estimates? also if using as.factor is a good way, is there any difference with doing dummy coding for categorical variable and then running regression? Thanks. -- View this message in context: http://r.789695.n4.nabble.com/using-categorical-variable-in-multiple-regression-tp3591517p3591517.html Sent from the R help mailing list archive at Nabble.com.
for categorical independent variables, regression models in R will generate dummy indicators based on your setting of contrasts (default contr.treatment). Use model.matrix(your model) to see how R does this internally. Weidong Gu On Sun, Jun 12, 2011 at 2:38 AM, setlist <yespuppy90 at hanmail.net> wrote:> Hello, I wanted to do the multiple regression on categorical predictor data > there's variable x1,x2,x3 and x3 is categorical one. > so i just used as.factor(x3) and then ran multiple regression > is it a good way to do the multiple regression on categorical predictor > data? > and how can I interpret the estimates? > also if using as.factor is a good way, is there any difference with doing > dummy coding for categorical variable and then running regression? > Thanks. > > -- > View this message in context: http://r.789695.n4.nabble.com/using-categorical-variable-in-multiple-regression-tp3591517p3591517.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help at r-project.org 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. >
Vijayanpadmanabhan
2011-Jun-13 15:57 UTC
[R] using categorical variable in multiple regression
Try using RandomForest.. -- View this message in context: http://r.789695.n4.nabble.com/using-categorical-variable-in-multiple-regression-tp3591517p3594170.html Sent from the R help mailing list archive at Nabble.com.