[R] X11 font

2023-08-16 Thread Therneau, Terry M., Ph.D. via R-help
t;, log='y', type='l', yaxt='n',     main="US Death Rates") axis(2, c(1,2,5,10,20, 50), c(1,2,5,10, 20, 50), las=2) This code works fine on my screen.   The error comes up when I put it into an .Rmd file and apply rmarkdown::render() to it. Likely some font file is needed, but what one? Terry

Re: [R] extract from a list of lists

2022-12-27 Thread Therneau, Terry M., Ph.D. via R-help
oss talk in my brain from the rstan library -- Gregg's note shows such a function in purr.  But I rather like having as few dependencies as possible in a package, one usage is normally not enough, at least for something this simple. Terry T. On 12/27/22 14:38, Bert Gunter wrote: > Well, I

[R] MCMC tools

2022-12-27 Thread Therneau, Terry M., Ph.D. via R-help
.   SuStaIn tends to give small variances. Terry T. -- Terry M Therneau, PhD Department of Quantitative Health Sciences Mayo Clinic thern...@mayo.edu "TERR-ree THUR-noh" [[alternative HTML version deleted]] __ R-help@r-project.o

[R] extract from a list of lists

2022-12-27 Thread Therneau, Terry M., Ph.D. via R-help
he explicit x$iter function.   Am I indeed overlooking something?    I don't expect a speed increase, just cleaner code. Terry T. -- Terry M Therneau, PhD Department of Quantitative Health Sciences Mayo Clinic thern...@mayo.edu "TERR-ree THUR-noh" [[alternati

Re: [R] how to find "first" or "last" record after sort in R

2021-09-10 Thread Therneau, Terry M., Ph.D. via R-help
I prefer the duplicated() function, since the final code will be clear to a future reader. (Particularly when I am that future reader). last <- !duplicated(mydata$ID, fromLast=TRUE) # point to the last ID for each subject mydata$data3[last] <- NA Terry T. (I read the list once

Re: [R] coxph means not equal to means of model matrix

2021-09-03 Thread Therneau, Terry M., Ph.D. via R-help
1-.428)*coef. > Yes, the "mean" component is the reference level for predict and survfit.� If I could go back in time it would be labeled as "reference" instead of "mean".�� Another opportunity for me to make the documentation clearer. Good questions, � Terry T

Re: [R] coxph means not equal to means of model matrix

2021-09-03 Thread Therneau, Terry M., Ph.D. via R-help
fault survival curve would be for a sex of .453, say, was off-putting to many. Terry T. On 9/3/21 11:01 AM, Bond, Stephen wrote: > > Hi, > > Please, help me understand what is happening with the means of a Cox model? > > I have: > > R version 4.0.2 (2020-06-22) -- &qu

Re: [R] syvcoxph and cox.zph for testing the PH assumption

2021-07-12 Thread Therneau, Terry M., Ph.D. via R-help
an approximation. Terry T. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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] inverse of the methods function

2021-05-03 Thread Therneau, Terry M., Ph.D. via R-help
Is there a complement to the methods function, that will list all the defined methods for a class?    One solution is to look directly at the NAMESPACE file, for the package that defines it, and parse out the entries.   I was looking for something built-in, i.e., easier. -- Terry M

Re: [R] evil attributes

2021-04-11 Thread Therneau, Terry M., Ph.D. via R-help
.vector?" Nevertheless I understand Roger's confusion. -- Terry M Therneau, PhD Department of Quantitative Health Sciences Mayo Clinic thern...@mayo.edu "TERR-ree THUR-noh" [[alternative HTML version deleted]] __ R-help@r-pr

Re: [R] "exact" p-values

2021-03-20 Thread Therneau, Terry M., Ph.D. via R-help
.   Perhaps add a link in the  wilcox.test help page? Footnote: AUC is a special case of C but not vice versa.  People sometimes try to extend AUC to the other data types, but IMHO with only moderate success. -- Terry M Therneau, PhD Department of Health Science Research Mayo Clinic thern...@mayo

[R] temporary clipping

2020-10-26 Thread Therneau, Terry M., Ph.D. via R-help
way to turn off clip is with a new plot. -- Terry M Therneau, PhD Department of Health Science Research Mayo Clinic thern...@mayo.edu "TERR-ree THUR-noh" [[alternative HTML version deleted]] __ R-help@r-project.org ma

[R] [R-pkgs] survival3.1

2019-11-07 Thread Terry Therneau
don't break it". Part of the testing involved running the test suits of all 679 reverse dependencies under the new version. Terry Therneau thern...@mayo.edu [[alternative HTML version deleted]] ___ R-packages mailing list r-packa...@r-project

Re: [R] "chi-square" | "chi-squared" | "chi squared" | "chi, square"

2019-10-19 Thread Therneau, Terry M., Ph.D. via R-help
93 69 60 88 88 80 77 41 59 79 31 chi-squared: 72 76 82 83 89 79 69 67 77 78 69 77 83 88 87 89 78 chi:  92 73 89 87 chi-squares: 77 83 chi-bar-square: 91 There doesn't look to be a trend over time.  The 1922 Fisher reference uses the Greek symbol, by the way. Terry T [[alternative

Re: [R] conflicting results for a time-varying coefficient in a Cox model

2019-08-08 Thread Therneau, Terry M., Ph.D. via R-help
tx))) %*% coef(fit3)[4:7] + coef(fit3)[3] lines(sqrt(tx), ty3, col=2) The right tail is now better behaved.   Eliminating the points >900 makes things even better behaved. Terry T. On 8/8/19 9:07 AM, Ferenci Tamas wrote: > I was thinking of two possible ways to > plo

Re: [R] Trying to understand the magic of lm (Still trying)

2019-05-13 Thread Therneau, Terry M., Ph.D. via R-help
John,  The text below is cut out of a "how to write a package" course I gave at the R conference in Vanderbilt.   I need to find a home for the course notes, because it had a lot of tidbits that are not well explained in the R documentation. Terry T. Model frames: One of

[R] adding a hex sticker to a package

2019-01-21 Thread Therneau, Terry M., Ph.D. via R-help
I've created a hex sticker for survival.  How should that be added to the package directory?   It's temporarily in man/figures on the github page. Terry T. (Actually, the idea was from Ryan Lennon. I liked it, and we found someone with actual graphical skills to execute

Re: [R] weighed Fleming-Harrington log rank test

2018-02-16 Thread Therneau, Terry M., Ph.D.
. This might be only the second request for the feature in the 30+ years since that date. Terry Therneau [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman

Re: [R] Time-dependent coefficients in a Cox model with categorical variants

2018-01-18 Thread Therneau, Terry M., Ph.D.
nes in data0 and/or data1. Do you want to collapse that person into a single row before the glm fits? If subject "Jones" is represented by 15 lines in the data and "Smith" by 2, it does seem a bit unfair to give Jones 15 observations in the glm fit. But full discussion of this

[R] help matching rows of a data frame

2017-09-18 Thread Therneau, Terry M., Ph.D.
set will have < 100 elements. Since this is inside the survival package, and that package is on the 'recommended' list, I can't depend on any package outside the recommended list. Terry T. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE an

Re: [R] Odd results from rpart classification tree

2017-05-15 Thread Therneau, Terry M., Ph.D.
othing. The CART book (Brieman, Freidman, Olshen and Stone) on which rpart is based highlights the difference between odds-regression (for which the final prediction is a percent, and error is Gini) and classification. For the former treat y as continuous. Terry T. On 05/15/2017 05:

Re: [R] finegray function in the survival package

2017-05-03 Thread Therneau, Terry M., Ph.D.
since that would lead to an invalid time interval. Please look at the "Asking for help" section of https://www.r-project.org/help.html, and in particular the link on reproducable examples. You need to give an example, with data, that reproduces the problem. Terry T. (PS, I agree th

Re: [R] survival package can't find Ccoxfit6

2017-04-27 Thread Therneau, Terry M., Ph.D.
o the R/ directory, then R CMD build followed by R CMD INSTALL. Macintosh is essentially as easy, though you need to install Xcode for the compilers. The compile toolchain for windows is outside my ken. Let's keep talking. Terry T. __ R-h

Re: [R] survival package can't find Ccoxfit6

2017-04-27 Thread Therneau, Terry M., Ph.D.
t found" emails. Terry T. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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, min

Re: [R] survival package can't find Ccoxfit6

2017-04-26 Thread Therneau, Terry M., Ph.D.
and to the next dozen who will invariably contact me directly. Thanks, Terry Therneau Forwarded Message Subject: RE: survival package Date: Wed, 26 Apr 2017 18:05:30 + From: sesh...@mskcc.org To: Therneau, Terry M., Ph.D. <thern...@mayo.edu> Thank you for the

[R] finding out if a method exists

2017-03-28 Thread Therneau, Terry M., Ph.D.
s the kind of task for which someone, somewhere will have written routines. I just don't know who or where. Any hints? Terry T. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEA

Re: [R] R: How to prune using holdout data

2017-02-28 Thread Therneau, Terry M., Ph.D.
than the first? What if the single subject with ph.ecog=3 had ended up in the validation data set; how should we judge their prediction? This complexity is one reason that there is not a simple function for "validation" with a new data set. On 02/27/2017 09:48 AM, Alfredo wrote: T

Re: [R] How to prune using a validation set

2017-02-27 Thread Therneau, Terry M., Ph.D.
e best one, and then prune there. How do you define "best"? Terry Therneau On 02/26/2017 05:00 AM, r-help-requ...@r-project.org wrote: I'd like to use a different data ( validation) set for pruning my classification tree. Unfortunately there aren't arguments to get this in prune.rpart

[R] Can mice() handle crr()? Fine-Gray model

2017-01-23 Thread Therneau, Terry M., Ph.D.
on the new data. Caveat -- I don't know mice() well at all: the dat1 data set below has multiple observations per subject, should the mice() command be cognizant of this? Terry Therneau library(survival) library(mice) test1 <- data.frame (time=c(4,3,1,1,2,2,3,5,2,4,

[R] Hyperbola formula

2017-01-19 Thread Therneau, Terry M., Ph.D.
nflection point, and b[3] is the change in slope at the inflection point. The main downside is that k is arbitrary. I simply choose it to "look right", though it too could be part of an optimization. Terry Therneau __ R-help@r-proje

[R] Parallel package guidance needed

2017-01-16 Thread Therneau, Terry M., Ph.D.
and in the 20s for method 1 (detectCores() =80 on the box, we used mc.cores=50). Wall time for method 2 is looking to be several hours. Any pointers to documentation/discussion at this level would be much appreciated. I'm going to be fitting a lot of models. Terry T.

[R] which parallel routine

2017-01-07 Thread Therneau, Terry M., Ph.D.
s I've found addresses this particular question. Both direct answers and pointers to other docs would be welcome. Terry T. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://

Re: [R] independent censoring

2016-11-29 Thread Therneau, Terry M., Ph.D.
s on a regular schedule. Even then you will lose a few. (In one study several years ago, long term follow-up of cancer, there was a new Mrs Smith who refused to acknowledge the existence of the prior wife, even to forward letters.) Terry Therneau

[R] Updated package: survival_2.40-1

2016-11-01 Thread Therneau, Terry M., Ph.D.
it. As a consequence, the maintainer expects to get new emails that ``we have found a bug in your code: it gives a different answer than SAS''. (This is an actual quote.) Terry Therneau __ R-help@r-project.org mailing list -- To UNSUBSCRIB

[R] hello r

2016-10-29 Thread terry minton
Good afternoon r http://wsitest01.com/minerals.php?france=y18m1xba0w8z My best to you terry minton __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

Re: [R] isssues with predict.coxph, offset, type = "expected", and newdata

2016-10-01 Thread Therneau, Terry M., Ph.D.
r. A bit more background might make me more excited about extending the code to this case. Terry Therneau __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

Re: [R] finegray function in the survival package

2016-09-07 Thread Therneau, Terry M., Ph.D.
have given us no details of your example code that "doesn't work", and I can't read your mind. So no, we can't help. Give us a hint. Terry T __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/

Re: [R] Conditional gap time frailty cox model for recurrent events

2016-09-06 Thread Therneau, Terry M., Ph.D.
on the details of this. Terry Therneau -- On 09/06/2016 05:00 AM, r-help-requ...@r-project.org wrote: Dear Elisabetta, I have no direct answer to your question, but a suggestion: Use the 'coxme' function (in the package with the same name). In the help page

Re: [R] problem concernig Survsplit, package survival

2016-08-22 Thread Therneau, Terry M., Ph.D.
<- survSplit(Surv(obsT, status) ~ ., dfSurv, cut=seq(30, 90, by=30), id="ID", zero=0) I will fix this. I apologize for the error. Terry Therneau __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailm

[R] Johannes Hengelbrock <j.hengelbr...@uke.de>

2016-06-04 Thread Therneau, Terry M., Ph.D.
re to imagine a case where I would need it badly enough to wait a lifetime for the answer. The Efron approximation is pretty darn good for cases like this, and it is fast. Terry Therneau --- Dear users, I'm trying to estimate a conditional logist

[R] [R-pkgs] Survival 2.39

2016-04-21 Thread Therneau, Terry M., Ph.D.
the tmerge and survSplit functions, which are useful tools to build the requisite data sets, and to the "multi-state" vignette for model fits and plots. Terry Therneau ___ R-packages mailing list r-packa...@r-project.org https://stat.ethz.c

Re: [R] simple interactions

2016-04-15 Thread Therneau, Terry M., Ph.D.
I was right that there is an easy answer! Thanks for the 3 quick answers, all three correct and useful. Terry Therneau On 04/15/2016 07:15 AM, Thierry Onkelinx wrote: Dear Terry, Does fitting group + age:group instead of age*group solves your problem? Best regards, ir. Thierry Onkelinx

[R] simple interactions

2016-04-15 Thread Therneau, Terry M., Ph.D.
tion. Yes, I can reconstruct these from the original fit, but I have a lot of variables for several models and it would be easier to have an automatic form. I suspect that there is an easy answer, but I don't see it. Terry Therneau __ R-h

Re: [R] Using R for cURL commands,Message-ID:

2016-04-04 Thread Therneau, Terry M., Ph.D.
On 04/02/2016 05:00 AM, r-help-requ...@r-project.org wrote: Hello, I'm looking for a way in which R can make my live easier. Currently i'm using R convert data from a dataframe to json's and then sending these json's to a rest api using a curl command in the terminal (i'm on a mac). I've

Re: [R] Convergence issues when using ns splines (pkg: spline) in Cox model (coxph) even when changing coxph.control

2016-03-31 Thread Therneau, Terry M., Ph.D.
LET you put a phrase like "log(time)" into the model statement, so people end up doing the right thing, but by accident. Terry T. On 03/30/2016 05:28 PM, Göran Broström wrote: On 2016-03-30 23:06, David Winsemius wrote: On Mar 29, 2016, at 1:47 PM, Jennifer Wu, Miss <jennifer..

Re: [R] convergence issues with coxph

2016-03-30 Thread Therneau, Terry M., Ph.D.
covariates. Otherwise there is little we can do. Terry Therneau On 03/30/2016 05:00 AM, r-help-requ...@r-project.org wrote: I am having convergence issues when I use coxph with a interaction term (glarg*bca_py) and interaction term with the restricted cubic spline (glarg*bca_time_ns). I use survival

Re: [R] plotting spline term when frailty term is included

2016-03-02 Thread Therneau, Terry M., Ph.D.
) In your case I'd advise an end run: fit the model using ns() instead of pspline. I like smoothing splines better than regression splines, but the fact is that for most data sets they result in nearly identical answers. Terry T __ R-help@r-pro

Re: [R] Estimating Mean of a Poisson Distribution Based on interval censoring

2016-02-15 Thread Therneau, Terry M., Ph.D.
also curious to learn exactly what you mean by "interval censored poisson". Exponential with interval time to first event is equivalent to poisson, which is what I'd guess from "lognormal", but you may mean something else. Terry Therneau (author of survival) On 02/14/2

Re: [R] Survival::coxph (clogit), survConcordance vs. summary(fit) concordance

2016-01-21 Thread Therneau, Terry M., Ph.D.
it (not an unwarranted assumption), I'm not aware of any work on what an appropriate variance would be for the concordance in that case. 3. I need to think about the large variance issue. Terry Therneau On 01/20/2016 08:09 PM, r-help-requ...@r-project.org wrote: Hi, I'm running conditional logistic

Re: [R] clogit and weights

2015-12-22 Thread Therneau, Terry M., Ph.D.
nd and so has chosen not to make a guess. Also, please do not post in html. As you see below it leads to a mangled message. Terry Therneau On 12/22/2015 05:00 AM, r-help-requ...@r-project.org wrote: Merry Christmas everyone: I have the following data(mydat) and would like to fit a conditional

Re: [R] Survival analysis: ERROR: Time and status are different lengths

2015-12-04 Thread Therneau, Terry M., Ph.D.
es missing out of both the fit and the residuals. (Unfortunately, only a few modeling functions in R pay attention to the difference between these two na.action options.) Terry Therneau On 12/04/2015 05:00 AM, r-help-requ...@r-project.org wrote: Hi, I am fitting an AFT model assuming a Weibull

Re: [R] SWEAVE - a gentle introduction

2015-11-18 Thread Therneau, Terry M., Ph.D.
rning cost. I still use the latex form myself as it is not at all difficult to use --- once you learn it. Terry Therneau On 11/18/2015 05:00 AM, r-help-requ...@r-project.org wrote: I am looking for a gentle introduction to SWEAVE, and would appreciate recommendations. I have an R program that I w

Re: [R] Error survreg: Density function returned an an invalid matrix

2015-11-16 Thread Therneau, Terry M., Ph.D.
-infinity to +infinity. Or more precisely, for any value that the maximizer might guess at some point during the iteration. Terry T. On 11/14/2015 05:00 AM, r-help-requ...@r-project.org wrote: Thanks Terry but the error persists. See: >library(foreign)> library(survival)> library(VGAM) &

Re: [R] recursive partitioning in R

2015-11-12 Thread Therneau, Terry M., Ph.D.
ng of what observations are in what part(s) of the tree, sorting the data, tracking missing values, etc. If you ever do want to write your own code you are more than welcome to build off this --- I wouldn't want to write that part again. Terry Therneau On 11/12/2015 05:00 AM, r-help-requ...@r-project

Re: [R] Error survreg: Density function returned an an invalid matrix

2015-11-04 Thread Therneau, Terry M., Ph.D.
cale 1/a. But even if I am correct the discontinuity at b will cause the underlying Newton-Raphson method to fail. Terry Therneau __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE d

Re: [R] coxme adequacy check

2015-10-28 Thread Therneau, Terry M., Ph.D.
in advanced, Raoni No one has done the theory work to see if the method used by coxme extends to random effects models. I suspect that it does, but that is a long way from a proof. So at this point I don't have a good suggestion, even though I have been thinking about the problem. Terry Therneau

Re: [R] Fitting a curve to weibull distribution in R using nls

2015-10-14 Thread Therneau, Terry M., Ph.D.
(0, .15), xlab="Value", ylab="Density") points(1:24, y/sum(y)) - There are a half dozen ways to parameterize a Weibull distribution; the location-scale form used by survreg is one of the less common. See help(survreg) for more information -- look at the exam

Re: [R] rpart cutpoint interpretation

2015-10-08 Thread Therneau, Terry M., Ph.D.
The cutpoint is on the predictor, so the interpretation is the same as it is for any other rpart model. The subjects with predictor < cutpoint form one group and those > cutpoint the other. The cutpoint is chosen to give the greatest difference in "average y" between the groups. For poisson

[R] flatten a list

2015-09-29 Thread Therneau, Terry M., Ph.D.
15:17 (Preservation of the names is not important) Terry T __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and

Re: [R] XPT files

2015-09-28 Thread Therneau, Terry M., Ph.D.
document TS-140 talks about IBM 360 and Dec VAX machines but no others, which should give you an idea of its age. Terry Therneau On 09/27/2015 05:00 AM, r-help-requ...@r-project.org wrote: Peter Thanks for the explanation. One further comment ? you wrote: >I don't think the FDA "

Re: [R] retaining characters in a csv file

2015-09-23 Thread Therneau, Terry M., Ph.D.
text/csv" field coming from an http POST request. This is an internal service on an internal Mayo server and coded by our own IT department; this will not be the first case where I have found that their definition of "csv" is not quite standard. Terry T. On 23/09/15 10:00, T

Re: [R] Accounting for correlated random effects in coxme

2015-09-22 Thread Therneau, Terry M., Ph.D.
is not one that I had considered. You should transform it to dsCMatrix first, which is a symmetric class. Or if it is small enough, to a simple matrix. Terry T. On 09/22/2015 05:00 AM, r-help-requ...@r-project.org wrote: I have a problem with running the mixed effects Cox regression model using

[R] retaining characters in a csv file

2015-09-22 Thread Therneau, Terry M., Ph.D.
read.csv call but it is not so easy to replace it with something else. Terry T __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/

Re: [R] using survreg() in survival package with "long" data

2015-08-31 Thread Therneau, Terry M., Ph.D.
xph does left truncation but not left (or interval) censoring survreg does interval censoring but not left truncation (or time dependent covariates). Terry T __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailma

Re: [R] Survival analysis and predict time-to-death

2015-08-18 Thread Therneau, Terry M., Ph.D.
alive at time =10, say, is integral(S(t), from 10 to infin) / S(10), where S is the survival curve. You can also read off quantiles of the expected remaining life. Terry Therneau (author of the survival package) On 08/18/2015 05:00 AM, r-help-requ...@r-project.org wrote: Dear All, I would

Re: [R] Differences in output of lme() when introducing interactions

2015-07-23 Thread Therneau, Terry M., Ph.D.
practice. The 'equal weights' notion embedded in a fixed effects model + SAS type 3 is an isolated backwater. Terry T. PS. The Devils' Drug Development Dictionary at the same source has some gems. Three rather random choices: Bayesian - One who, vaguely expecting a horse and catching a glimpse

Re: [R] Differences in output of lme() when introducing interactions

2015-07-22 Thread Therneau, Terry M., Ph.D.
, in my opinion. 3. Should you ever use it? No. There is a very strong inverse correlation between understand what it really is and recommend its use. Stephen Senn has written very intellgently on the issues. Terry Therneau On 07/22/2015 05:00 AM, r-help-requ...@r-project.org wrote

[R] matrix manipulation

2015-07-16 Thread Therneau, Terry M., Ph.D.
not as dense as I think. Terry T. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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

Re: [R] matrix manipulation -solved

2015-07-16 Thread Therneau, Terry M., Ph.D.
Yes it is obvious --- once someone else pointed it out. Thanks for the hint. Terry T. On 07/16/2015 12:52 PM, Peter Langfelder wrote: Hi Terry, maybe I'm missing something, but why not define a matrix BB = V'B; then t(B) %*% V = t(BB), then your problem reduces to finding A such that t(BB

Re: [R] Variance estimates for survreg vs. lm

2015-07-06 Thread Therneau, Terry M., Ph.D.
for unbiased variance; I've never looked for it. I'm not convinced that it is worthwhile though. Terry Therneau On 07/04/2015 05:00 AM, r-help-requ...@r-project.org wrote: I would like help understanding why a survival regression with no censored data-points does not give the same variance estimates

[R] prmatrix and print.matrix

2015-06-25 Thread Therneau, Terry M., Ph.D.
. This (or something like it) is what I was looking for. Am I overlooking something? Terry Therneau __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http

Re: [R] Different behavior of model.matrix between R 3.2 and R3.1.1

2015-06-15 Thread Therneau, Terry M., Ph.D.
-- heresy!) would have been a much better design choice. But as long as I'm in R the coxph routine tries to be a good citizen. Terry T. __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Different behavior of model.matrix between R 3.2 and R3.1.1

2015-06-11 Thread Therneau, Terry M., Ph.D.
- terms2[-strat$terms] X - model.matrix(terms2, mf) X } tdata - data.frame(y= 1:10, zed = 1:10, grp = factor(c(1,1,1,2,2,2,1,1,3,3))) testfun(y ~ zed*grp, tdata) testfun(y ~ strata(grp)*zed, tdata) Terry T. - original message -- For building design matrices for Cox proportional

Re: [R] Unwanted unicode - solved

2015-06-04 Thread Therneau, Terry M., Ph.D.
so this saved me substantial time. Terry T. On 06/04/2015 03:00 PM, Marc Schwartz wrote: On Jun 4, 2015, at 12:56 PM, Therneau, Terry M., Ph.D. thern...@mayo.edu wrote: I'm checking the survival package and get the following error. How do I find the offending line? (There are a LOT

[R] Unwanted unicode

2015-06-04 Thread Therneau, Terry M., Ph.D.
I'm checking the survival package and get the following error. How do I find the offending line? (There are a LOT of files in the man directory.) Terry T. -- * checking PDF version of manual ... WARNING LaTeX errors when creating PDF version. This typically indicates Rd

Re: [R] Logistic regression R and Stata grouping variable

2015-05-27 Thread Therneau, Terry M., Ph.D.
but not the repeated measures one. Statisticially you can use a generalized estimating equations approach (package gee) or a random effect per subject approach (lme or lmer package). Terry T. On 05/27/2015 05:00 AM, r-help-requ...@r-project.org wrote: I mostly use Stata 13 for my regression analysis

Re: [R] Help with pedigree() function in kinship2

2015-05-13 Thread Therneau, Terry M., Ph.D.
or numeric. Terry Therneau On 05/13/2015 05:00 AM, r-help-requ...@r-project.org wrote: Dear R-help, I am interested in plotting some pedigrees and came across the kinship2 package. What follows is an example of the pedigrees I am working with Now, when running ## check package availability

Re: [R] Predict in glmnet for Cox family

2015-04-21 Thread Therneau, Terry M., Ph.D.
to the data and ask what is the predicted survival time for a low risk subject. The answer will at best be greater than 5 years. The program cannot say if it is 6 or 10 or even 1000. A bigger data set does not help. Terry Therneau __ R-help@r-project.org

Re: [R] Coxme penalized log-likelihood mismatch

2015-04-09 Thread Therneau, Terry M., Ph.D.
people would have been reading the results in a program (like you are), I didn't want to break their code so left the internal variable alone. It appears that I traded maybe safer for certain confusion. Terry Therneau On 04/09/2015 05:00 AM, r-help-requ...@r-project.org wrote: Hi,? I need

Re: [R] Error in thielsen

2015-03-06 Thread Therneau, Terry M., Ph.D.
that it will become obvious once I have an example. Terry Therneau On 03/06/2015 05:00 AM, r-help-requ...@r-project.org wrote: I don?t understand an error message from a thielsen function call within a dplyr do function call. by.CaseNo - group_by(as.data.frame(MAP.dt), CaseNo) MAP.thielsen

Re: [R] Sorting Surv objects

2015-02-13 Thread Therneau, Terry M., Ph.D.
it needs to deal with all of these. Professor Ripley has pointed out that the default action of sort() for right censored times, which I agree is reasonable. Terry Therneau (author of the survival package) On 02/13/2015 05:00 AM, r-help-requ...@r-project.org wrote: It seems that Surv objects

Re: [R] How to read this Rpart decision tree

2015-02-11 Thread Therneau, Terry M., Ph.D.
plotting oval so of course the plotted tree is easier to grasp. Terry T. On 02/11/2015 05:00 AM, r-help-requ...@r-project.org wrote: Hi all, In the attachment or this link (http://oi58.tinypic.com/35ic9qc.jpg) you'll find the decision tree I made. I used the Rpart package to make the tree

Re: [R] R example codes for direct standardization of rates

2015-01-07 Thread Therneau, Terry M., Ph.D.
/technical-reports http://www.mayo.edu/research/departments-divisions/department-health-sciences-research/division-biomedical-statistics-informatics/technical-reports Terry Therneau -- begin included message --- I am looking for R example codes to compute age-standardized death

Re: [R] half-logistic distribution

2014-12-29 Thread Therneau, Terry M., Ph.D.
families; I don't think that your distribution can be written in that way. Look at survival under the Task Views tab (upper left corner) of the cran.org web page -- someone else may have already done it. Terry T. __ R-help@r-project.org mailing

Re: [R] Cox model with multiple events - PH assumption

2014-12-23 Thread Therneau, Terry M., Ph.D.
using baseline values fails just because the covariates are out of date. So PH might hold for the updated (time-dependent) covariates and fail when using baseline values. This is a very study specific situation, however. Terry T. __ R-help@r

Re: [R] exclude missing co-variable data in cox model

2014-12-19 Thread Therneau, Terry M., Ph.D.
note implies that output was attached. Note that r-help strips away all attachments, so none of us saw it. Terry Therneau On 12/19/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hi all, I have a data set like this: Test.cox file: V1V2 V3Survival

Re: [R] How to pass a nested random effect with frailty in coxph()

2014-12-12 Thread Therneau, Terry M., Ph.D.
Use the coxme funtion (package coxme), which has the same syntax as lme4. The frailty() function in coxph only handles the simple case of a random intercept. Terry Therneau On 12/12/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hi, I have a very simple Cox regression model in which I

[R] CMD check error

2014-11-18 Thread Therneau, Terry M., Ph.D.
anyone? Terry Therneau = tmt% R CMD build dart * preparing 'dart': * checking DESCRIPTION meta-information ... OK * installing the package to build vignettes * creating vignettes ... OK * checking for LF line-endings in source and make files

Re: [R] CMD check error

2014-11-18 Thread Therneau, Terry M., Ph.D.
Terry T. On 11/18/2014 08:47 AM, Hadley Wickham wrote: Do you have a .Rbuildignore? If so, what's in it? Hadley On Tue, Nov 18, 2014 at 7:07 AM, Therneau, Terry M., Ph.D. thern...@mayo.edu wrote: I have a new package (local use only). R CMD check fails with a messge I haven't seen before

Re: [R] cluster + tt terms in coxph

2014-11-05 Thread Therneau, Terry M., Ph.D.
This is fixed in version 2.37-8 of the survival package, which has been in my send to CRAN real-soon-now queue for 6 months. Your note is a prod to get it done. I've been updating and adding vignettes. Terry Therneau On 11/05/2014 05:00 AM, r-help-requ...@r-project.org wrote: I am

[R] merge by time, certain value if 5 min before and after an event

2014-10-03 Thread Therneau, Terry M., Ph.D.
of their use to the time dependent covariates vignette. Terry Therneau On 10/03/2014 05:00 AM, r-help-requ...@r-project.org wrote: Hello! I hope someone can help me. It would save me days of work. Thanks in advance! I have two dataframes which look like these: myframe - data.frame (Timestamp=c

[R] c() and dates

2014-10-03 Thread Therneau, Terry M., Ph.D.
, mistaken, or otherwise deficient, only that my understanding is so. Could someone illuminate? Terry T. __ 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] c() and dates

2014-10-03 Thread Therneau, Terry M., Ph.D.
('b')). Terry T. On 10/03/2014 09:52 AM, peter dalgaard wrote: S3 only has single dispatch, so in one case it dispatches to c.Date and in the other to c.POSIXct, both of those return an object of the corresponding class. In both cases, the arguments pass through c(unlist(lapply(list

Re: [R] CoxME: Family relatedness

2014-09-15 Thread Therneau, Terry M., Ph.D.
useful for me to see. Continuous variables go to the left of the | and categoricals to the right of the |. Having a family id to the left makes no sense at all. Terry Therneau On 09/15/2014 03:20 PM, Marie Dogherty wrote: Dr. Therneau, I was wondering if you had a spare minute, if you

Re: [R] Linear relative rate / excess relative risk models

2014-08-28 Thread Therneau, Terry M., Ph.D.
On 07/30/2014 05:00 AM, r-help-requ...@r-project.org wrote: A while ago, I inquired about fitting excess relative risk models in R. This is a follow-up about what I ended up doing in case the question pops up again. While I was not successful in using standard tools, switching to Bayesian

Re: [R] plot for survreg and intcox (rewritten)

2014-08-27 Thread Therneau, Terry M., Ph.D.
tried running an example to see if the result is a hazard or a cumulative hazard but the run failed and it's time to run to a meeting. Assume it is cumulative hazard. Then exp(-fit$lambda0) will give the baseline survival curve. Terry T On 08/27/2014 02:47 PM, David Winsemius wrote: On Aug

Re: [R] Cox regression model for matched data with replacement

2014-08-13 Thread Therneau, Terry M., Ph.D.
that you want Dr Therneau to respond intelligently :-) Terry T. __ 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

Re: [R] Cox regression model for matched data with replacement

2014-08-13 Thread Therneau, Terry M., Ph.D.
and the xbar at each time is replaced with an appropriate weighted survey estimate. See various papers by Brian Langholz. Terry T On 08/13/2014 07:26 AM, John Pura wrote: Hi Dr. Therneau, The original question on the forum was: My problem was how to build a Cox model for the matched data (1

Re: [R] Cox regression model for matched data with replacement

2014-08-13 Thread Therneau, Terry M., Ph.D.
stratum only once. For any of the above you can add a robust variance. Required if case weights are used. Terry T __ 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

Re: [R] Survival Analysis with an Historical Control

2014-07-10 Thread Therneau, Terry M., Ph.D.
with 30 years ago (because I don't remember it exaclty): The incidence of the condition under consideration and its subsequent death rate will both drop by 1/2 at the commencement of a study, and will not return to their former values until the study finishes or the PI retires. Terry T

  1   2   3   4   5   6   >