Re: [R] 2 sample wilcox.test != kruskal.test

2012-01-11 Thread Łukasz Ręcławowicz
2012/1/11 syrvn > Hi, > > thanks for your answer. Unfortunately I cannot reproduce your results. > > In my example the results still differ when I use your approach: > > > x <- c(10,11,15,8,16,12,20) > > y <- c(10,14,18,25,28,30,35) > > f <- as.factor(c(rep("a",7), rep("b",7))) > > d <- c(x,y) >

Re: [R] 2 sample wilcox.test != kruskal.test

2012-01-10 Thread Łukasz Ręcławowicz
2012/1/10 syrvn > And why does kruskal.test(x~y) differ from kruskal.test(f~d)?? > Your formula is wrong, but function doesn't see errors. "formula a formula of the form lhs ~ rhs where lhs gives the data values and rhs the corresponding groups." And that leads to kruskal.test(d~as.factor(f)) wh

Re: [R] Can R handle a matrix with 8 billion entries?

2011-08-11 Thread Łukasz Ręcławowicz
W dniu 12 sierpnia 2011 05:19 u¿ytkownik Chris Howden < ch...@trickysolutions.com.au> napisa³: > Thanks for the suggestion, I'll look into it > It seems to work! :) library(multiv) data(iris) iris <- as.matrix(iris[,1:4]) h <- hierclust(iris, method=2) d<- dist(iris) hk<-hclust(d) >str(hk) List

Re: [R] Can R handle a matrix with 8 billion entries?

2011-08-11 Thread Łukasz Ręcławowicz
2011/8/11 Chris Howden > In that my distance matrix has too many entries for R's architecture to > know how to store in > memory > There was an multiv package with hierclust function and a bign option. "Is n big? If storage is problemsome, a different implementation of the Ward criterion may be

Re: [R] In ppls package kernel method is unsupported?

2011-03-22 Thread Łukasz Ręcławowicz
W dniu 22 marca 2011 10:27 u¿ytkownik £ukasz Rêc³awowicz < lukasz.reclawow...@gmail.com> napisa³: > > penalized.pls.kernel(Z,y,M=lambda*P,ncomp=number.comp) # But using > directly, coefficients are different. > I see me error P=!M, but still results are the same... p <- ncol(Z) Minv <- diag(p)

[R] In ppls package kernel method is unsupported?

2011-03-22 Thread Łukasz Ręcławowicz
require(ppls) data(BOD) X<-BOD[,1] y<-BOD[,2] Xtest=seq(min(X),max(X),length=200) dummy<-X2s(X,Xtest,deg=3,nknot=20) Z<-dummy$Z Ztest<-dummy$Ztest size<-dummy$sizeZ P<-Penalty.matrix(size,order=2) lambda<-200 number.comp<-3 penalized.pls(Z,y,P=lambda*P,ncomp=number.comp)$coefficients # By default

Re: [R] Is there an exact binomial k-sample test of equivalence?

2011-03-12 Thread Łukasz Ręcławowicz
2011/3/11 Albyn Jones > but presumably what you really want would be based on a joint confidence > region for all the proportions. > I've had read "On Exact Methods for Testing Equality of Binomial Proportions" by Akihito Matsuo, but still, this concept is for me unclear and I got lost... We h

[R] Is there an exact binomial k-sample test of equivalence?

2011-03-10 Thread Łukasz Ręcławowicz
Hi, I've got one silly question for evening. I don't know is this reasonable, but can test with two the most extreme proportions from the samples could be good enough evidence for testing equivalence, or should I have to look for something else...? -- Mi³ego dnia [[alternative HTML vers

Re: [R] exact logistic regression

2011-02-17 Thread Łukasz Ręcławowicz
I believe that this code will work (...for very small) samples, but let some correct me if there is something wrong. require(logistf);require(combinat) permY<-permn(data$y) ntimes<-length(permY) results<-matrix(nrows=ntimes,ncols=number_of_coefficients) for(i in 1:ntimes){ results[i,]<-logistf(unl

Re: [R] exact logistic regression

2011-02-04 Thread Łukasz Ręcławowicz
data2elrm<-cbind(mydata,n=rep(1,dim(mydata)[1])) > More logic would be: data2elrm2<-cbind(mydata,n=rep(1,nrow(mydata))) Sorry for obfuscation. -- Mi³ego dnia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://

Re: [R] exact logistic regression

2011-02-04 Thread Łukasz Ręcławowicz
2011/2/4 Den > To use elrm() I have to aggregate my data,which is really time consuming > when I look for the way out through many variables. You don't have to do that. *One exception is that the binomial response should be specified as success/trials, where success gives the number of successes

Re: [R] exact logistic regression

2011-02-03 Thread Łukasz Ręcławowicz
2011/2/3 Den > > Thank you again > It is funny how stupid I was Elrm, clogit {survival} or exactLoglinTest are only "exact-like", the truth is, R don't have it... and glm is poor. http://sas-and-r.blogspot.com/2010/12/example-818-monte-carlo-experiment.html http://sas-and-r.blogspot.com/2010/1

Re: [R] help

2011-02-02 Thread Łukasz Ręcławowicz
W dniu 2 lutego 2011 16:35 u¿ytkownik Wacek Kusnierczyk napisa³: > On 2/2/11 3:59 AM, £ukasz Rêc³awowicz wrote: > >> We don't need a loop! >> >> require(Rmpfr) >> factorial(mpfr(1:500,3800)) >> > > This is very good! But it has just a few functions... > I get an unexpected warning, though: > >

Re: [R] help

2011-02-02 Thread Łukasz Ręcławowicz
We don't need a loop! require(Rmpfr) factorial(mpfr(1:500,3800)) 2011/2/2 Waclaw Kusnierczyk > > library(bc) > factorial = function(n) bc(sprintf(' >define factorial(n) { >if (n < 2) return (1) >f = 2 >i = 2 >while (i < n) f *= ++i >return (f) } >

Re: [R] Problem with lme4 package

2010-12-15 Thread Łukasz Ręcławowicz
2010/12/15 suchy > /usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: > cannot find -lgfortran > collect2: ld returned 1 exit status > Similar situation I have for other packages. > > Could You help me? > > Did you install gfortran first? -- Mi³ego dnia [[alte

Re: [R] weighted Spearman correlation coefficient

2010-11-29 Thread Łukasz Ręcławowicz
2010/11/29 Daniel Rabczenko > I would be grateful if anybody can help me in finding an R function to > compute weighted Spearman correlation coefficient? > There is someone, he lives here http://finzi.psych.upenn.edu/search.html But you can write R-code for this coefficient using: ?rank ?var ?

Re: [R] plotting a timeline

2010-11-22 Thread Łukasz Ręcławowicz
2010/11/20 Marcin Gomulka > I'd rather do this with a dedicated > package function ( like axis() ). Probably you have to write your own function, or tune up manually plot. plot(the_data$eventtime, abs(the_data$impact), type="h", frame.plot=FALSE, axes = FALSE, xlab="",ylab="", col="grey",lwd=

Re: [R] negative axis values in image() and scalebar in cor.plot() {psych}

2010-11-19 Thread Łukasz Ręcławowicz
2010/11/19 Lara Poplarski > > In order to make the output more readable > You can just copy the style of the cor.plot. mat<-matrix(rnorm(256e4),16e2,16e2) image(cor(mat),axes=F,col= grey((dim(mat)[1]:0)/dim(mat)[1]),main="Like this") -- Mi³ego dnia [[alternative HTML version delete

Re: [R] Extending the accuracy of exp(1) in R

2010-11-09 Thread Łukasz Ręcławowicz
2010/11/9 Shant Ch > Can anyone let > me know how can I increase the accuracy level. > library(Rmpfr) > exp(mpfr(1,128)) 1 'mpfr' number of precision 128 bits [1] 2.718281828459045235360287471352662497759 -- Mi³ego dnia [[alternative HTML version deleted]] ___

Re: [R] Please help me about Monte Carlo Permutation

2010-11-02 Thread Łukasz Ręcławowicz
2010/11/2 Chitra > > yes > > > > > > > Me too. So you want to do a MC test for Pearson's product-moment > > correlation, right...? > > So for sample sizes from 3 to about 10 we can use all permutations [permn(combinat)]- test will be exact! (In our case 7!=5040) lg<-"lightgreen" g<-"green" dg<

Re: [R] Please help me about Monte Carlo Permutation

2010-11-01 Thread Łukasz Ręcławowicz
2010/10/29 Chitra > > I am sorry I got lost here. Me too. So you want to do a MC test for Pearson's product-moment correlation, right...? -- Mi³ego dnia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://st

Re: [R] Please help me about Monte Carlo Permutation

2010-10-29 Thread Łukasz Ręcławowicz
2010/10/29 Chitra > > £ukasz Rêc³awowicz, > Thanks. > I got this p-value. > It's exact upper tail (>=), for lower you have to add (<(-test.statistic)) to obtain two-sided p-vaule. > > test() > [1] P-value: 0.00139 > > I still could not figure out how to plot 5000 permuted Qtot vs Itot. > Resul

Re: [R] Please help me about Monte Carlo Permutation

2010-10-28 Thread Łukasz Ręcławowicz
I'm not sure is this correct, but maybe you are looking for something like this: test<-function(){ permuted.Qtot<-permn(data$Qtot) n<-length(permuted.Qtot) correlation<-rep(NA,n) for(i in 1:n){ correlation[i]<-cor(data$Itot,permuted.Qtot[[i]])} p<-sum(correlation>=cor(data$Qtot,data$Itot))/n print

Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread Łukasz Ręcławowicz
W dniu 28 pa¼dziernika 2010 16:09 u¿ytkownik W Eryk Wolski < wewol...@gmail.com> napisa³: > > Any other ideas? > Restart R and then try load library :) -- Mi³ego dnia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] RGTK2 - Entry Point not found

2010-10-28 Thread Łukasz Ręcławowicz
"The stable version of RGtk2 requires GTK version 2.8.0 or higher (and its dependencies)." -- Mi³ego dnia [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the

Re: [R] Reading in a tab delimitated file

2010-10-26 Thread Łukasz Ręcławowicz
2010/10/26 amindlessbrain > > (I'm not sure why the disease column isn't showing up as a tab here, but it > is sep by "\t" in my file. > You've got a double tab space, I don't know is there a prettier way, but paste this: pd<-read.delim("new_treat.txt",sep="") -- Mi³ego dnia

Re: [R] font.lab and font.axis

2010-10-25 Thread Łukasz Ręcławowicz
W dniu 25 pa¼dziernika 2010 13:14 u¿ytkownik Jim Lemon napisa³: > On 10/25/2010 08:02 PM, £ukasz Rêc³awowicz wrote: > >> >> >> 2010/10/25 Jim Lemon mailto:j...@bitwrit.com.au>> >> >> >> Would someone like to suggest a better way to get "axis" to look >>at the font it's supposed to be usin

Re: [R] font.lab and font.axis

2010-10-25 Thread Łukasz Ręcławowicz
2010/10/25 Jim Lemon > Would someone like to suggest a better way to get "axis" to look at the > font it's supposed to be using? Are you looking for something like this? x<-rnorm(100) hist(x,axes=F,font.lab=12,font.main=9) axis(1,font.axis=4) axis(2,font.axis=3) -- Mi³ego dnia [[alt

Re: [R] CI using ci.numeric

2010-10-20 Thread Łukasz Ręcławowicz
2010/10/20 David A. > I am trying to calculate confidence intervals using ci.numeric from > epicalc package. If I generate a normal set of data and find the 99% and 95% > CI, they seem too narrow to me. Am I doing something wrong?? Yes. set.seed(123) x<- rnorm(200,0,1) ci.numeric(x=mean(x),n=l

Re: [R] The width argument of stem()

2010-10-14 Thread Łukasz Ręcławowicz
Or here (kill R feature): stem(islands, width=NULL) It may looks like a bug. 2010/10/14 Marcin Kozak : > Could anyone pleaase clarify what is going on here? -- Miłego dnia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-

Re: [R] bootstrap in pROC package

2010-10-13 Thread Łukasz Ręcławowicz
Try: ci.auc(all$D,all$pre,m="b") 2010/10/13 zhu yao : > Dear useRs: > > I use pROC package to compute the bootstrap C.I. of AUC. > > The command was as follows: > > roc1<-roc(all$D,all$pre,ci=TRUE,boot.n=200) -- Miłego dnia __ R-help@r-project.org ma

Re: [R] How do I tell whether two vectors are identical?

2010-10-13 Thread Łukasz Ręcławowicz
> benchmark( + all_eq = {isTRUE(all.equal.numeric(x,y))}, + dfrm = {compare<-data.frame(id<-seq(1,43e3,1),x,y); + compare$id[compare$x!=compare$y]}, + int = {(compare$x!=compare$y)}, + slf = {differences<-compare$id[compare$x!=compare$y]}, + replications=1000) test replications ela

Re: [R] How do I tell whether two vectors are identical?

2010-10-12 Thread Łukasz Ręcławowicz
Let's test speed in this way: > benchmark(isTRUE(all.equal.numeric(x,y)),replications=1e3) replications elapsed relative user.self sys.self 1000 34.011 29.09 0.16 > benchmark(differences<-compare$id[compare

Re: [R] How do I tell whether two vectors are identical?

2010-10-12 Thread Łukasz Ręcławowicz
Or just: id<-seq(1,45e3,1) compare<-data.frame(id,a,b) differences<-compare$id[a!=b] -- Miłego dnia __ 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-gui

Re: [R] non-numerical values as input using nnet

2010-10-12 Thread Łukasz Ręcławowicz
Response can be (?multinom) factor (?as.factor), while predictors (don't know, but i think not) can be turned into numbers via varius distance measures. -- Miłego dnia __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLE

[R] Bootstrapping Krippendorff's alpha coefficient

2010-10-12 Thread Łukasz Ręcławowicz
Hi, I don't know how to sample such data, it can't be done by row sampling as default method on matrix in boot. Function takes matrix and returns single coefficient. #There is a macro but I want use R :) http://www.comm.ohio-state.edu/ahayes/SPSS%20programs/kalphav2_1.SPS library(concord) librar