Thanks, Dénes. Good points.
Bert
On Mon, Jul 29, 2019 at 4:33 PM Dénes Tóth wrote:
>
> Hi Bert,
>
> see inline.
>
> On 7/30/19 1:12 AM, Bert Gunter wrote:
> > While Eric's solution is correct( mod "corner" cases like all NA's in
> > a row), it can be made considerably more efficient.
> >
> > On
Hi Bert,
see inline.
On 7/30/19 1:12 AM, Bert Gunter wrote:
While Eric's solution is correct( mod "corner" cases like all NA's in
a row), it can be made considerably more efficient.
One minor improvement can be made by using the idiom
any(x == "A")
instead of matching via %in% for the simple c
While Eric's solution is correct( mod "corner" cases like all NA's in
a row), it can be made considerably more efficient.
One minor improvement can be made by using the idiom
any(x == "A")
instead of matching via %in% for the simple case of matching just a
single value.
However, a considerable im
Read the help for apply and %in%
?apply
?%in%
Sent from my iPhone
> On 29 Jul 2019, at 22:23, Ana Marija wrote:
>
> Thank you so much! Just to confirm here MARGIN=1 indicates that "A" should
> appear at least once per row?
>
>> On Mon, Jul 29, 2019 at 1:53 PM Eric Berger wrote:
>> df$case
Thank you so much! Just to confirm here MARGIN=1 indicates that "A" should
appear at least once per row?
On Mon, Jul 29, 2019 at 1:53 PM Eric Berger wrote:
> df$case <- apply(df,MARGIN = 1,function(v) { as.integer("A" %in% v) })
>
>
> On Mon, Jul 29, 2019 at 9:02 PM Ana Marija
> wrote:
>
>> sor
df$case <- apply(df,MARGIN = 1,function(v) { as.integer("A" %in% v) })
On Mon, Jul 29, 2019 at 9:02 PM Ana Marija
wrote:
> sorry my bad, here is the edited version:
>
> so the data frame is this:
>
> df=data.frame(
> eye_problemsdisorders_f6148_0_1=c("A","C","D",NA,"D","A","C",NA,"B","A"),
>
sorry my bad, here is the edited version:
so the data frame is this:
df=data.frame(
eye_problemsdisorders_f6148_0_1=c("A","C","D",NA,"D","A","C",NA,"B","A"),
eye_problemsdisorders_f6148_0_2=c("B","C",NA,"A","C","B",NA,NA,"A","D"),
eye_problemsdisorders_f6148_0_3=c("C","A","D","D","B","A",NA
You may have a typo/misstatement in your question.
You define a data frame with 5 columns, each of which has 10 elements, so
your data frame has dimensions 10 x 5.
Then you request a new COLUMN which will have only 5 elements, which is not
allowed. All columns of a data frame
must have the same len
I have data frame which looks like this:
df=data.frame(
eye_problemsdisorders_f6148_0_1=c(A,C,D,NA,D,A,C,NA,B,A),
eye_problemsdisorders_f6148_0_2=c(B,C,NA,A,C,B,NA,NA,A,D),
eye_problemsdisorders_f6148_0_3=c(C,A,D,D,B,A,NA,NA,A,B),
eye_problemsdisorders_f6148_0_4=c(D,D,NA,B,A,C,NA,C,A,B),
2 events in the short simulation I tried (except when the effect was very
strong and I got convergence warnings).
Chris
library("flexsurv")
set.seed(20190729)
# Multiple non-competing outcomes, connected only by frailty (unmeasured
covariate)
nn <- 1000
kk <- 2
# frailty
Hi Tolulope,
Get the Monte Carlo package:
https://cran.r-project.org/web/packages/MonteCarlo/vignettes/MonteCarlo-Vignette.html
and look at an online tutorial:
https://www.youtube.com/watch?v=T_igE6bb6hU
Jim
On Mon, Jul 29, 2019 at 5:29 PM Tolulope Adeagbo
wrote:
>
> Hello Everyone,
>
> Pleas
Hello,
Inline.
Às 08:28 de 29/07/19, Tolulope Adeagbo escreveu:
Hello Everyone,
Please can anyone educate me on monte carlo simulation in R.
Actually, no, we cannot. R-Help is for R code issues, not to teach
statistics. I must have a *specific* R code problem to ask.
I suggest you first l
Hello Everyone,
Please can anyone educate me on monte carlo simulation in R.
Thank you
[[alternative HTML version deleted]]
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEAS
13 matches
Mail list logo