[R] (no subject)

2019-09-05 Thread pusuluri madhu
Please unsubscribe me -- *Madhu Pusuluri, Ph D* *Visiting Scientist* *Genomics & Trait discovery- Genetic Gains* *International Crops Research Institute for the Semi-Arid Tropics (ICRISAT)* *Patancheru, Hyderabad, Telangana 502324, INDIA.* *E-mail: **m.pusul...@cgiar.org **; madhupusul...@gm

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Rui Barradas
Hello, Yesterday wasn't one of my days. The main problem I'm seeing is that the KS statistic is meant for continuous data and you have counts data assumed to follow a Poisson distribution. This might explain the nonsense results you are getting from ks.test. Have you considered a chi-squared

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Boo G .
Hello and thanks for your patience. As far as I understand, the paper of Marsiglia and colleagues refers to CDF samples (i.e. from a hypothetical distribution — e.g. a Poisson), while I have an ECDF sample (i.e. (pseudo-)observed data — e.g. rpois(1000, 500). In my study, I am actually comparin

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Rui Barradas
Hello, Inline. Às 20:09 de 05/09/19, Boo G. escreveu: Hello again. I have tied this before but I see two problems: 1) According to the documentation I could read (including the ks.test code), the ks statistic would be max(abs(x - y)) and if you plot this for very low sample sizes you can ac

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Boo G .
Hello again. I have tied this before but I see two problems: 1) According to the documentation I could read (including the ks.test code), the ks statistic would be max(abs(x - y)) and if you plot this for very low sample sizes you can actually see that this make sense. The results of ks.test(x

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Rui Barradas
Hello, I'm sorry, but apparently I missed the point of your problem. Please do not take my previous answer seriously. But you can use ks.test, just in a different way than what I wrote previously. Corrected code: #simulation for (i in 1:1000) { #sample from the reference distribution m_

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Boo G .
Thanks for your reply, Rui. I don’t think that I can use directly the ks.test because I have a weighted sample (see m_2 <-m_1[(sample(nrow(m_1), size=i, prob=p_1, replace=F)),]) and I want to account for that. That’s why I am trying to compute everything manually. Also, if you look at the r

Re: [R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Rui Barradas
Hello, I don't have the algorithms at hand but the KS statistic calculation is more complicated than your max/abs difference. Anyway, why not use ks.test? it's not that difficult: set.seed(1234) #reference distribution d_1 <- sort(rpois(1000, 500)) p_1 <- d_1/sum(d_1) m_1 <- data.frame(d_1,

[R] P-values Kolmogorov–Smirnov test

2019-09-05 Thread Boo G .
Hello, I am trying to perform a Kolmogorov–Smirnov test to assess the difference between a distribution and samples drawn proportionally to size of different sizes. I managed to compute the Kolmogorov–Smirnov distance but I am lost with the p-value. I have looked into the ks.test function unsuc

[R] Is this a way to perform cross validation?

2019-09-05 Thread Paul Bernal
Dear friends, Hope you are all doing great. If I am not mistaken, cross validation is about splitting the data into two parts: the training dataset and the test dataset. I have a dataset having the number of vehicles sold, from january 2008 up to june 2019. I decided to go for an 80-20 scheme (wh

Re: [R] creating a line plot for time series data for several years

2019-09-05 Thread Marna Wagley
Thank you, Rui. It helped me a lot. It is highly appreciated. thanks, On Thu, Sep 5, 2019 at 1:14 AM Rui Barradas wrote: > Hello, > > Thanks for the reproducible example. > All you have to do is to use the aesthetic group = year in either > ggplot() or geom_line(). > > This works: > > > library(

[R] Help Installing Rtools

2019-09-05 Thread Doran, Harold
I've done the following steps, but am unable to source in the Cpp files. Details of my session and sessionInfo are below. Am I missing a package, or a critical step? I found one answer regarding the 'make" error on stackoverflow suggesting the problem is resolved by grabbing the more recent vers

[R] Bug in "==" with empty data frames

2019-09-05 Thread Rainer M Krug
Hi The following code results in an error: ### > x <- data.frame(x = integer(0), y = integer(0)) > x == x Error in matrix(if (is.null(value)) logical() else value, nrow = nr, dimnames = list(rn, : length of 'dimnames' [2] not equal to array extent > ### I would expect that i

[R] mutate() error

2019-09-05 Thread Thierry Onkelinx via R-help
Dear all, I'm using this in a function inside a package. The code works fine when I run it directly. df %>% mutate(!!id_column := row_number()) When I run the function I get this error: Error in mutate(., `:=`(!!id_column, row_number())) : argument "mutate" is missing, with no default df is

Re: [R] [effects] allEffects does not accept integer value for xlevels

2019-09-05 Thread Gerrit Eichner
Dear John, thank you for the quick response and fix! Sorry, that I didn't detect the bug earlier, but everything had run smoothly sofar. ;-) (I am aware of predictorEffects. I have in fact switched to it recently. Excellent functionality; thx a lot for it! Actually, experimenting with its ...leve

Re: [R] Change Y-axis labels

2019-09-05 Thread Medic
For David Winsemius. As always, You help out! Immensely grateful! __ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.ht