Re: [R] Joint confidence interval for fractional polynomial terms

2012-01-09 Thread Eleni Rapsomaniki
one plots the fitted function results are just as hard to interpret. That's why the simultaneous CI plot will be very useful. Eleni > On Jan 9, 2012, at 8:45 AM, "Eleni Rapsomaniki" > wrote: > >> Dear R users, >> >> The package 'mfp' that fits f

[R] Joint confidence interval for fractional polynomial terms

2012-01-09 Thread Eleni Rapsomaniki
could bootstrap it, but is there a mathematical solution? Many thanks Eleni Rapsomaniki Medical Statistician UCL, London __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-p

[R] mfp package - can I exclude some powers?

2011-12-06 Thread Eleni Rapsomaniki
Hi, The mfp package suggests fractional polynomial transformations for non-linear predictors. For continuous variables that take negative values the suggested transformations tend to look ugly, e.g. if x1 is the original variable it is transformed to something like: (x1+5.67)^1 * log(x1+5.67), whe

[R] survConcordance with 'counting' type Surv()

2011-07-08 Thread Eleni Rapsomaniki
r start, stop data (counting) fit2 <- coxph(Surv(age,age+time2, status) ~ ph.ecog +ph.karno+pat.karno+meal.cal+wt.loss + age + sex, lung2) survConcordance(Surv(time, status) ~predict(fit2), lung2) Many thanks Eleni Rapsomaniki Research Associate Department of Public Health and Primary Ca

[R] UnoC function in survAUC for censoring-adjusted C-index

2011-06-24 Thread Eleni Rapsomaniki
Surv.rsp, Surv.rsp.new, lpnew, time=sort(tau)) [1] 0 0 0 0 0 0 0 0 0 0 This is a potentially very useful function so it would be great if someone could explain the behaviour here. Many thanks Eleni Rapsomaniki Research Associate/Statistician Strangeways Research Laboratory Department

[R] survreg vs. aftreg (eha) - the relationship between fitted coefficients?

2010-12-10 Thread Eleni Rapsomaniki
of freedom2 #Overall p-value 1.64669e-10 Many thanks for any help you may be able to provide. Eleni Rapsomaniki Research Associate University of Cambridge Institute of Primary and Public Health __ R-help@r-project.org mailing list https://stat.ethz.

[R] divide grid.newpage into two?

2010-07-19 Thread Eleni Rapsomaniki
b.random=TRUE, leftcols="studlab",leftlabs="") #they are superimposed... which is not what I want. Any hints/ideas much appreciated! Many thanks Eleni Rapsomaniki Research Associate Department of Public Health and Primary Care University of Cambridge _

Re: [R] Running cumulative sums in matrices

2010-04-14 Thread Eleni Rapsomaniki
That's really interesting... I have always assumed that for-loops take longer than apply. Perhaps it depends on the application. I'll try both in my code and see. Thank you! Eleni Rapsomaniki Research Associate Tel: +44 (0) 1223 740273 Strangeways Research Laboratory Department

[R] Running cumulative sums in matrices

2010-04-14 Thread Eleni Rapsomaniki
matrix: m1=cbind(1:5,1:5,1:5) #The aim is to create a new matrix with every column containing the cumulative sum of all previous columns. m2=m1 for(i in 2:ncol(m1)){ m2[,i]=apply(m1[,1:i],1,sum) } m2 Many thanks in advance Eleni Rapsomaniki Research Associate Strangeways Research Laboratory

Re: [R] Calibration score for survival probability

2009-11-23 Thread Eleni Rapsomaniki
information than a single statistic anyway!). I will try the updated version in the rms package to compare. Best Wishes Eleni Rapsomaniki Research Associate Strangeways Research Laboratory Department of Public Health and Primary Care University of Cambridge -Original Message- From

[R] Calibration score for survival probability

2009-11-23 Thread Eleni Rapsomaniki
of expected vs observed probabilities). Any other functions I should be aware of? Also, has anybody come across an implementation of the statistic described in: "A global goodness of fit statistic for Cox regression models" by Parzen & Lpisitz, Biometrics 55, 1999 Many thanks in advance

[R] update.formula drop interaction terms

2009-10-13 Thread Eleni Rapsomaniki
date(forml, ~ . -A) #gives me this: #Surv(time, status) ~ x1 + x2 + x3 + x4 + B + x5 + strata(sex) + A:x3 + A:x4 + B:x5 #but I want this: #updated.forml=as.formula("Surv(time, status) ~ x1+x2+x3+x4+B*x5+strata(sex)") Any ideas? Thanks in advance Eleni Rapsomaniki Research Associate

[R] turning off specific types of warnings

2009-05-20 Thread Eleni Rapsomaniki
don't use linear.predictors=) for better estimates. I would like to turn this specific warning off, as it makes it difficult to detect other (potentially more crucial) warnings generated by other parts of my code. Is there a way to do this? Eleni Rapsomaniki Research Associate Strangeways Rese

[R] pooled mean

2009-04-16 Thread Eleni Rapsomaniki
Dear R users, Is there an R function to compute the pooled mean? Many Thanks Eleni Rapsomaniki  __ 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

Re: [R] Competing risks Kalbfleisch & Prentice method

2009-03-27 Thread Eleni Rapsomaniki
ved events for either cause (perhaps a parametric model could be used in this case). But then again, this was not an issue wtih my data. Eleni Rapsomaniki Research Associate Strangeways Research Laboratory Department of Public Health and Primary Care University of Cambridge -Original Message

Re: [R] Competing risks Kalbfleisch & Prentice method

2009-03-26 Thread Eleni Rapsomaniki
P.t) #P.t is the CR adjusted, should always be lower mean(a.risk) mean(P.t) Eleni Rapsomaniki Research Associate Tel: +44 (0) 1223 740273 Strangeways Research Laboratory Department of Public Health and Primary Care University of Cambridge -Original Message- From: Ravi Varadhan [

Re: [R] Competing risks Kalbfleisch & Prentice method

2009-03-26 Thread Eleni Rapsomaniki
el assumptions (people who die from competing causes remaining in the risk set) are theoretically sound. If anybody is interested in the Kalbfleisch & Prentice based cumulative incidence adjusting for competing risks with covariates, I'm happy to supply the code. Eleni Rapsomaniki

[R] Competing risks Kalbfleisch & Prentice method

2009-03-25 Thread Eleni Rapsomaniki
k1(t; x)=P(T<=t, cause=k1|x)=Sum(u=0, ..., u=t) {hazard_k(u;x)*S(u;x)} where S(u;x) = exp{-sum_of_k(sum(hazard_k(u))} I have searched extensively for an implementation of this in many packages, but it appears that more complex approaches are more commonly implemented, such as timereg pack

[R] Competing risks adjusted for covariates

2009-02-27 Thread Eleni Rapsomaniki
ld like to adjust for more than one covariate (it allows you to stratify by a single grouping vector). Any help/tips will be extremely appreciated. Eleni Rapsomaniki Research Associate Cambridge [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] C-index for models fitted using start, stop in Surv?

2009-02-25 Thread Eleni Rapsomaniki
> rcorr.cens is not meant for that. Thank you for the clarification. On a second thought, I think (hope) a time-dependent AUC index should be more appropriate in this case, such as survivalROC. Many many thanks for all your help! Eleni Rapsomaniki Research Associate Tel: +44 (0) 1

[R] C-index for models fitted using start, stop in Surv?

2009-02-25 Thread Eleni Rapsomaniki
computing it myself? Many Thanks Eleni Rapsomaniki Research Associate Strangeways Research Laboratory Department of Public Health and Primary Care University of Cambridge   __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r

[R] FW: Age as time-scale in survival analysis

2009-02-20 Thread Eleni Rapsomaniki
ays. How do I get the equivalent risks from the two models? Any tips greatly appreciated!! (FYI A related entry to my question can be found at: http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9831.html) Eleni Rapsomaniki Research Associate Department of Public Health and Primary Care University

[R] Age as time-scale in a cox model-How to calculate x-time risk?

2009-02-18 Thread Eleni Rapsomaniki
000 days. How do I get the equivalent risks from the two models? Any tips greatly appreciated!! (FYI A related entry to my question can be found at: http://tolstoy.newcastle.edu.au/R/e2/help/07/02/9831.html) Eleni Rapsomaniki Research Associate Department of Public Health and Primary Care

[R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Eleni Rapsomaniki
hazard etc, which is what I get from survest and predict for example.   I suspect the answer is embarrassing simple... (BTW sorry for the duplicate email, the earlier HTML version of my message could not be viewed) Eleni Rapsomaniki   Research Associate Strangeways Research Laboratory Department of

[R] How do i compute predicted failure time from a cox model?

2009-02-16 Thread Eleni Rapsomaniki
), or hazard etc, which is what I get from survest and predict for example. I suspect the answer is embarrassing simple... Eleni Rapsomaniki Research Associate Strangeways Research Laboratory Department of Public Health and Primary Care [[alternative HTML version

[R] Using subset in validate() in Design, what is the correct syntax?

2009-02-06 Thread Eleni Rapsomaniki
Hi I am trying to understand how to get the validate() function in Design to work with the subset option. I tried this: ovarian.cph=cph(Surv(futime, fustat) ~ age+factor(ecog.ps)+strat(rx), time.inc=1000, x=T, y=T, data=ovarian) validate(ovarian.cph) #fine when no subset is used, but the

[R] See source code for survplot function in Design package

2009-02-05 Thread Eleni Rapsomaniki
Dear R users, I know one way to see the code for a hidden function, say function_x, is using default.function_x (e.g. summary.default). But how can I see the code for imported packages that have no namespace (in this case Design)? Many Thanks Eleni ___

[R] survfit using quantiles to group age

2009-02-02 Thread Eleni Rapsomaniki
(time,status) ~ quantile(age,3), data=veteran) #will not work ideally I would like to superimpose estimates from cph models, which automatically fit the 2nd to 4rth quantiles for age, so I need the age groups to be grouped the same. Any help greatly appreciated! Eleni Rapsomaniki

[R] correlation between rows of data.frame

2008-08-01 Thread Eleni Rapsomaniki
Dear R users, I need to come up with an efficient method to compute the correlation (or at least, the euclidean distance if that's easier) between specific rows in a data frame (46,232 rows,29 columns). The pairs of rows between which I want to find the correlation share a common value in one

[R] Confidence intervals for beta distribution

2008-01-03 Thread Eleni Rapsomaniki
distribution? Many Thanks in advance, Eleni Rapsomaniki __ 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

[R] Who uses R?

2007-09-25 Thread Eleni Rapsomaniki
etter than Excel would be very much appreciated. Many Thanks Eleni Rapsomaniki __ 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 comm