[R] Interpreting the result of a model with random effects

2022-06-11 Thread Frank S .
ents and p-values for the 5 baseline variables, so I assumed that it was due to the small number of levels (in fact, too few ). However, when computing anova(model.rand, model.fix), the output indicates a p-value < 0.001 in favour of the "model.rand". What's happ

[R] Installing dyplr on Linux requires a ton of chasing down dependencies

2019-10-14 Thread Adam Frank
I just got a new Linux computer running Pop!_OS. If I download R from the repository, which is basically he same as on Ubuntu, I get an outdated version that can't run ggplot2. So I went to the R download page and downloaded the newest version. It has make and config files but they require an in

[R] Axiom alike formula needs to get prooved

2019-10-05 Thread Frank Schwidom
all( df1 == df3) # it works, but how can I understand that and how it is proven? Regards Frank Schwidom __ 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:

[R] capscale/anova.cca issue

2019-09-26 Thread Frank Burbrink
using anova.cca with margins? I thank you very much in advance! Frank P.S. Here are some outputs from the reduced to the full axes model: Call: capscale(formula = gendist ~ scores(cur) + scores(ms) + scores(el) + scores(lgm) + scores(lig) + scores(mis19) + Condition(scores

Re: [R] Efficient way to update a survival model

2019-09-04 Thread Frank S .
Chris, thank you so much for your answer!! Best, Frank S. De: Andrews, Chris Enviado: martes, 3 de septiembre de 2019 14:14 Para: Frank S. Cc: r-help@r-project.org Asunto: Re: [R] Efficient way to update a survival model library("survival") set

Re: [R] Efficient way to update a survival model

2019-09-04 Thread Frank S .
Charles, thank you for your suggestion! Frank S. De: Berry, Charles Enviado: s�bado, 31 de agosto de 2019 19:21 Para: Frank S. Cc: Andrews, Chris ; r-help@r-project.org Asunto: Re: Efficient way to update a survival model The i^th model is included in the Cox

Re: [R] Efficient way to update a survival model

2019-08-30 Thread Frank S .
that, when computing Cox[[1]], the term Cox[[k -1]] does not exist. Is it possible to perform some "trick" (e.g. re-indexing) in order to achieve this? Best, Frank De: Andrews, Chris Enviado: viernes, 30 de agosto de 2019 15:08 Para: Frank S. ; Vito

Re: [R] Efficient way to update a survival model

2019-08-30 Thread Frank S .
date(Cox0, substitute(. ~ . + Z[, 1:k]), data = pbc) attr(Cox[[k]]$coefficients, "names")[2:(k+1)] <- paste0("sin(", 1:k, "* v)") } Cox Best, Frank De: Frank S. Enviado: jueves, 29 de agosto de 2019 12:38 Para: Vito Michele Rosa

Re: [R] Efficient way to update a survival model

2019-08-29 Thread Frank S .
hat OK? Additionally, in my original question I wondered about the possibility of reducing the 10 lines of code to one general expression or some loop. Is it possible? Best, Frank De: Vito Michele Rosario Muggeo Enviado: jueves, 29 de agosto de 2019 8:54 Para: Frank S.

[R] Efficient way to update a survival model

2019-08-28 Thread Frank S .
in 1:10) { Cox[[k + 1]] <- update(Cox[[k]], . ~ . + cos((k + 1) * v), data = pbc) } However, from Cox[[3]] onwards, the intermediate values of integer k are not included here (for instance, the model Cox[[10]] would only include the cosinus terms for cos(1*v) and cos(10*v)). Tha

Re: [R] Open a file which name contains a tilde

2019-06-14 Thread Frank Schwidom
s interested in it, can take a look: https://github.com/schwidom/simplefs Suggestions are welcome. Kind regards Frank Schwidom On 2019-06-12 12:50:12, John via R-help wrote: > On Wed, 5 Jun 2019 18:07:15 +0200 > Frank Schwidom wrote: > > In reading file names, names with spaces require

Re: [R] [Rd] Open a file which name contains a tilde

2019-06-11 Thread Frank Schwidom
it can handle long vectors of strings, booleans and also lists. Kind regards, Frank On 2019-06-11 09:49:17, Gabriel Becker wrote: >Hi Frank, >I'm hesitant to be "that guy", but in case no one else has brought this up >to you, having files with a tilde in th

Re: [R] [Rd] Open a file which name contains a tilde

2019-06-11 Thread Frank Schwidom
Hi, yes, I have seen this package and it has the same tilde expanding problem. Please excuse me I will cc this answer to r-help and r-devel to keep the discussion running. Kind regards, Frank Schwidom On 2019-06-11 09:12:36, Gábor Csárdi wrote: > Just in case, have you seen the fs pack

Re: [R] Open a file which name contains a tilde

2019-06-10 Thread Frank Schwidom
Hi, to get rid of any possible filename modification I started a little project to cover my usecase: https://github.com/schwidom/simplefs This is my first R package, suggestions and a review are welcome. Thanks in advance Frank Schwidom On 2019-06-07 09:04:06, Richard O'Keefe wrote: >

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Frank Schwidom
On 2019-06-05 20:32:07, Enrico Schumann wrote: > >>>>> "FS" == Frank Schwidom writes: > > FS> Hi, > FS> As I can see via path.expand a filename which contains a tilde > anywhere gets automatically crippled. > > FS> +> path

Re: [R] Open a file which name contains a tilde

2019-06-05 Thread Frank Schwidom
On 2019-06-05 20:32:07, Enrico Schumann wrote: > >>>>> "FS" == Frank Schwidom writes: > > FS> Hi, > FS> As I can see via path.expand a filename which contains a tilde > anywhere gets automatically crippled. > > FS> +> path

[R] Open a file which name contains a tilde

2019-06-05 Thread Frank Schwidom
ther its name contains any character unless 0. The unix filesystem allow the creation of such files, it sould be possible to open these. How can I switch off any file crippling activity? Kind regards, Frank __ R-help@r-project.org mailing list -- To

Re: [R] Regression Modeling Strategies and the R rms Package Short Course 2019

2019-03-24 Thread Harrell, Frank E
when explaining the results of complex statistical models. We also have discussions during the lunches in the dining hall next to the lecture room. Many of the topics I cover are set by the participants during the week. And all of the course handouts are freely available for everyone.

[R] Regression Modeling Strategies and the R rms Package Short Course 2019

2019-03-23 Thread Harrell, Frank E
*Regression Modeling Strategies Short Course 2019* Frank E. Harrell, Jr., Ph.D., Professor Department of Biostatistics, Vanderbilt University School of Medicine fharrell.com     @f2harrell *May 14-17, 2019* With Optional R Workshop May 13 9:00am - 4:00pm Alumni Hall Vanderbilt University

Re: [R] R-help Digest, Vol 193, Issue 16

2019-03-20 Thread Frank van Berkum
er_3.4.3 Matrix_1.2-16 tools_3.4.3 splines_3.4.3 [5] grid_3.4.3 lattice_0.20-38 Thank you for your help! Frank From: R-help on behalf of r-help-requ...@r-project.org Sent: Saturday, March 16, 2019 11:00 AM To: r-help@r-project.org Subject: R-help Di

[R] [mgcv] Memory issues with bam() on computer cluster

2019-03-20 Thread Frank van Berkum
er_3.4.3 Matrix_1.2-16 tools_3.4.3 splines_3.4.3 [5] grid_3.4.3 lattice_0.20-38 Thank you for your help! Frank From: R-help on behalf of r-help-requ...@r-project.org Sent: Saturday, March 16, 2019 11:00 AM To: r-help@r-project.org Subject: R-help Di

[R] [mgcv] Memory issues with bam() on computer cluster

2019-03-15 Thread Frank van Berkum
to where the problem may occur? Is it something within the C-code used within the package (as the last error seems to indicate), or is it related to the computer cluster? Any help or insights is much appreciated. Kind regards, Frank [[alternative HTML version deleted]] __

[R] [R-pkgs] Significant Update to Hmisc Package

2019-01-29 Thread Harrell, Frank E
on 4.1-1 (2018-01-03)) * describe: quit rounding values when = 20 distinct values no matter how far apart any two values are spaced.https ... ____ Frank E Harrell Jr Professor School of Medicine Department of Biostatistics Vand

[R] Regression Modeling Strategies and the rms Package 4-Day Short Course May 2018

2018-03-29 Thread Frank Harrell
*RMS Short Course 2018* Frank E. Harrell, Jr., Ph.D., Professor Department of Biostatistics, Vanderbilt University School of Medicine fharrell.com @f2harrell *May 15-18, 2018* With Optional R Workshop May 14 9:00am - 4:00pm Alumni Hall Vanderbilt University Nashville Tennessee USA See http

[R] run r script in r-fiddle

2017-10-29 Thread Frank Mei
Hi All, I want to know how to run an R file on my computer in R-Fiddle? I tried source("filename.r"), but not working. thanks, Frank [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

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

2017-09-14 Thread Frank Harrell
le in http://biostat.mc.vanderbilt.edu/tmp/bbr.pdf Use lrm, not lrm.fit for this. Adding maxit=20 will probably make it work on the small dataset but still not clear on why you are using this dataset. Frank -- Frank E Harrell Jr Professor School of Medicine Dep

Re: [R] rms::latex.anova broken?

2017-02-08 Thread Frank Harrell
ou can use options(prType='html') to get special html output for RMarkdown html reports and html notebooks. There are small changes in Hmisc, e.g., leave off file="" for latex(describe()). Frank -- Frank E Harrell Jr Professor and Ch

[R] [R-pkgs] Major Update to rms package: 5.0-0

2016-11-04 Thread Frank Harrell
wo group bariables because ggplot2 geom_ribbon doesn't support multiple aesthetics * predictrms: set contrasts for ordered factors to contr.treatment instead of contr.poly * val.prob: changed line of identity to use wide grayscale line instead of dashed line --

Re: [R] When customizing last line, the code stops working

2016-11-04 Thread Frank S.
do.call( what = rbind, args = lapply( X = paste0("dt_sp_", 1:length(sp)), FUN = get, envir = environment() ) ) ____ De: Frank S. Envi

[R] [R-pkgs] Massive Update to Hmisc package

2016-11-03 Thread Frank Harrell
ce of the statistic was appreciable; added option to compute posterior mean -- Frank E Harrell Jr Professor and Chairman School of Medicine Department of *Biostatistics* *Vanderbilt University* [[alternative HTML version deleted]] ___

[R] Confidence interval on quantile regression (quantreg)

2016-10-19 Thread Frank Black
now a reasonable explanation for this? Thanks. Kind regards, Frank [[alternative HTML version deleted]] __ 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] Using lapply in R data table

2016-09-27 Thread Frank S.
Many thanks Ista and Bert for your nice solutions! As Ista commented in a previous mail, the 0.87 value in my example is not fixed, but for each subject it depends on the difference "2007-01-01 - fini". However, both of your solutions take into account this fact.

[R] Using lapply in R data table

2016-09-26 Thread Frank S.
lt;- 1 # 1st case exposure[fini >= as.Date("2006-01-01") & fini <= as.Date("2006-06-30")] <- difftime(as.Date("2007-01-01"), fini, units="days")/365.25 # 2nd case exposure[fini >= as.Date("2006-07-01") & fini <= as.Dat

[R] Strange message after reading multiple scripts from one folder

2016-07-29 Thread Frank S.
should I change to avoid this message? Any help would be appreciated! Best, Frank [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat

Re: [R] Trouble getting rms::survplot(..., n.risk=TRUE) to behave properly

2016-06-02 Thread Frank Harrell
This happens when you have not strat variables in the model. -- Frank E Harrell Jr Professor and Chairman School of Medicine Department of *Biostatistics* *Vanderbilt University* On Thu, Jun 2, 2016 at 10:55 AM, Steve Lianoglou wrote: > Hello f

[R] vectors of equations in ode / desolve

2016-04-26 Thread Frank B.
y = c(1, 2,3), Predator = 2) times <- seq(0, 200, by = 1) out <- ode(yini, times, LVmod, pars) summary(out) Thanks Frank __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do re

Re: [R] Problem in adapting a script I have not written.

2016-02-18 Thread Frank Duschek
Hi Dalila, is your function a part of a packacke or is it self-written? If you have the code it would be helpful to provide it. Frank __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

[R] Recommendation for updating packages such as nlme

2016-02-16 Thread Frank Harrell
Should I not try to update recommended packages in /usr/local/lib/R/site-library on my Ubuntu system but specify /usr/lib/R/library instead? -- Frank E Harrell Jr Professor and Chairman School of Medicine Department of *B

Re: [R] Ordinal regression with some categories combined for some data

2016-01-17 Thread Frank Harrell
This does seem to be a good situation for ordinal regression. The R rms package's orm function allows for thousands of categories in Y. But it doesn't handle censoring. This discussion would be better for stats.stackexchange.

Re: [R] Overlapping subject-specific histograms

2016-01-14 Thread Frank S.
Many thanks Petr! Best, Frank > From: petr.pi...@precheza.cz > To: f_j_...@hotmail.com; r-help@r-project.org > Subject: RE: [R] Overlapping subject-specific histograms > Date: Thu, 14 Jan 2016 12:03:16 + > > Hi > > change > > points( factor(names(tab)

[R] Overlapping subject-specific histograms

2016-01-14 Thread Frank S.
"sim" variable. Thanks in advance for suggestions!! Frank data <- data.frame(id = rep(c(1,3,4,7), c(9,5,3,3)), count = c(0, 10, 15, 0, 16, 7, 14, 11, 12, 1, 8, 17, 19, 0, 9, 10, 14, 2, 3, 10), sims = c(1, 9, 15, 1, 14, 5, 12, 10, 12, 2, 6, 15, 18, 1,

[R] GLM: include observations with missing explanatory variables

2015-12-29 Thread Frank van Berkum
s have not succeeded. Any help on how to approach this is kindly appreciated. Kind regards, Frank van Berkum [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and

Re: [R] Random selection of a fixed number of values by interval

2015-12-15 Thread Frank S.
Many thanks to David L Carlson, Ben Gunter and David Winsemius for your quick and very elegant solutions!! With your list answers I am learning sa lot of things that will help me in the future to program. Best, Frank S. > Subject: Re: [R] Random selection of a fixed number of values

[R] Random selection of a fixed number of values by interval

2015-12-14 Thread Frank S.
LSE, breaks = 0:ceiling(max(data$value and the size vector: size <- c(10, 7, 5, 5, 3) But I'm not able to get it by using sample function. Does anyone have some idea? Thank you very much for any suggestions!! Frank S.

Re: [R] Correct notation for functions, packages when using LaTex

2015-12-11 Thread Frank Harrell
Rolf I believe \textsf is the correct font to use for the symbol R but not necessarily for the names of R variables and functions. I'd like more discussion about that. Frank -- Frank E Harrell Jr Professo

Re: [R] How to split 32 bits data into 16 bit or 8 bit data

2015-11-22 Thread Frank Wang
Thank you very much that substr works great on my data. For future users, I did in the following code. z<-matrix(c(substr(tmp,5,8),substr(tmp,1,4)),5,2) dataU16 <- c(t(z)) On Sun, Nov 22, 2015 at 8:38 AM, Duncan Murdoch wrote: > On 22/11/2015 2:04 AM, Frank Wang wrote: > >&

[R] How to split 32 bits data into 16 bit or 8 bit data

2015-11-22 Thread Frank Wang
Hi, I am new user on R. I want to split a vector of hex data such as "00ff8020" "02d0" "001e0240" "00010096" "00010033" into 16 bits such as: "00ff", "8020", "02d0","","001e", "024

Re: [R] R lappy, sapply or mapply question

2015-10-10 Thread Frank Schwidom
correction: On 2015-10-10 16:08:39, Frank Schwidom wrote: > On 2015-10-09 20:15:16, liqunhan--- via R-help wrote: > > > for (k in 1 : 5) { > >   xlist <- list(x5 = dailyrecord$a[k], x6 = dailyrecord$e[k], x7 = > > dailyrecord$f[k]) > >   result_forlo

Re: [R] R lappy, sapply or mapply question

2015-10-10 Thread Frank Schwidom
On 2015-10-09 20:15:16, liqunhan--- via R-help wrote: > for (k in 1 : 5) { >   xlist <- list(x5 = dailyrecord$a[k], x6 = dailyrecord$e[k], x7 = > dailyrecord$f[k]) >   result_forloop[k] <- fun3(list1, list2, xlist) > } result_forloop <- lapply( 1 : 5, function( k) { tmpRow <- dailyreco

Re: [R] Help with improveProb function in Hmisc in R

2015-10-02 Thread Frank Harrell
Please note that Kirsten is cross-posting to stats.stackexchange.com creating extra work for everyone. -- Frank E Harrell Jr Professor and Chairman School of Medicine Department of *Biostatistics

[R] [R-pkgs] Major updates to Hmisc and rms packages

2015-09-30 Thread Frank Harrell
the model and options(contrasts) is not set properly * rms transformation functions: made more robust by checking ! length instead of is.null -- ---- Frank E Harrell Jr Professor and Chairman School of Medicine

Re: [R] merging tables based on both row and column names

2015-09-28 Thread Frank Schwidom
test1 <- (rbind(c(0.1,0.2),0.3,0.1)) rownames(test1)=c('y1','y2','y3') colnames(test1) = c('x1','x2'); test2 <- (rbind(c(0.8,0.9,0.5),c(0.5,0.1,0.6))) rownames(test2) = c('y2','y5') colnames(test2) = c('x1','x3','x2') lTest12 <- list( test1, test2) namesRow <- unique( unlist( lapply( lTest12, ro

Re: [R] vector manipulations -- differences

2015-09-22 Thread Frank Schwidom
And if we want to use the approach of William Dunlap for sequence.optimization , then we can write: rev( xr[ seq_len(sum(vec)) - rep.int(cumsum(c(0L, vec[-length(vec)])), vec)] - rep.int( xr[ -1], vec)) Regards. On 2015-09-22 23:43:10, Frank Schwidom wrote: > Hi, > > xr <- rev( x

Re: [R] vector manipulations -- differences

2015-09-22 Thread Frank Schwidom
Hi, xr <- rev( x) vec <- 1:(length( x) - 1) rev( xr[ sequence( vec)] - rep.int( xr[ -1], vec)) On 2015-09-21 14:17:40, Dan D wrote: > I need an efficient way to build a new n x (n-1)/2 vector from an n-vector x > as: > > c(x[-1]-x[1], x[-(1:2)]-x[2], ... , x[-(1:(n-1)] - x[n-1]) > > x is incre

Re: [R] c(1:n, 1:(n-1), 1:(n-2), ... , 1)

2015-09-22 Thread Frank Schwidom
Hi I have to correct myself, this last solution is not universally valid here a better one: tmp1 <- ( 1 - outer( max( x):1, x, FUN='-')) tmp1[ tmp1 > 0] On 2015-09-17 21:06:30, Frank Schwidom wrote: > > how abount a more complicated one? > > outer( 1:5

Re: [R] Extract from data.frame

2015-09-21 Thread Frank Schwidom
better ( if year is an vector of more than 1 element): df[ df$Year %in% outer(as.numeric( as.character( year)), -1:1, FUN='+'), ] Year Amount 2 2002120 3 2003175 4 2004160 On Mon, Sep 21, 2015 at 10:49:34PM +0200, Frank Schwidom wrote: > > year <- df$Year[ w

Re: [R] Extract from data.frame

2015-09-21 Thread Frank Schwidom
year <- df$Year[ which.max( df$Amount)] df[ df$Year %in% (as.numeric( as.character( year)) + -1:1), ] Year Amount 2 2002120 3 2003175 4 2004160 On Mon, Sep 21, 2015 at 04:52:46PM +0200, Nico Gutierrez wrote: > Hi All, > > I need to do the following operation from data.frame: > >

Re: [R] Plot with R un html5

2015-09-19 Thread Frank Schwidom
Hi, when you can plot this graph using the rgl-package, then you can use "rgl::writeWebGL" to create an 3D-View in the Browser. Regards On Sat, Sep 19, 2015 at 04:42:47PM +0200, bgnumis bgnum wrote: > Hi al, > > I want to put a graph in a html5 webpage plotted with R (I want to get dar > from

Re: [R] c(1:n, 1:(n-1), 1:(n-2), ... , 1)

2015-09-17 Thread Frank Schwidom
how abount a more complicated one? outer( 1:5, 1:5, '-')[ outer( 1:5, 1:5, '>')] [1] 1 2 3 4 1 2 3 1 2 1 On Thu, Sep 17, 2015 at 11:52:27AM -0700, David Winsemius wrote: > You can add this to the list of options to be tested, although my bet would > be placed on `sequence(5:1)`: > > > Reduce

Re: [R] c(1:n, 1:(n-1), 1:(n-2), ... , 1)

2015-09-17 Thread Frank Schwidom
sequence( 5:1) Regards. On Thu, Sep 17, 2015 at 11:19:05AM -0700, Dan D wrote: > Can anyone think of a slick way to create an array that looks like c(1:n, > 1:(n-1), 1:(n-2), ... , 1)? > > The following works, but it's inefficient and a little hard to follow: > n<-5 > junk<-array(1:n,dim=c(n,n)

Re: [R] aggregate counting variable factors

2015-09-17 Thread Frank Schwidom
Hi where can i find 'melt' and 'dcast' ? Regards On Thu, Sep 17, 2015 at 08:22:10AM +, PIKAL Petr wrote: > Hi > > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Kai Mx > > Sent: Wednesday, September 16, 2015 10:43 PM > > To: r-help mailing

Re: [R] aggregate counting variable factors

2015-09-17 Thread Frank Schwidom
Hi res <- sapply( df1[ , -1], function( x) table(x)[as.character( 0:5)]) rownames( res) <- paste( sep='', 'result', 0:5) res[ is.na( res)] <- 0 res item1 item2 item3 item4 item5 result0 1 0 1 1 0 result1 1 2 0 0 0 result2 1 2 1 1

Re: [R] R WRONG CALCULATIONS - Please Help

2015-09-14 Thread Frank Schwidom
On Mon, Sep 14, 2015 at 04:11:57PM +0100, JORGE COLACO wrote: > > X-mean > [,1] [,2] [,3] [,4] [,5] [,6] > [1,] -0.8 -0.2 0.8 -1.2 0.8 -0.2 > [2,] -0.2 0.2 0.8 0.8 0.8 -1.2 > [3,] -1.2 -0.2 -0.8 0.8 -0.2 0.8 > [4,] 0.8 0.8 -1.2 -0.8 -0.2 -0.2 > [5,] -0.2 -0.2 0.8 0.8 -0.8 0.8 > >

Re: [R] Counting occurrences of a set of values

2015-09-10 Thread Frank Schwidom
df <- data.frame( V1= 1, V2= c( 2, 3, 2, 1), V3= c( 1, 2, 1, 1)) dfO <- df[ do.call( order, df), ] dfOD <- duplicated( dfO) dfODTrigger <- ! c( dfOD[-1], FALSE) dfOCounts <- diff( c( 0, which( dfODTrigger))) cbind( dfO[ dfODTrigger, ], dfOCounts) V1 V2 V3 dfOCounts 4 1 1 1 1 3 1 2

Re: [R] Help with vectors!

2015-09-09 Thread Frank Schwidom
Just for fun: > colSums( outer( VAS, VAS, '<')) [1] 3 3 0 3 7 8 8 0 3 0 On Sat, Sep 05, 2015 at 02:14:18PM -0700, Dan D wrote: > # your data > VAS<-c("Green","Green","Black","Green","White","Yellow","Yellow","Black","Green","Black") > > # declare the new vector > New_Vector<-numeric(length(V

Re: [R] Help with vectors!

2015-09-09 Thread Frank Schwidom
c( as.factor( VAS)) On Sat, Sep 05, 2015 at 02:14:18PM -0700, Dan D wrote: > # your data > VAS<-c("Green","Green","Black","Green","White","Yellow","Yellow","Black","Green","Black") > > # declare the new vector > New_Vector<-numeric(length(VAS)) > > # brute force: > New_Vector[VAS=="White"]<-1 >

Re: [R] extracting every nth character from a string...

2015-09-08 Thread Frank Schwidom
> rawToChar( charToRaw( str)[ c( TRUE, FALSE)]) [1] "ACEG" Regards On Sat, Sep 05, 2015 at 04:59:54PM -0400, Evan Cooch wrote: > Suppose I had the following string, which has length of integer multiple of > some value n. So, say n=2, and the example string has a length of (2x4) = 8 > characters

Re: [R] Help with vectors!

2015-09-08 Thread Frank Schwidom
# my last one: xtfrm( VAS) On Tue, Sep 08, 2015 at 11:55:51AM -0700, Dan D wrote: > Great! > > > > -- > View this message in context: > http://r.789695.n4.nabble.com/Help-with-vectors-tp4711801p4712023.html > Sent from the R help mailing list archive at Nabble.com. > > __

Re: [R] Help with vectors!

2015-09-08 Thread Frank Schwidom
On Sat, Sep 05, 2015 at 02:14:18PM -0700, Dan D wrote: > # your data > VAS<-c("Green","Green","Black","Green","White","Yellow","Yellow","Black","Green","Black") > > # declare the new vector > New_Vector<-numeric(length(VAS)) > > # brute force: > New_Vector[VAS=="White"]<-1 > New_Vector[VAS=="Yell

Re: [R] Nagelkerke Pseudo R-squared

2015-07-18 Thread Frank Harrell
It's implemented in the R rms package's lrm and orm functions. - Frank Harrell Department of Biostatistics, Vanderbilt University -- View this message in context: http://r.789695.n4.nabble.com/Nagelkerke-Pseudo-R-squared-tp4710014p4710031.html Sent from the R help mailing list

Re: [R] Sign of specific elements of a vector

2015-06-19 Thread Frank S.
Thank you for all your observations and comments!! As you suggest, the option x <- x*c(rep(1,19), -1) is a more elegant and a fast way! Frank S. > From: dwinsem...@comcast.net > Date: Thu, 18 Jun 2015 21:33:57 -0700 > To: marc_schwa...@me.com > CC: r-help@r-project.org &g

[R] Sign of specific elements of a vector

2015-06-18 Thread Frank S.
he desired result. II wonder wether there is a cool way to do so, that is, for example with apply or sign function. Thans in advanced for your help! Frank S. [[alternative HTML version deleted]] __

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

2015-06-15 Thread Frank Harrell
Thank you very much Terry. I'm still puzzled at why this worked a year ago. What changed? I'd very much like to reverse the change by setting an argument somewhere or manipulating the terms object. I echo your sentiments about the general approach. Frank On 06/15/2015 09:05 AM

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

2015-06-14 Thread Frank Harrell
should not be there (aa1:strat(b)b2). This does seem to be a change in R. Any help appreciated. Note that after subsetting out strat terms using Terms[ - temp$terms], Terms attributes factor and term.labels are: attr(,"factors") a a:strat(b) y0 0 a

[R] Different behavior of model.matrix between R 3.2 and R 3.1.1

2015-06-10 Thread Frank Harrell
herneau uses more complex logic to construct the design matrix reliably. I'd like to avoid that logic because it creates an overly wide design matrix before removing the unneeded columns. Thanks for any assistance, Frank --

Re: [R] Greek letters with subscript numbers on x-axis

2015-06-04 Thread Frank S.
Thank you very much Bill, Your answer to my question is exactly what I was trying to do in my R code. Best regards. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNS

[R] Greek letters with subscript numbers on x-axis

2015-06-03 Thread Frank S.
rse. Does anybody can help me? Thanks a bunch!! Frank S. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help

Re: [R] Problem merging data frames and duplicates

2015-05-27 Thread Frank Burbrink
Interesting solutions. Thanks guys! On Wed, May 27, 2015 at 9:27 AM, William Michels wrote: > Hi Frank! > > Ok, bind columns together in a state-wise fashion, allowing for state > duplicates. Below (maybe cheesy) uses the state abbreviations > "state.abb" in the datase

Re: [R] Problem merging data frames and duplicates

2015-05-27 Thread Frank Burbrink
. While this is clunky I can just write a function to do it all at once. On Wed, May 27, 2015 at 6:20 AM, Frank Burbrink wrote: > Thanks Bill, > > However, unique(merge(x, y, by = 1, all=T)) is giving me: > >state locus.x locus.y > 1 AR 5 2 > 2 AR

Re: [R] Problem merging data frames and duplicates

2015-05-27 Thread Frank Burbrink
1 9 LA 2 NA 10LA 2 NA 11MS 3 NA 12MS 4 NA 13TN NA 3 14TN NA 4 On Wed, May 27, 2015 at 3:53 AM, William Michels wrote: > Hi Frank, > > It looks like you're very close. I think you want: >

[R] Problem merging data frames and duplicates

2015-05-26 Thread Frank Burbrink
2 NA 10LA 2 NA 11MS 3 NA 12MS 4 NA 13TN NA 3 14TN NA 4 Any help would be much appreciated. Thanks! Frank -- * *Frank T. Burbrink, Ph.D.* *Professor* *Biology Department* *6S

[R] [R-pkgs] Version 3.16-0 of Hmisc now on CRAN

2015-05-04 Thread Frank Harrell
Group; similar for hoeffd -- ---- Frank E Harrell Jr Professor and Chairman School of Medicine Department of *Biostatistics* *Vanderbilt University* [[alternative HTML version deleted]] ___ R-packages mailing list r-pac

[R] Correction: Regression Modeling Strategies 4-Day Short Course March 2015

2015-01-21 Thread Frank Harrell
*RMS Short Course 2015* Frank E. Harrell, Jr., Ph.D., Professor and Chair Department of Biostatistics, Vanderbilt University School of Medicine *March 3, 4, 5 & 6, 2015* With Optional R Workshop March 2 9:00am - 4:00pm Student Life Center Board of Trust Room Vanderbilt University Nashv

[R] Regression Modeling Strategies 4-Day Short Course March 2015

2015-01-19 Thread Frank Harrell
Subject: Regression Modeling Strategies 4-Day Short Course March 2015 *RMS Short Course 2015* Frank E. Harrell, Jr., Ph.D., Professor and Chair Department of Biostatistics, Vanderbilt University School of Medicine *March 3, 4, 5 & 6, 2015* With Optional R Workshop March 2 9:00am - 4:00pm Stu

Re: [R] Obtain a list of data tables from a main data table

2014-10-08 Thread Frank S.
Hi, I think I got it! The clue: Function split! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide

[R] Obtain a list of data tables from a main data table

2014-10-08 Thread Frank S.
Hi everybody, I have (as an example) the following two data tables: all <- data.table(ID = c(rep(c(100:105),c(3,2,2,3,3,3))), value = c(100,120,110,90,45,35,270,50,65,40,25,55,75,30,95,70)) DT <- data.table(ID = 100:105, code=c(2,1,3,2,3,1)) My aim is to construct as many sub

Re: [R] Loop does not work: Error in else statement (II)

2014-10-02 Thread Frank S.
Jim, Thanks for the comment about else! [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www

Re: [R] Loop does not work: Error in else statement

2014-09-30 Thread Frank S.
Dear Berend and Petr, I do apologise for the disorderly code I posted. I have tried to solve it in a new mail. Frank S. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Loop does not work: Error in else statement (II)

2014-09-30 Thread Frank S.
Hi to all members of R list, I�m working with data.table package, and with 6 variables: ID: Subject identifier born: Birthdate start: Starting date register: date of measurement value: Value of measurement end: date of expiration of the measurements. So, the natural order of d

[R] Loop does not work: Error in else statement

2014-09-29 Thread Frank S.
Hi to all members of R list, I�m working with data.table package, and with 6 variables: "ID" (Identifier), "born" (Birthdate), "start" (Starting date), "register" (date of measurement), "value"and "end" (date of expiration). So, the natural order of dates would be: born =< start =< register =

Re: [R] Data frame which includes a non-existent date

2014-09-22 Thread Frank S.
Thanks Richard! [[alternative HTML version deleted]] __ 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-gu

[R] [R-pkgs] CRAN update: rms 4.2-1

2014-09-19 Thread Frank Harrell
classes created by survfit.formula * logLik.Gls: added. Makes AIC(Gls object) work. * NAMESPACE: several changes See http://biostat.mc.vanderbilt.edu/rms and https://github.com/harrelfe/rms for more information. Frank Harrell Vanderbilt University

[R] [R-pkgs] CRAN submission of Hmisc 3.14-5

2014-09-19 Thread Frank Harrell
handle Inf. Thanks: Benjamin Tyner * DESCRIPTION, NAMESPACE: multiple function changes to work in R-devel See http://biostat.mc.vanderbilt.edu/Hmisc, https://github.com/harrelfe/Hmisc for more information. Frank Harrell Vanderbilt University ___

[R] Data frame which includes a non-existent date

2014-09-18 Thread Frank S.
Hi to all members of the list, I have a data frame with subjects who can get into a certain study from 2010-01-01 onwards. Small example: DF <- data.frame(id=as.factor(1:3), born=as.Date(c("1939/10/28", "1946/02/23", "1948/02/29"))) id born 1 1 1939-10-28 2 2 1946-02-23 3 3 1948

Re: [R] Determine all specific same dates between two given dates

2014-07-28 Thread Frank S.
Many thanks for you help Uwe! [[alternative HTML version deleted]] __ 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/po

[R] Determine all specific same dates between two given dates

2014-07-26 Thread Frank S.
Hi everyone, After trying to find the solution during days, I decided to write in this help list in order to ask if anyone can help me.I would want to construct an R function, with "initial", "final" and "specific" dates as 3 arguments (for example, becauseI'm not really sure it is the best wa

Re: [R] Using subplot (from Hmisc) along with par(mfrow)

2014-07-06 Thread Frank Harrell
Greg I just re-copied the latest subplot and its help file from TeachingDemos to Hmisc for the next release. Thanks for pointing this out. Frank __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Predictions from "coxph" or "cph" objects

2014-07-06 Thread Frank Harrell
When using cph in the rms package there is a function Mean that operates on cph objects to produce an R function for computing the mean or restricted mean life time. Frank __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo

Re: [R] survplot invert number at risk labels

2014-07-02 Thread Frank Harrell
Please try hard to create a simple reproducible example, then I'll work on it. [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.

Re: [R] SAS VS R - What type of analysis is better?

2014-06-06 Thread Frank Harrell
s and transitioned to R around 2000) and have never looked back. Lately what has really made R powerful is its ability to interface with other languages and especially the way it works in a reproducible analysis/dynamic report document context. Frank -- Frank E Harrell Jr Professor and Cha

  1   2   3   4   5   6   7   8   9   10   >