[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

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 .
Hello everybody, I come with a question which I do not know how to conduct in an efficient way. In order to provide a toy example, consider the dataset "pbc" from the package "survival". First, I fit the Cox model "Cox0": library("survival") set.seed(1) v <- runif(nrow(pbc), min = 0, max = 2) Co

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

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.
Dear list, I have one folder named "scripts_JMbayes", wich contains 10 R scripts. I can read them properly by doing: > pathnames <- list.files(pattern="[.]R", path="Mydir/scripts_JMbayes", > full.names = TRUE) > sapply(pathnames, USE.NAMES = FALSE, FUN = source,) However, R generates the fol

Re: [R] Overlapping subject-specific histograms

2016-01-14 Thread Frank S.
Cheers > Petr > > > > -----Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Frank > > S. > > Sent: Thursday, January 14, 2016 12:48 PM > > To: r-help@r-project.org > > Subject: [R] Overlapping subject-specific

[R] Overlapping subject-specific histograms

2016-01-14 Thread Frank S.
Dear R users, First of all, excuse me if my doubt is very trivial, but so far I haven't been able to solve it. My question is this: I have a data frame which contains repeated measurements on 4 subjects coded as "id", and I want to plot, for each subject, not only the corresponding "counts" va

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