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
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
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.
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
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
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]]
__
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
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
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
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
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
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 =
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
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
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
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
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
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.
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
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
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
do.call(
what = rbind,
args = lapply(
X = paste0("dt_sp_", 1:length(sp)),
FUN = get,
envir = environment()
)
)
________
De: Frank S.
Envi
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
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
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.
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
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
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
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
29 matches
Mail list logo