similar to: help matching rows of a data frame

Displaying 20 results from an estimated 7000 matches similar to: "help matching rows of a data frame"

2017 Sep 18
0
help matching rows of a data frame
Hi Terry, I take your question to mean how to label distinct rows of a data frame. If that is not your question please clarify. I found the row.match() function in the package prodlim that can be used to solve this. However since your request requires no additional dependencies I borrowed the relevant code from the row.match function. Here is some obfuscated code to provide your answer in one
2017 Sep 18
0
help matching rows of a data frame
> On Sep 18, 2017, at 5:13 AM, Therneau, Terry M., Ph.D. <therneau at mayo.edu> wrote: > > This question likely has a 1 line answer, I'm just not seeing it. (2, 3, or 10 lines is fine too.) > > For a vector I can do group <- match(x, unqiue(x)) to get a vector that labels each element of x. > What is an equivalent if x is a data frame? > In the past I've
2012 May 16
1
Evaluation without using the parent frame
I've been tracking down a survival problem from R-help today. A short version of the primary issue is reconstructed by the following simple example: library(survival) attach(lung) fit <- coxph(Surv(time, status) ~ log(age)) predict(fit, newdata=data.frame(abe=45)) Note the typo in the last line of "abe" instead of "age". Instead of an error message, this returns
2010 Feb 19
1
BMDP and SAS (was R in clinical trials)
I used both BMDP and SAS in my earlier years, side by side. At that time the BMDP statistical methods were much more mature and comprehensive: we treated them as the standard when the two packages disagreed. (It was a BMDP manual that clearly explained to me what the hypothesis of "Yate's weighted mean test" is, something SAS decided to call "type III" and eternally
2006 Sep 05
3
terms.inner
Question: I am trying to impliment a function in R that we use quite regularly in Splus, and it fails due to a lack of the "terms.inner" function in R. The substitute is? Part question and part soapbox: Why remove terms.inner from R? It's little used, but rather innocuous. Mostly soapbox: I figured it was no big deal, as I originally discovered the use of terms.inner from
2020 Sep 25
1
Extra "Note" in CRAN submission
When I run R CMD check on the survival package I invariably get a note: ... * checking for file ?survival/DESCRIPTION? ... OK * this is package ?survival? version ?3.2-6? * checking CRAN incoming feasibility ... NOTE Maintainer: ?Terry M Therneau <therneau.terry at mayo.edu>? ... This is sufficient for the auto-check process to return the following failure message: Dear maintainer,
2016 Apr 15
4
simple interactions
I'd like to get interaction terms in a model to be in another form. Namely, suppose I had variables age and group, the latter a factor with levels A, B, C, with age * group in the model. What I would like are the variables "age:group=A", "age:group=B" and "age:group=C" (and group itself of course). The coefficients of the model will then be the age effect
2006 May 12
2
reusing routines
I've created some Splus code for a microarray problem that - needed to be in C, to take advantage of some sparse matrix properties - uses a cholesky decompostion as part of the computation For the cholesky, I used the cholesky2 routine, which is a part of the survival library. It does just what I want and I'm familiar with it (after all, I wrote it). In Splus, this all works
2013 Oct 16
2
How to obtain restricted estimates from coxph()?
Hello, I'm trying to use coxph() function to fit a very simple Cox proportional hazards regression model (only one covariate) but the parameter space is restricted to an open set (0, 1). Can I still obtain a valid estimate by using coxph function in this scenario? If yes, how? Any suggestion would be greatly appreciated. Thanks!!! [[alternative HTML version deleted]]
2008 Aug 05
4
literate programming
I'm working on the next iteration of coxme. (Rather slowly during the summer). This is the most subtle code I've done in S, both mathematically and technically, and seems a perfect vehicle for the "literate programming" paradym of Knuth. The Sweave project is pointed at S output however, not source code. I would appreciate any pointers to an noweb type client that was
2015 Mar 02
5
Import data set from another package?
I've moved nlme from Depends to Imports in my coxme package. However, a few of the examples for lmekin use one of the data sets from nlme. This is on purpose, to show how the results are the same and how they differ. If I use data(nlme::ergoStool) the data is not found, data(nlme:::ergoStool) does no better. If I add importFrom(nlme, "ergoStool") the error message is that
2017 Feb 09
2
R CMD check error
Martin, I am aware of --vanilla; I use it myself for some testing. In this case R_LIBS_USER was set externally (part of my login) and does not involve any of the R scripts. That means it is inherited by any subprocess. For example: tmt1495% R --vanilla --no-environ R version 3.3.1 (2016-06-21) -- "Bug in Your Hair" Copyright (C) 2016 The R Foundation for Statistical Computing
2017 Dec 29
3
winbuilder warning message wrt function pointers
I've recently updated the coxme package, which calls internal routines from the bdsmatrix package.? (It is in fact mentioned as an example of this in the Extensions manual.) The call connections are a blocks like this, one for each of the 9 called C routines. void bdsmatrix_prod4(int nrow,??? int nblock,?? int *bsize, ??????????????????? double *bmat, double *rmat, ??????????????????? int
2013 Jun 12
2
survreg with measurement uncertainties
Hello, I have some measurements that I am trying to fit a model to. I also have uncertainties for these measurements. Some of the measurements are not well detected, so I'd like to use a limit instead of the actual measurement. (I am always dealing with upper limits, i.e. left censored data.) I have successfully run survreg using the combination of well detected measurements and limits,
2008 Apr 25
3
Use of survreg.distributions
Dear R-user: I am using survreg(Surv()) for fitting a Tobit model of left-censored longitudinal data. For logarithmic transformation of y data, I am trying use survreg.distributions in the following way: tfit=survreg(Surv(y, y>=-5, type="left")~x + cluster(id), dist="gaussian", data=y.data, scale=0, weights=w) my.gaussian<-survreg.distributions$gaussian
2016 Apr 15
0
simple interactions
Dear Terry, Does fitting group + age:group instead of age*group solves your problem? Best regards, ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest team Biometrie & Kwaliteitszorg / team Biometrics & Quality Assurance Kliniekstraat 25 1070 Anderlecht Belgium To call in the statistician after the experiment is done may be no more
2011 Apr 13
3
Problem with dyn.load in R 2.13.0
I have a test directory for the survival suite, and dyn.load has ceased to work in it. Below shows the log: tmt1075% R --vanilla R version 2.12.2 (2011-02-25) Copyright (C) 2011 The R Foundation for Statistical Computing ISBN 3-900051-07-0 Platform: x86_64-unknown-linux-gnu (64-bit) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain
2007 Nov 16
4
alternative to logistic regression
You can fit a linear probability model with glm and a bit of arm twisting. First, make your own copy of the binomial function: > dump('binomial', file='mybinom.R') Edit it to change the function name to "mybinom" (or anything else you like), and to add 'identity' to the list of okLinks. Source the file back in, and use mybiom('identity') to fit
2019 Sep 06
2
install_github and survival
I cloned therneau/survival and the installation failed since there is no definition for exported function survfit(). A file seems to be missing - there is survfit0() and survfit0.R but, compared to CRAN, no survfit.R. Georgi Boshnakov ---------------------------------------------------------------------- Message: 1 Date: Thu, 05 Sep 2019 12:53:11 -0500 From: "Therneau, Terry M.,
2014 Jan 22
2
Package checking: verifying plots
I pride myself on having an extensive and comprehensive test suite for the survival package. However, I don't have a good procedure for testing the plotting routines. (Forget "good", I don't even have a third-rate procedure for this.) This was brought home with the latest release; within 24 hours I got a note about a problem. They y-axis range for a plot was calculated