[R] flexsurvspline with offset

2024-05-15 Thread Bonnett, Laura
Dear all, I am using R 4.4.0 via RStudio (2024.04.0) on a Windows PC. The code below worked on the previous version of the flexsurv but is not working since my recent update (version 2.3). The code that was working is: library(survival) rfs <- pmax(rotterdam$recur, rotterdam$death) rfstime

[R] Choosing between functional forms using flexible parametric survival models

2018-09-27 Thread Bonnett, Laura
Dear all, I am using R 3.4.3 on Windows 10. I am writing code to use in a forthcoming teaching session. As part of the workshop the students are using breast cancer data made available by Patrick Royston and available from http://www.statapress.com/data/fpsaus.html (I didn't pick the dataset

[R] Predictions from a Cox model - understanding centering of binary/categorical variables

2018-05-24 Thread Bonnett, Laura
Dear all, I am using R 3.4.3 on Windows 10. I am preparing some teaching materials and I'm having trouble matching the by-hand version with the R code. I have fitted a Cox model - let's use the ovarian data as an example: library(survival) data(ovarian) ova_mod <-

[R] Rstmp2 - linear predictors, AICs and BICs

2018-03-02 Thread Bonnett, Laura
Dear R-help, I am using R-3.3.2 on Windows 10. As per my previous post today, I teach on a course which has 4 computer practical sessions related to the development and validation of clinical prediction models. These are currently written for Stata and I am in the process of writing them for

[R] Variable centring within "predict.coxph"

2018-03-02 Thread Bonnett, Laura
Dear R-help, I am using R-3.3.2 on Windows 10. I teach on a course which has 4 computer practical sessions related to the development and validation of clinical prediction models. These are currently written for Stata and I am in the process of writing them for use in R too (as I far prefer

[R] Survfit when new data has only 1 row of data

2017-11-07 Thread Bonnett, Laura
Dear R-help, I am using R version 3.4.0 within Windows, and survival 2.41-3. I have fit a Prentice Williams and Peterson-Counting Process model to my data as shown below. This is basically an extension of the Cox model for interval censored data. My dataset, bdat5 can be found here:

Re: [R] Help understanding why glm and lrm.fit runs with my data, but lrm does not

2017-09-18 Thread Bonnett, Laura
Prediction Models book by Steyerberg. Many thanks again for your assistance. Kind regards, Laura From: harre...@gmail.com [mailto:harre...@gmail.com] On Behalf Of Frank Harrell Sent: 14 September 2017 17:22 To: David Winsemius <dwinsem...@comcast.net> Cc: Bonnett, Laura <ljbcm...@liverpool.

[R] Help understanding why glm and lrm.fit runs with my data, but lrm does not

2017-09-14 Thread Bonnett, Laura
Dear all, I am using the publically available GustoW dataset. The exact version I am using is available here: https://drive.google.com/open?id=0B4oZ2TQA0PAoUm85UzBFNjZ0Ulk I would like to produce a nomogram for 5 covariates - AGE, HYP, KILLIP, HRT and ANT. I have successfully fitted a

[R] Unexpected error message when making predictions from fitted PWP-CP (Cox) model

2017-04-03 Thread Bonnett, Laura
Dear all, I am using R x64 3.3.2 on Windows 10. I have fitted a Prentice-Williams-Peterson counting process model with a number of covariates as follows: Coxmod1 <- coxph(Surv(start,stop,status)~var1+var2+factor(var3)+cluster(var4)+strata(var5),data=Lauras) I would now like to make

[R] Standard error terms from gfcure

2012-03-27 Thread Bonnett, Laura
Dear R-help, I am using R 2.14.1 on Windows 7 with the 'gfcure' package (cure rate model). I have included the treatment variable in the cure part of the model as shown below: Ø ref_treat -

Re: [R] Actual vs. predicted survival times

2012-02-08 Thread Bonnett, Laura
this is not appropriate. Are you able to provide any suggestions as to how I might achieve the graph of actual vs. Predicted survival times? Many thanks, Laura -Original Message- From: David Winsemius [mailto:dwinsem...@comcast.net] Sent: 07 February 2012 16:59 To: Bonnett, Laura Cc: 'r-help@r

[R] Actual vs. predicted survival times

2012-02-07 Thread Bonnett, Laura
Dear R-help, I am using R 2.14.1 on Windows 7. I would like to produce a plot like the attached - although simplified to actual vs. Predicted survival time with distinguishing marks for censored and observed points. I have a dataset and have fitted a Cox model to it. In an attempt to

[R] R 2.14.0 Design library

2012-01-04 Thread Bonnett, Laura
Dear all, I have recently upgraded to R 2.14.0 with Windows 7. I wish to use the command 'cph' but the Design library is no longer on the list of installable packages. How can I install Design so that I may use the 'cph' function? Many thanks, Laura [[alternative HTML version

Re: [R] R 2.14.0 Design library

2012-01-04 Thread Bonnett, Laura
Thank you! -Original Message- From: Milan Bouchet-Valat [mailto:nalimi...@club.fr] Sent: 04 January 2012 09:23 To: Bonnett, Laura Cc: 'r-help@r-project.org' Subject: Re: [R] R 2.14.0 Design library Le mercredi 04 janvier 2012 à 09:04 +, Bonnett, Laura a écrit : Dear all, I have

[R] Extract concordance from coxph.object

2012-01-04 Thread Bonnett, Laura
Dear all, As I said in my previous email I have just upgraded to R 2.14.0 on Windows 7. I have just run the 'coxph' function and notice that a Concordance statistic is produced. Is there any way to extract this information from the output? E.g. can I call the concordance value independently

[R] Measure of separation for survival data

2011-11-23 Thread Bonnett, Laura
Dear all, I am using R 2.9.2 on Windows XP. I am undertaking a simulation study to consider methods of external validation in the context of missing covariates in the validation data set. I would like to use Royston's measure of prognostic separation as a method of external validation.

[R] Repeat a loop until...

2011-10-18 Thread Bonnett, Laura
Dear all, I know there have been various questions posted over the years about loops but I'm afraid that I'm still stuck. I am using Windows XP and R 2.9.2. I am generating some data using the multivariate normal distribution (within the 'mnormt' package). [The numerical values of sanad and

Re: [R] Where to put tryCatch or similar in a very big for loop

2011-09-16 Thread Bonnett, Laura
by model cox1. Thanks, Laura -Original Message- From: Ken [mailto:vicvoncas...@gmail.com] Sent: 15 September 2011 21:43 To: Bonnett, Laura Cc: Steve Lianoglou; r-help@r-project.org Subject: Re: [R] Where to put tryCatch or similar in a very big for loop What type of singularity exactly

Re: [R] Where to put tryCatch or similar in a very big for loop

2011-09-16 Thread Bonnett, Laura
I'm using the code attached can anyone offer a solution? Many thanks, Laura -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Bonnett, Laura Sent: 16 September 2011 08:22 To: 'Ken' Cc: r-help@r-project.org Subject: Re: [R] Where

[R] Where to put tryCatch or similar in a very big for loop

2011-09-15 Thread Bonnett, Laura
Dear all, I am running a simulation study to test variable imputation methods for Cox models using R 2.9.0 and Windows XP. The code I have written (which is rather long) works (if I set nsim = 9) with the following starting values.

Re: [R] Where to put tryCatch or similar in a very big for loop

2011-09-15 Thread Bonnett, Laura
Message- From: Steve Lianoglou [mailto:mailinglist.honey...@gmail.com] Sent: 15 September 2011 16:17 To: Bonnett, Laura Cc: r-help@r-project.org Subject: Re: [R] Where to put tryCatch or similar in a very big for loop Hi Laura, On Thu, Sep 15, 2011 at 10:53 AM, Bonnett, Laura l.j.bonn

[R] Confidence interval or p-value for difference in two c-statistics

2011-09-14 Thread Bonnett, Laura
Dear All, Apologies if you have a seen a question like this from me before. I am hoping that if I re-word my question more carefully someone may be able to offer more help than the last time I asked something similar. I am using R 2.9.2 and Windows XP. I am trying to determine if there is a

[R] SAS code in R

2011-09-05 Thread Bonnett, Laura
Dear all, I was wondering if anyone can help? I am an R user but recently I have resorted to SAS to calculate the probability of the event (and the associated confidence interval) for the Cox model with combinations of risk factors. For example, suppose I have a Cox model with two binary