Graham Smith
2006-Sep-30 12:38 UTC
[R] Textmate project drawer: is there a Windows alternative?
I was reading about the project drawer feature in Textmate, which is Mac only. Is there a similar feature in a Windows based text editor that works with R. This feature sounds really useful. Thanks, Graham [[alternative HTML version deleted]]
Dear R users, I am calculating several cox proportional hazard models after each other (I know this is unusual, but I am just exploring the data). For the purpose of multiple testing correction I need to construct an array of these p-values. However since the output is not an array in itself, I cannot find a way to obtain the p-value only.> attach(tms)>> goal<-rep(0.7*FREQUENC[1:13],6)> event<- Surv(TIJD,FREQUENC<goal)> results<-coxph(event~ TYPETREA)> summary(results)Call: coxph(formula = event ~ TYPETREA) n=76 (2 observations deleted due to missing) coef exp(coef) se(coef) z p TYPETREAnon-guided -0.826 0.438 0.484 -1.71 0.088 exp(coef) exp(-coef) lower .95 upper .95 TYPETREAnon-guided 0.438 2.28 0.169 1.13 Rsquare= 0.041 (max possible= 0.829 ) Likelihood ratio test= 3.2 on 1 df, p=0.0737 Wald test = 2.91 on 1 df, p=0.088 Score (logrank) test = 3.08 on 1 df, p=0.0794 Does anyone now how to extract the p-value? Many thanks!, Marco
Duncan Murdoch
2006-Sep-30 13:29 UTC
[R] Textmate project drawer: is there a Windows alternative?
On 9/30/2006 8:38 AM, Graham Smith wrote:> I was reading about the project drawer feature in Textmate, which is Mac > only. > > Is there a similar feature in a Windows based text editor that works with R. > This feature sounds really useful.If you don't get an answer, it would probably be a good idea to describe what a "project drawer" is. The population of people who know Textmate and Windows text editors is probably pretty small. Duncan Murdoch> > Thanks, > > Graham > > [[alternative HTML version deleted]] > > ______________________________________________ > 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.
This is how you go about doing this. summary(results)$coefficients[1,5] You will have to check this for you code. But the idea is that summary(results) is a list (?) and one of its components is called "coefficients", which is a matrix. So the problem is just to extract one element of this matrix. I am not well versed with coxph so there may be some minor details I am missing, but that is the general idea (same as with lm, glm etc.). Ritwik. On 9/30/06, Boks, M.P.M. <M.P.M.Boks at umcutrecht.nl> wrote:> > > Dear R users, > > > > I am calculating several cox proportional hazard models after each other (I know this is unusual, but I am just exploring the data). For the purpose of multiple testing correction I need to construct an array of these p-values. However since the output is not an array in itself, I cannot find a way to obtain the p-value only. > > > > > attach(tms) > > > > > > goal<-rep(0.7*FREQUENC[1:13],6) > > > event<- Surv(TIJD,FREQUENC<goal) > > > results<-coxph(event~ TYPETREA) > > > summary(results) > > > > Call: > > coxph(formula = event ~ TYPETREA) > > > > n=76 (2 observations deleted due to missing) > > coef exp(coef) se(coef) z p > > TYPETREAnon-guided -0.826 0.438 0.484 -1.71 0.088 > > > > exp(coef) exp(-coef) lower .95 upper .95 > > TYPETREAnon-guided 0.438 2.28 0.169 1.13 > > > > Rsquare= 0.041 (max possible= 0.829 ) > > Likelihood ratio test= 3.2 on 1 df, p=0.0737 > > Wald test = 2.91 on 1 df, p=0.088 > > Score (logrank) test = 3.08 on 1 df, p=0.0794 > > > > Does anyone now how to extract the p-value? > > Many thanks!, > > Marco > > ______________________________________________ > 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. >-- Ritwik Sinha Graduate Student Epidemiology and Biostatistics Case Western Reserve University ritwik.sinha at gmail.com | +12163682366 | http://darwin.cwru.edu/~rsinha