Hello R How do I refer to you in a publication? Many Thanks Ross Maller -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi, on the R webpage you find FAQ. There you can read: 2.8 Citing R To cite R in publications, use @article{, author = {Ross Ihaka and Robert Gentleman}, title = {R: A Language for Data Analysis and Graphics}, journal = {Journal of Computational and Graphical Statistics}, year = 1996, volume = 5, number = 3, pages = {299--314} } | Date: Fri, 29 Nov 2002 17:26:24 +0800 | From: Ross Maller <rmaller at ecel.uwa.edu.au> | | Hello R | How do I refer to you in a publication? | Many Thanks Ross Maller -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Ross Maller wrote:> > Hello R > How do I refer to you in a publication? > Many Thanks Ross MallerThis is FAQ 2.8 "Citing R": @article{, author = {Ross Ihaka and Robert Gentleman}, title = {R: A Language for Data Analysis and Graphics}, journal = {Journal of Computational and Graphical Statistics}, year = 1996, volume = 5, number = 3, pages = {299--314} } Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hi, R users! Suppose I make a model like this: model1<-glm(resp~var1+var2+factor1+factor2+var1:factor1+var1:factor1+var2:factor2+var2:factor2,family=poisson) where "resp" is a response variable (poisson distributed) "var1" and "var2" are continuous variables and "factor1" and "factor2" are nominal variables (here I use them as dummy variable) "factor1" has 2 levels (2 and 8) and "factor2" 3 levels ( 1, 6 and 12). Now I want to obtain the labels of the coeficients of the model in 3 separate columns and a 4th column with the corresponding value, like this: variable1 variable2 level value (intercept) X var1 X var2 X factor1 8 X factor2 6 X factor2 12 X var1 factor1 8 X var1 factor2 6 X var1 factor2 12 X var2 factor1 8 X var2 factor2 6 X var2 factor2 12 X If I use: model1$coef, I obtain the name of the coef, but joined. I want them separated. Thank you very much for your help!!! -- Kenneth Roy Cabrera Torres -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Dear Kenneth, At 05:35 AM 11/29/2002 -0500, you wrote:>If I use: >model1$coef, I obtain the name of the coef, but joined. >I want them separated.There may be a simpler -- and more transparent approach -- but if I understand correctly what you want, here's a start: predictors <- attr(terms(model), "variables") predictors <- as.character(predictors[3:length(predictors)]) levels <- lapply(predictors, function(x) levels(eval(parse(text=x)))) Then predictors holds the predictor names and the list levels holds factor levels (or NULL for a numeric predictor). Now you need to consider the contrast coding for each factor to figure out how to use the levels: lapply(predictors, function(x) { x <- eval(parse(text=x)) if (is.factor(x)) contrasts(x) }) and you also need to determine where the interactions are. The relevant information is in terms(model) and attr(model.matrix(model), "assign"). The programming from this point looks tricky to me but doable. An alternative would be to examine names(coef(model)) using some of the other information. I hope that this helps, John ----------------------------------------------------- John Fox Department of Sociology McMaster University Hamilton, Ontario, Canada L8S 4M4 email: jfox at mcmaster.ca phone: 905-525-9140x23604 web: www.socsci.mcmaster.ca/jfox ----------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Apparently Analagous Threads
- Obtaining the variable names of a glm object
- Table question
- Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
- cbind in aggregate formula - based on an existing object (vector)
- ggpliot2: reordering of factors in facets facet.grid(). Reordering of factor on x-axis no problem.