[R] making a plot

2014-10-20 Thread Enrico Colosimo
Dear all,

I am struggling to make a plot for my survival analysis
class.

This is my script


 labels-c('1','2','3','4','5','6')
 ano-c(2001,2002,2003,2004,2006,2008)
 ranges-c(6,3,4,5,4,2)
 dotchart(ano, labels=labels, xlab='ano',
ylab='Pacientes',pch=20,xlim=c(min(ano),  max(ano+ranges)))
 segments(ano,1:6,ano+ranges,1:6,pch=25,lty=1,lend=4)

I need to put an asterix (failure) by the end of the three first lines and
a small circle (censoring)
by the end of the last three.

Someone can help me?

Thanks,
Enrico.

[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] making a plot

2014-10-20 Thread Enrico Colosimo
Thanks David and Adrés,

it worked fine.

Enrico.


2014-10-20 15:37 GMT-02:00 David Winsemius dwinsem...@comcast.net:


 On Oct 20, 2014, at 8:24 AM, Andrés Aragón wrote:

  Enrico,
 
  This may help you:
 
  text(locator(1), *, cex=1.5,adj=0.5
 
  and
 
  text(locator(1), º, cex=1.5,adj=0.5

 Why not just use the values of x2 and  y2 that were given to segments:

  text( (ano+ranges)[1:3], 1:3, *, cex=1.5,adj=0.5)
  text( (ano+ranges)[4:6], 4:6 , º, cex=1.5,adj=0.5)

 
 
  Draw your plot, then write the code, locate the cursor on your plot, put
  the symbols where you want itl and click.
 
  Regards,
 
 
  Andrés
 
  PS ?locator
 
 
  2014-10-20 9:46 GMT-05:00 Enrico Colosimo enrico...@gmail.com:
 
  Dear all,
 
  I am struggling to make a plot for my survival analysis
  class.
 
  This is my script
 
 
  labels-c('1','2','3','4','5','6')
  ano-c(2001,2002,2003,2004,2006,2008)
  ranges-c(6,3,4,5,4,2)
  dotchart(ano, labels=labels, xlab='ano',
  ylab='Pacientes',pch=20,xlim=c(min(ano),  max(ano+ranges)))
  segments(ano,1:6,ano+ranges,1:6,pch=25,lty=1,lend=4)
 
  I need to put an asterix (failure) by the end of the three first lines
 and
  a small circle (censoring)
  by the end of the last three.
 
  Someone can help me?
 
  Thanks,
  Enrico.
 
 [[alternative HTML version deleted]]
 
 --

 David Winsemius
 Alameda, CA, USA



[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-16 Thread Enrico Colosimo
What are the significant problems of the log-log transformations?
Any papers published about it?
Enrico.


2012/4/14 Frank Harrell f.harr...@vanderbilt.edu

 I used log-log in my book too until Terry Therneau alerted me to the
 significant problems this creates.  In the 2nd edition it will use log
 S(t).
 Frank

 Paul Miller wrote
 
  Hello Drs. Colosimo and Harrell,
 
  Thank you for your replies to my question. From Dr. Colosimo, I was able
  to determine that the SAS results can be replicated by adding the
  option conf.type=log-log to my code as in :
 
  survobj - survfit(survfrm, conf.type=log-log, data=Survival)
 
  Originally, it looked like the SAS results could be replicated using
  conf.type=plain. Applying this option to my actual data revealed that
  this was not the case, however.
 
 From Dr. Harrell, I learned that using conf.type=log-log may not be
 such
 a good idea. Interestingly though, I've seen at least one instance where
 experts in the R community use this option in their book. The book is about
 10 years old. So maybe opinion about the use of this option has shifted
 since then.
 
  Thanks,
 
  Paul
 
[[alternative HTML version deleted]]
 
 
  __
  R-help@ 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.
 


 -
 Frank Harrell
 Department of Biostatistics, Vanderbilt University
 --
 View this message in context:
 http://r.789695.n4.nabble.com/Kaplan-Meier-analysis-95-CI-wider-in-R-than-in-SAS-tp4554559p4557695.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.


Re: [R] Kaplan Meier analysis: 95% CI wider in R than in SAS

2012-04-16 Thread Enrico Colosimo
But it is very very unlikely to have a time with survival
probability of 0. in a real data set. It would be
necessary huge data set. A Monte Carlo simulation could
put a little more light in this issue?

2012/4/16 Frank Harrell f.harr...@vanderbilt.edu

 Just generate some data where the estimated survival probability is 0.
 at
 a certain time.  The log-log transformation blows up.
 Frank

 Enrico Colosimo wrote
 
  What are the significant problems of the log-log transformations?
  Any papers published about it?
  Enrico.
 
 
  2012/4/14 Frank Harrell lt;f.harrell@gt;
 
  I used log-log in my book too until Terry Therneau alerted me to the
  significant problems this creates.  In the 2nd edition it will use log
  S(t).
  Frank
 
  Paul Miller wrote
  
   Hello Drs. Colosimo and Harrell,
  
   Thank you for your replies to my question. From Dr. Colosimo, I was
  able
   to determine that the SAS results can be replicated by adding the
   option conf.type=log-log to my code as in :
  
   survobj - survfit(survfrm, conf.type=log-log, data=Survival)
  
   Originally, it looked like the SAS results could be replicated using
   conf.type=plain. Applying this option to my actual data revealed
 that
   this was not the case, however.
  
  From Dr. Harrell, I learned that using conf.type=log-log may not be
  such
  a good idea. Interestingly though, I've seen at least one instance where
  experts in the R community use this option in their book. The book is
  about
  10 years old. So maybe opinion about the use of this option has shifted
  since then.
  
   Thanks,
  
   Paul
  
 [[alternative HTML version deleted]]
  
  
   __
   R-help@ 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.
  
 
 
  -
  Frank Harrell
  Department of Biostatistics, Vanderbilt University
  --
  View this message in context:
 
 http://r.789695.n4.nabble.com/Kaplan-Meier-analysis-95-CI-wider-in-R-than-in-SAS-tp4554559p4557695.html
  Sent from the R help mailing list archive at Nabble.com.
 
  __
  R-help@ 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.
 
 
[[alternative HTML version deleted]]
 
  __
  R-help@ 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.
 


 -
 Frank Harrell
 Department of Biostatistics, Vanderbilt University
 --
 View this message in context:
 http://r.789695.n4.nabble.com/Kaplan-Meier-analysis-95-CI-wider-in-R-than-in-SAS-tp4554559p4561432.html
 Sent from the R help mailing list archive at Nabble.com.

 __
 R-help@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.


[[alternative HTML version deleted]]

__
R-help@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.


[R] lme command

2010-06-14 Thread Enrico Colosimo
Hi,

I am doing a longitudinal data set fit using lme.
I used two forms of the lme command and I am
getting two different outputs.

FIRST
out-lme(Altura~Idade+Idade2+sexo+status+Idade:sexo+Idade:status+Idade2:sexo+Idade2:status,
random=(list(ident=~Idade+Idade2)))

SECOND
out-lme(Altura~Idade+Idade2+sexo+status+Idade:sexo+Idade:status+Idade2:sexo+Idade2:status,
random= ~Idade+Idade2|ident,data=dados)

I got weird results from the first one and could not understand the
reason of it. All the results are
exactly the same but  the intercetp, and the two main terms sexo
(gender) and status (treatment).
That differences made a lot of difference in the final results.

Anybody can tell me what is the differences  between them?
Thanks.

Enrico.

__
R-help@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.


[R] glm output for binomial family

2010-06-08 Thread Enrico Colosimo
Hello,
 I am having some trouble running a very simple
example. I am running a logistic regression entering the SAME data set
in two different forms and getting different values for the deviance residual.

Just look with this naive data set:


# 1- Entering as a Bernoulli data set
 y-c(1,0,1,1,0)
 x-c(2,2,5,5,8)
 ajust1-glm(y~x,family=binomial(link=logit))
 ajust1
#
Coefficients:
(Intercept)            x
    1.3107      -0.2017

Degrees of Freedom: 4 Total (i.e. Null);  3 Residual
Null Deviance:      6.73
Residual Deviance: 6.491        AIC: 10.49
#
# 2- Entering as Binomial data set
#
 ysim-c(1,2,0)
 ynao-c(1,0,1)
 x-c(2,5,8)
 dados-cbind(ysim,ynao,x)
 dados-as.data.frame(dados)
 attach(dados)
 ajust2-glm(as.matrix(dados[,c(1,2)])~x,family=binomial, data=dados)
 summary(ajust2)
#
Coefficients:
(Intercept)            x
    1.3107      -0.2017

Degrees of Freedom: 2 Total (i.e. Null);  1 Residual
Null Deviance:      3.958
Residual Deviance: 3.718        AIC: 9.104
=

It seems that there is problem with the first fitting!!!

Best
Enrico Colosimo
Dept Statistics, UFMG
Brazil

__
R-help@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.