Re: [R] randomForest out of bag prediction

2019-01-12 Thread Peter Langfelder
See inline. On Sat, Jan 12, 2019 at 9:56 AM Witold E Wolski wrote: > ypred_oob <- predict(diachp.rf) AFAIK these are, indeed, the out-of-bag predictions. > dataX <- data %>% select(-quality) # remove response. > ypred <- predict( diachp.rf, dataX ) These are not out of bag predictions. dataX

Re: [R] randomForest out of bag prediction

2019-01-12 Thread Bert Gunter
Off topic. But see here: https://stats.stackexchange.com/questions/61405/random-forest-and-prediction -- Bert 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 Sa

Re: [R] SURVDIFF()

2019-01-12 Thread Medic
Dear David, you are (as always) come to the rescue! With your wonderful pedagogical talent of explanation! Many thanks for the support! My warmest and sincere wishes for the new year! __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see h

[R] randomForest out of bag prediction

2019-01-12 Thread Witold E Wolski
Hello, I am just not sure what the predict.RandomForest function is doing... I confused. I would expect the predictions for these 2 function calls to predict the same: ```{r} diachp.rf <- randomForest(quality~.,data=data,ntree=50, importance=TRUE) ypred_oob <- predict(diachp.rf) dataX <- data %>

Re: [R] SURVDIFF()

2019-01-12 Thread David Winsemius
On 1/12/19 1:18 AM, Medic wrote: How to note (in code) a few (!) adjusting covariates for cox regression. I had an example for one covariate, and tried (according to my own understanding) two variantes of code (pls, see below), and got ... a different p-value. What is the right code? Many than

[R] Visreg package : Legend to large and 3 ways-interactions possible ?

2019-01-12 Thread varin sacha via R-help
Dear R-experts, The reproducible example is below. I am trying to use the visreg package for 2 ways-interactions and for 3 ways-interactions. For 2 ways-interactions, everything goes fine except that the legend on the top (2.HS Grad ; 3. Some College ; 4. College Grad) is not entire/complete, b

Re: [R] mgcv : 3-way interaction and 3D-plots ?

2019-01-12 Thread varin sacha via R-help
David, Richard, Many thanks for your responses. Le mardi 8 janvier 2019 à 04:25:19 UTC+1, Richard M. Heiberger a écrit : ## Here is an example using the 3-way interaction plot from the HH package install.packages("HH") ## if necessary ## The HH package supports the book ## Statistic

Re: [R] NA rows appeared in data.frame

2019-01-12 Thread Rui Barradas
Hello, You have to test for NA. Some (12) of the values of t1$Petal.Width are NA therefore t1$Petal.Width == 2.0 alone returns 12 NA values. t1[t1$Petal.Width == 2.0 & !is.na(t1$Petal.Width == 2.0), ] Or use which(t1$Petal.Width == 2.0). t1[which(t1$Petal.Width == 2.0), ] Hope this helps,

[R] NA rows appeared in data.frame

2019-01-12 Thread Ernest Han
Dear All, After replacing some values in a data.frame, NAs rows have appeared and cannot be removed. I have googled these issues and found that several people have encountered it. Solutions in stackoverflow seem to provide work-arounds but does not remove it from the data.frame. Therefore, I am tu

[R] SURVDIFF()

2019-01-12 Thread Medic
How to note (in code) a few (!) adjusting covariates for cox regression. I had an example for one covariate, and tried (according to my own understanding) two variantes of code (pls, see below), and got ... a different p-value. What is the right code? Many thanks!!! (1) survdiff (Surv(survt,statu