Hello, I was hoping for some advice in changing 2 defaults in a logistic regression. 1. It looks like the first category is the reference category? In the following syntax 'where' has 4 levels, how can I make the reference category the third category? model<- glm(cbind(sucesses, failures) ~ where + who + firstep + dxnarrow + age + sex + medyear, family = binomial, data=life.use) model 2. Is it possible to round results to 4 decimal points? If so, what syntax is required? Any assistance is appreciated, Bob Green
Dimitris Rizopoulos
2007-Jan-09 12:35 UTC
[R] logistic regression in R - changing defaults
an option is to use ?relevel(), e.g., life.use$where. <- relevel(life.use$where, 3) model<- glm(cbind(sucesses, failures) ~ where. + who + firstep + dxnarrow + age + sex + medyear, family = binomial, data = life.use) print(model, digits = 1) print(model, digits = 2) print(model, digits = 3) print(model, digits = 4) I hope it helps. Best, Dimitris ---- Dimitris Rizopoulos Ph.D. Student Biostatistical Centre School of Public Health Catholic University of Leuven Address: Kapucijnenvoer 35, Leuven, Belgium Tel: +32/(0)16/336899 Fax: +32/(0)16/337015 Web: http://med.kuleuven.be/biostat/ http://www.student.kuleuven.be/~m0390867/dimitris.htm ----- Original Message ----- From: "Bob Green" <bgreen at dyson.brisnet.org.au> To: <r-help at stat.math.ethz.ch> Sent: Tuesday, January 09, 2007 1:16 PM Subject: [R] logistic regression in R - changing defaults> Hello, > > I was hoping for some advice in changing 2 defaults in a logistic > regression. > > 1. It looks like the first category is the reference category? In > the > following syntax 'where' has 4 levels, how can I make the reference > category the third category? > > model<- glm(cbind(sucesses, failures) ~ where + who + firstep + > dxnarrow + > age + sex + medyear, family = binomial, data=life.use) > model > > 2. Is it possible to round results to 4 decimal points? If so, what > syntax > is required? > > Any assistance is appreciated, > > Bob Green > > ______________________________________________ > 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. >Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm