[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 t

[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], ncol=

Re: [R] count combined occurrences of categories

2013-01-13 Thread Biau David
OK thanks for the tips. I have abandonned the use of cbidn in dataframe. I've used the obth dcast() and melt() and they both work fine. Thanks again   David Biau > > De : David Winsemius >À : arun >Cc : R help ; Biau David >Envoyé le :

Re: [R] extracting character values

2013-01-13 Thread Biau David
z ds', NA, 'chung p', ' biau dj', 'marmor s', 'bhumbra r', 'pansuriya tc', NA) netw <- data.frame(au1, au2, au3) res <- data.frame(matrix(NA, nrow=dim(netw)[1], ncol=dim(netw)[2])) for (i in 1:dim(netw)[2]) { wh <- regexpr('[a-z]{3,}

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 >À : Biau David >Cc : arun ; r help list >Envoyé le : Dimanche 13 janvier 2013 18h22 >Objet : Re: [R] extracting character values >

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 >À : Biau David >Cc : R help ; Uwe Ligges > >Envoyé le : Dimanche 13 janvier 2013 18h36 >Objet

[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

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

2013-01-16 Thread Biau David
ing of the sort? thanks,   David Biau > > De : arun >À : Biau David >Cc : R help >Envoyé le : Mardi 15 janvier 2013 21h54 >Objet : Re: [R] removing loops from code in making data.frame > >Hi, > >You could also do this: &

[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 >À : Biau David >Cc : r help list >Envoyé le : Mercredi 23 janvier 2013 19h57 >Objet : Re: [R] extracting characters

[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) b

[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
_ De : David Winsemius Cc : r help list 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: > Dea

[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 Cc : r help list Envoyé le : Dim 14 novembre 2010, 23h 54min 23s Objet : Re: [R] interpretation of coefficients in

[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 Cc : r-help@r-project.org Envoyé le : Lun 15 novembre 2010, 15h 33min 23s Obje

[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 variabl

[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
p=2.375e-05 David Biau. De : David Winsemius Cc : r help list 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 wrote: &g

[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
rneau, Terry M., Ph.D." À : David Winsemius ; Biau David Cc : r help list 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 in a multivariate Coxph ? The Wald, score, and LR tests are discussed

[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 w

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

2010-08-05 Thread Biau David
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. The cph object has a

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

2010-08-05 Thread Biau David
s 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(coef) for

[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 buil

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

2010-08-13 Thread Biau David
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 of a variable across > regressi

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

2010-08-13 Thread Biau David
work for your goals, is to embed all models > in a grand model that is used for inference. > > When coefficients ARE comparable in some sense, you can use the bootstrap to >get > confidence bands for differences in regressor effects between models. > > Frank > > Frank E Ha

[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 p

[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 in