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

Re: [R] extract from a list of lists

2022-12-27 Thread Therneau, Terry M., Ph.D. via R-help
ly cross 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: >

[R] MCMC tools

2022-12-27 Thread Therneau, Terry M., Ph.D. via R-help
nce for individual ranks.   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] extract from a list of lists

2022-12-27 Thread Therneau, Terry M., Ph.D. via R-help
ips the 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" [

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 a

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
ey modified, used 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, min

[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
a result of as.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]] __

Re: [R] "exact" p-values

2021-03-20 Thread Therneau, Terry M., Ph.D. via R-help
is efficient for large n and is valid for ties.   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

[R] temporary clipping

2020-10-26 Thread Therneau, Terry M., Ph.D. via R-help
t the only 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.or

[R] [R-pkgs] survival3.1

2019-11-07 Thread Terry Therneau
quot;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...

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

2019-10-19 Thread Therneau, Terry M., Ph.D. via R-help
6 82 88 81 74 77 87 86 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. Te

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
a.frame(stime= sqrt(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 possi

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

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

2018-02-16 Thread Therneau, Terry M., Ph.D.
parameters. 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.

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

2018-01-18 Thread Therneau, Terry M., Ph.D.
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.
data 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

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.
error 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 agr

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

2017-04-27 Thread Therneau, Terry M., Ph.D.
add your routine to 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. ___

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

2017-04-27 Thread Therneau, Terry M., Ph.D.
means that I'm getting multiple "not 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/

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

2017-04-26 Thread Therneau, Terry M., Ph.D.
user 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. Thank you for the quick response. The se

Re: [R] finding out if a method exists

2017-03-28 Thread Therneau, Terry M., Ph.D.
Thanks much Duncan. Having someone do the work for me is even better than a function! The cmatrix function will be to make contrast matrices BTW. On 03/28/2017 08:11 AM, Duncan Murdoch wrote: On 28/03/2017 8:53 AM, Therneau, Terry M., Ph.D. wrote: I'm thinking of adding a new &qu

[R] finding out if a method exists

2017-03-28 Thread Therneau, Terry M., Ph.D.
. This is 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/

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

2017-02-28 Thread Therneau, Terry M., Ph.D.
tion worse 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

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

2017-02-27 Thread Therneau, Terry M., Ph.D.
t 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 p

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

2017-01-23 Thread Therneau, Terry M., Ph.D.
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

[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-project.org

[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.
orials 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, se

Re: [R] independent censoring

2016-11-29 Thread Therneau, Terry M., Ph.D.
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.
king 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 -

[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.
th a hammer. 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 th

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.e

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 hel

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

2016-06-04 Thread Therneau, Terry M., Ph.D.
the same time? Or even more 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 tryi

[R] [R-pkgs] Survival 2.39

2016-04-21 Thread Therneau, Terry M., Ph.D.
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.
blication. 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 __

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.
27;t 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 wrote:

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.
a good approach would be.) 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 _

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

2016-02-15 Thread Therneau, Terry M., Ph.D.
I am 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)

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

2016-01-21 Thread Therneau, Terry M., Ph.D.
27;t see 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'

Re: [R] clogit and weights

2015-12-22 Thread Therneau, Terry M., Ph.D.
ur mind 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 condit

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

2015-12-04 Thread Therneau, Terry M., Ph.D.
ng 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 di

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-pr

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

2015-11-04 Thread Therneau, Terry M., Ph.D.
scale 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 PL

Re: [R] coxme adequacy check

2015-10-28 Thread Therneau, Terry M., Ph.D.
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 The

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

2015-10-14 Thread Therneau, Terry M., Ph.D.
7;, ylim=c(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 a

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.htm

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.
the data is a "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.

[R] retaining characters in a csv file

2015-09-22 Thread Therneau, Terry M., Ph.D.
the 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

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

2015-09-22 Thread Therneau, Terry M., Ph.D.
ss 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 us

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

2015-08-31 Thread Therneau, Terry M., Ph.D.
y, which is a bit more work. So: coxph 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 a

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

2015-08-18 Thread Therneau, Terry M., Ph.D.
a subject still 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: Dea

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 expecti

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

2015-07-22 Thread Therneau, Terry M., Ph.D.
r explanation which is a false trail, 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

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

[R] matrix manipulation

2015-07-16 Thread Therneau, Terry M., Ph.D.
at the problem actually IS hard and I'm 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/post

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

2015-07-06 Thread Therneau, Terry M., Ph.D.
hammered out a correction 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 ce

[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.
; to TRUE. Dealing with this after the fact via a good contrast function (a la SAS -- 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 m

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

2015-06-11 Thread Therneau, Terry M., Ph.D.
strata") if (length(strat$terms)) terms2 <- 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

Re: [R] Unwanted unicode - solved

2015-06-04 Thread Therneau, Terry M., Ph.D.
here are 90 .Rd files 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. 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 indicat

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

2015-05-27 Thread Therneau, Terry M., Ph.D.
e case 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

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

2015-05-13 Thread Therneau, Terry M., Ph.D.
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 if

Re: [R] Predict in glmnet for Cox family

2015-04-21 Thread Therneau, Terry M., Ph.D.
lity (using the usual Kaplan-Meier). Fit a model 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.

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-pr

Re: [R] Error in thielsen

2015-03-06 Thread Therneau, Terry M., Ph.D.
a reasonable chance 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

Re: [R] Sorting Surv objects

2015-02-13 Thread Therneau, Terry M., Ph.D.
he package 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

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

2015-02-11 Thread Therneau, Terry M., Ph.D.
asier to fit into a little 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

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-standa

Re: [R] half-logistic distribution

2014-12-29 Thread Therneau, Terry M., Ph.D.
ted as location-scale 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. ___

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

2014-12-23 Thread Therneau, Terry M., Ph.D.
current covariate values, and a Cox model 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.

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

2014-12-19 Thread Therneau, Terry M., Ph.D.
ixed effects Cox model. 3. Your 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

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

Re: [R] CMD check error

2014-11-18 Thread Therneau, Terry M., Ph.D.
nks Hadley 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. wrote: I have a new package (local use only). R CMD check fails with a messge I haven't seen before

[R] CMD check error

2014-11-18 Thread Therneau, Terry M., Ph.D.
inux OS. Hints 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

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.o

Re: [R] c() and dates

2014-10-03 Thread Therneau, Terry M., Ph.D.
e, e.g., from c(as.Date("2000/10/1"), factor('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

[R] c() and dates

2014-10-03 Thread Therneau, Terry M., Ph.D.
d have expected c() to determine a common class, somehow, then do the conversion and concatonate. That is obviously not what happens. I've read the manual page but I must be missing something. I make no claim that R is broken, mistaken, or otherwise deficient, only that my understandin

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

2014-10-03 Thread Therneau, Terry M., Ph.D.
e out real-soon-now, once I add some extended examples 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

Re: [R] CoxME: Family relatedness

2014-09-15 Thread Therneau, Terry M., Ph.D.
d" on the part of the program. They cases of something I would never do, so never got that message. Therefore 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

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 mo

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

2014-08-27 Thread Therneau, Terry M., Ph.D.
a part of the result. I 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, D

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

2014-08-13 Thread Therneau, Terry M., Ph.D.
et twice, they don't need case weights since they are in any given 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/mail

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

2014-08-13 Thread Therneau, Terry M., Ph.D.
ow risk. Survey sampling principles come into play for selection 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:

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 com

  1   2   3   4   5   6   >