my function is glm(a~log(b)+c+d+e,family=binomial,data=f)->aa I want to extract the original data set of aa. How to do it ? You may suggest the model.frame() function. In fact ,i have tried it. model.frame returns a data frame of containing a,log(b) NOT b,c,d,e I want to extract a data frame containing a,b,c,d,e,which is exactly the same as "f" How can I achieve this result? I want to do this because I need to extract the formular and act on another data set ,whose predict variables are the same as those of "f", but the response variable is different . -- View this message in context: http://www.nabble.com/how-to-extract-the-original-data-of-a-glm-object-tf4790525.html#a13704122 Sent from the R help mailing list archive at Nabble.com.
Henrique Dallazuanna
2007-Nov-12 12:05 UTC
[R] how to extract the original data of a glm object
Try: aa$data On 12/11/2007, leffgh <leffgh at 163.com> wrote:> > my function is > glm(a~log(b)+c+d+e,family=binomial,data=f)->aa > > > I want to extract the original data set of aa. How to do it ? > > You may suggest the model.frame() function. In fact ,i have tried it. > model.frame returns a data frame of containing a,log(b) NOT b,c,d,e > I want to extract a data frame containing a,b,c,d,e,which is exactly the > same as "f" > How can I achieve this result? > > > I want to do this because I need to extract the formular and act on another > data set ,whose predict variables are the same as those of "f", but the > response variable is different . > -- > View this message in context: http://www.nabble.com/how-to-extract-the-original-data-of-a-glm-object-tf4790525.html#a13704122 > 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. >-- Henrique Dallazuanna Curitiba-Paran?-Brasil 25? 25' 40" S 49? 16' 22" O
See and *read* the help file ?glm the object returned by glm() includes the `data' component hence: aa<-glm(..) aa$data or also eval(aa$call$data) leffgh ha scritto:> my function is > glm(a~log(b)+c+d+e,family=binomial,data=f)->aa > > > I want to extract the original data set of aa. How to do it ? > > You may suggest the model.frame() function. In fact ,i have tried it. > model.frame returns a data frame of containing a,log(b) NOT b,c,d,e > I want to extract a data frame containing a,b,c,d,e,which is exactly the > same as "f" > How can I achieve this result? > > > I want to do this because I need to extract the formular and act on another > data set ,whose predict variables are the same as those of "f", but the > response variable is different .-- ===================================Vito M.R. Muggeo Dip.to Sc Statist e Matem `Vianelli' Universit? di Palermo viale delle Scienze, edificio 13 90128 Palermo - ITALY tel: 091 6626240 fax: 091 485726/485612