search for: gender2

Displaying 4 results from an estimated 4 matches for "gender2".

Did you mean: gender
2013 Nov 20
4
How to stop Kaplan-Meier curve at a time point
...an-Meier curve at my desired time (2190days)or roughly 6 years. However, my question is I want to find the significance (log rank test) at this time point between the two curves; because I am not able to find a way to stop the survfit at this time point with my knowledge. Below is the code I used. Gender2<-survfit(Surv(Survival_days, Outcome)~Gender) plot (Gender2, xmax=2190, mark.time=FALSE, col=c(1:2), xlab="Survival time (Days)", ylab="Survival probability", main="Gender") # mark.time=FALSE will remove the censoring lines in the graph. If censoring lines are need...
2020 Oct 14
2
which() vs. just logical selection in df
...hank you for your reply! I hadn't heard of the {microbenchmark} package & was excited to try it! Thank you for the suggestion! I did check the reference source for which() beforehand, which included the statement to remove NAa, and I didn't have any missing values or NAs: sum(is.na(dat$gender2)) sum(is.na(dat$gender)) sum(is.na(dat$y)) [1] 0 [1] 0 [1] 0 I still had a 10ms difference in the value returned by microbenchmark between the following methods: one with and one without using which(). The difference is reversed from what I expected, since which() is an extra step. microbenchmar...
2020 Oct 10
1
which() vs. just logical selection in df
...ile; 'nrows' is a slight # overestimate dat <- dat[,1:3] # select just the first 3 columns head(dat, 10) # print the first 10 rows # Select using which() as the final step ~ 90ms total time on my macbook air system.time( head( dat[which(dat$gender2=="other"),],), gcFirst=TRUE) # Select skipping which() ~130ms total time system.time( head( dat[dat$gender2=="other", ]), gcFirst=TRUE) Now I would think that the second one without which() would be more efficient. However, every time I run these, the first version,...
2020 Oct 14
0
which() vs. just logical selection in df
Inline. Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Wed, Oct 14, 2020 at 3:23 PM 1/k^c <kchamberln at gmail.com> wrote: Is which() invoking c-level code by chance, making it slightly faster > on average? > You do not need