Re: [R] How to extract convergence code from lmer object?

2014-07-05 Thread Ben Bolker
Juan Andres Hernandez gmail.com> writes: > > Does anyone know how to extract the convergence code of an lmer object. I > am working in a monte carlo simulation with mixed model and I need to know > if a model has or not convergence. With unclass(mymodel) the following > information attr(,"optinf

Re: [R] Predictions from "coxph" or "cph" objects

2014-07-05 Thread David Winsemius
On Jul 5, 2014, at 9:12 PM, David Winsemius wrote: On Jul 5, 2014, at 12:43 PM, Axel Urbiz wrote: Thank you David. It is my understanding that using survfirsurvit below I get the median predicted survival. I actually was looking for the mean. I can't seem to find in the documentation how

Re: [R] Predictions from "coxph" or "cph" objects

2014-07-05 Thread David Winsemius
On Jul 5, 2014, at 12:43 PM, Axel Urbiz wrote: Thank you David. It is my understanding that using survfirsurvit below I get the median predicted survival. I actually was looking for the mean. I can't seem to find in the documentation how to get that. options(na.action=na.exclude) # retai

Re: [R] Predictions from "coxph" or "cph" objects

2014-07-05 Thread Axel Urbiz
Thank you David. It is my understanding that using survit below I get the median predicted survival. I actually was looking for the mean. I can't seem to find in the documentation how to get that. options(na.action=na.exclude) # retain NA in predictions fit <- coxph(Surv(time, status) ~ age + ph.e

Re: [R] Best practice: to factor or not to factor for float variables

2014-07-05 Thread MacQueen, Don
However, > format((0.1+0.2)) == format(0.3) [1] TRUE Which suggests that if you want to treat measured variables as categories, one way to do it is to format them first. Of course, one may have to control the format more carefully than above (if necessary, see for example ?formatC). merge() on

Re: [R] Predictions from "coxph" or "cph" objects

2014-07-05 Thread David Winsemius
On Jul 5, 2014, at 5:28 AM, Axel Urbiz wrote: Dear R users, My apologies for the simple question, as I'm starting to learn the concepts behind the Cox PH model. I was just experimenting with the survival and rms packages for this. I'm simply trying to obtain the expected survival time (a

Re: [R] Using R to analyze multiple MRI studies

2014-07-05 Thread Suzen, Mehmet
Did you inspect the CRAN view for Medical imaging? http://cran.r-project.org/web/views/MedicalImaging.html On 3 July 2014 17:09, moleps islon wrote: > I need to analyze multiple T1 contrast enhanced MRI studies from different > patients. They are all in DICOM format. I see that there are differen

Re: [R] Using subplot (from Hmisc) along with par(mfrow)

2014-07-05 Thread Greg Snow
The subplot function in the TeachingDemos package is more up to date than the version in Hmisc (the Hmisc version is a copy of an earlier version of the one in TeachingDemos). If you replace library(Hmisc) with library(TeachingDemos) (with a recent version of TeachingDemos installed) then the code

Re: [R] metafor package: changing decimal in forest plot to midline decimal

2014-07-05 Thread Viechtbauer Wolfgang (STAT)
I found this: https://stat.ethz.ch/pipermail/r-help/2012-August/321057.html So, use this before drawing the forest plot: options(OutDec="\xB7") Best, Wolfgang -- Wolfgang Viechtbauer, Ph.D., Statistician Department of Psychiatry and Psychology School for Mental Health and Neuroscience Faculty

Re: [R] how does a valid subscript can produce an "subscript out of bounds" error?

2014-07-05 Thread Patrick Burns
I think you are somewhere between Circle 8.2.6 of 'The R Inferno' http://www.burns-stat.com/documents/books/the-r-inferno/ and the basics of subscripting http://www.burns-stat.com/documents/tutorials/impatient-r/more-r-subscript/ Pat On 05/07/2014 15:19, Witold E Wolski wrote: Thank you. You

Re: [R] how does a valid subscript can produce an "subscript out of bounds" error?

2014-07-05 Thread peter dalgaard
On 05 Jul 2014, at 16:19 , Witold E Wolski wrote: > Thank you. You example helped to FIX IT. > > The problem is I guess somehow related to: >> class(msexp$pepinfo$transition_group_id) > [1] "factor" > > and the whole R type conversion , riddle. > > For subscripts my intuition is: either requ

Re: [R] how does a valid subscript can produce an "subscript out of bounds" error?

2014-07-05 Thread Witold E Wolski
Thank you. You example helped to FIX IT. The problem is I guess somehow related to: > class(msexp$pepinfo$transition_group_id) [1] "factor" and the whole R type conversion , riddle. For subscripts my intuition is: either require integer or do the "cast" to the rowname type (character). However,

[R] Predictions from "coxph" or "cph" objects

2014-07-05 Thread Axel Urbiz
Dear R users, My apologies for the simple question, as I'm starting to learn the concepts behind the Cox PH model. I was just experimenting with the survival and rms packages for this. I'm simply trying to obtain the expected survival time (as opposed to the probability of survival at a given tim

Re: [R] Calling Matrices from a Function

2014-07-05 Thread Sarah Goslee
Hi, This line needs double brackets: result_1 <- (result[[1]]) With single brackets you're keeping the list object. With double brackets you're extracting just the object within the list. Sarah On Friday, July 4, 2014, Cheryl Johnson wrote: > When I call matrices from a function, they are cal