[R] extracting characters from a string

2013-01-23 Thread Biau David
Dear All, I have a data frame of vectors of publication names such as 'pub': pub1 - c('Brown DK, Santos R, Rome DF, Don Juan X') pub2 - c('Benigni D') pub3 - c('Arstra SD, Van den Hoops DD, lamarque D') pub - rbind(pub1, pub2, pub3) I would like to construct a dataframe with only author's

Re: [R] extracting characters from a string

2013-01-23 Thread Biau David
thanks, it works well. I have to work on Arun's previous answer to make it work too.   David De : Rui Barradas ruipbarra...@sapo.pt À : Biau David djmb...@yahoo.fr Cc : r help list r-help@r-project.org Envoyé le : Mercredi 23 janvier 2013 19h57 Objet : Re

Re: [R] removing loops from code in making data.frame

2013-01-16 Thread Biau David
? thanks,   David Biau De : arun smartpink...@yahoo.com À : Biau David djmb...@yahoo.fr Cc : R help r-help@r-project.org Envoyé le : Mardi 15 janvier 2013 21h54 Objet : Re: [R] removing loops from code in making data.frame Hi, You could also do this: res1

[R] removing loops from code in making data.frame

2013-01-15 Thread Biau David
Dear all, I am working on an author network and to do so I have to arrange a data.frame (tutu) crossing author names (rows) per publication number (column). The participation of the author to a study is indicated by a 1 and 0 otherwise. I have a vector (xaulist) of all the names of authors and

[R] extracting character values

2013-01-13 Thread Biau David
Dear all, I have a dataframe of names (netw), with each cell including last name and initials of an author; some cells have NA. I would like to extract only the last name from each cell; this new dataframe is calle 'res' Here is what I do: res - data.frame(matrix(NA, nrow=dim(netw)[1],

Re: [R] count combined occurrences of categories

2013-01-13 Thread Biau David
-project.org; Biau David djmb...@yahoo.fr Envoyé le : Vendredi 11 janvier 2013 18h54 Objet : Re: [R] count combined occurrences of categories On Jan 11, 2013, at 9:47 AM, arun wrote: HI David, I get different results with dcast() library(reshape2)   dcast(melt(tutu,nam),nam~value,length

Re: [R] extracting character values

2013-01-13 Thread Biau David
,}', as.character(netw[,i])) res[i] - substring(as.character(netw[,i]), wh, wh + attr(wh,'match.length')-1) }  problem is for author van den hoofs j who is only retrieved as 'van' thanks, David Biau De : arun smartpink...@yahoo.com À : Biau David djmb...@yahoo.fr Envoyé

Re: [R] extracting character values

2013-01-13 Thread Biau David
works great thanks. And you cut off my code a lot and removed the loop.   David Biau De : Uwe Ligges lig...@statistik.tu-dortmund.de À : Biau David djmb...@yahoo.fr Cc : arun smartpink...@yahoo.com; r help list r-help@r-project.org Envoyé le : Dimanche 13

Re: [R] extracting character values

2013-01-13 Thread Biau David
thanks too. It works also perfect. Not sure I understand all the code though: will have to look into it!   David Biau De : arun smartpink...@yahoo.com À : Biau David djmb...@yahoo.fr Cc : R help r-help@r-project.org; Uwe Ligges lig...@statistik.tu

[R] count combined occurrences of categories

2013-01-11 Thread Biau David
Dear all,   i would like to count the number of times where I have combined occurrences of the categories of 2 variables.   For instance, in the dataframe below, i would like to know how many times each author (au1, au2, au3 represent the first, second, third author) is associated with each of

[R] Re : interpretation of coefficients in survreg AND obtaining the hazard function

2010-11-15 Thread Biau David
Dear Prof Therneau, thank yo for this information: this is going to be most useful for what I want to do. I will look into the ACF model. Yours, David Biau. De : Terry Therneau thern...@mayo.edu Cc : r-help@r-project.org Envoyé le : Lun 15 novembre 2010,

[R] Re : interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-14 Thread Biau David
Dear Prof Lumley, This is a very clear, precise, and useful answer to all my questions. Thank you very much. David Biau. De : Thomas Lumley tlum...@uw.edu Cc : r help list r-help@r-project.org Envoyé le : Dim 14 novembre 2010, 23h 54min 23s Objet : Re: [R]

[R] interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-13 Thread Biau David
Dear R help list, I am modeling some survival data with coxph and survreg (dist='weibull') using package survival. I have 2 problems: 1) I do not understand how to interpret the regression coefficients in the survreg output and it is not clear, for me, from ?survreg.objects how to. Here is an

[R] Re : interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors

2010-11-13 Thread Biau David
...@comcast.net Cc : r help list r-help@r-project.org Envoyé le : Sam 13 novembre 2010, 19h 55min 10s Objet : Re: [R] interpretation of coefficients in survreg AND obtaining the hazard function for an individual given a set of predictors On Nov 13, 2010, at 12:51 PM, Biau David wrote: Dear R help

[R] How to compare the effect of a variable across regression models?

2010-08-13 Thread Biau David
Hello, I would like, if it is possible, to compare the effect of a variable across regression models. I have looked around but I haven't found anything. Maybe someone could help? Here is the problem: I am studying the effect of a variable (age) on an outcome (local recurrence: lr). I have

[R] Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Biau David
in regressor effects between models. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt University On Fri, 13 Aug 2010, Biau David wrote: Hello, I would like, if it is possible, to compare the effect

[R] Re : Re : How to compare the effect of a variable across regression models?

2010-08-13 Thread Biau David
in some sense, you can use the bootstrap to get confidence bands for differences in regressor effects between models. Frank Frank E Harrell Jr Professor and ChairmanSchool of Medicine Department of Biostatistics Vanderbilt University On Fri, 13 Aug 2010, Biau David

[R] How to extract se(coef) from cph?

2010-08-05 Thread Biau David
Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se(coef) for other, linear, predictors. This is just to make nice LateX tables automatically. I have the coefficients

[R] Re : How to extract se(coef) from cph?

2010-08-05 Thread Biau David
to extract se(coef) from cph? On Aug 5, 2010, at 4:03 PM, Biau David wrote: Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se(coef) for other, linear, predictors

[R] Re : How to extract se(coef) from cph?

2010-08-05 Thread Biau David
try sqrt(diag(m1$var)) This is coded in print.cph.fit (library(rms)) On 08/05/2010 04:03 PM, Biau David wrote: Hello, I am modeling some survival data wih cph (Design). I have modeled a predictor which showed non linear effect with restricted cubic splines. I would like to retrieve the se

[R] COXPH: how to get the score test and likelihood ratio test for a specific variable in a multivariate Coxph ?

2010-07-30 Thread Biau David
Hello, I would like to get the likelihood ratio and score tests for specific variables in a multivariate coxph model. The default is Wald, so the tests for each separate variable is based on Wald's test. I have the other tests for the full model but I don't know how to get them for each

[R] Re : COXPH: how to get the score test and likelihood ratio test for a specific variable in a multivariate Coxph ?

2010-07-30 Thread Biau David
: David Winsemius dwinsem...@comcast.net Cc : r help list r-help@r-project.org Envoyé le : Ven 30 juillet 2010, 17h 34min 28s Objet : Re: [R] COXPH: how to get the score test and likelihood ratio test for a specific variable in a multivariate Coxph ? On Jul 30, 2010, at 11:08 AM, Biau David

[R] Re : Re : COXPH: how to get the score test and likelihood ratio test for a specific variable in a multivariate Coxph ?

2010-07-30 Thread Biau David
, Terry M., Ph.D. thern...@mayo.edu À : David Winsemius dwinsem...@comcast.net; Biau David djmb...@yahoo.fr Cc : r help list r-help@r-project.org Envoyé le : Ven 30 juillet 2010, 19h 07min 15s Objet : RE: Re : [R] COXPH: how to get the score test and likelihood ratio test for a specific variable

[R] longitudinal tobit regression in R

2010-06-30 Thread Biau David
Hi, I am trying to model a score over time. This score shows a ceiling effect. I was willing to use a longitudinal tobit model, such as the one described by Twisk et al. (Twisk_Longitudinal tobit regression: A new approach to analyze outcome variables with floor or ceiling effects_JCE_2009)

[R] crosstabling multiple variables at once

2010-05-20 Thread Biau David
Hi, I am trying to describe a data.frame by obtaining multiple crosstable summary statistics at once. I have tried table, xtab, crosstable, summaryBy and describe but none of these functions seems to allow muliple conparisons at once.  Here, is what I would like to do: I have, for instance, 

[R] multiple 2 by 2 crosstabulations?

2010-05-19 Thread Biau David
Hello, I have a dataframe (var_1, var_2, ..., var_n) and I would like to export summary statistics to Latex in the form of a table. I want specific summary statistics by crossing numerous variables 2x2 AT ONCE. In each cell I would like sometimes to have the median (Q1 - Q3), or frequency and