search for: cor

Displaying 20 results from an estimated 1386 matches for "cor".

Did you mean: com
2008 Feb 27
4
Error in cor.default(x1, x2) : missing observations in cov/cor
Hello, I'm trying to do cor(x1,x2) and I get the following error: Error in cor.default(x1, x2) : missing observations in cov/cor A few things: 1. I've used cor() many times and have never encountered this error. 2. length(x1) = length(x2) 3. is.numeric(x1) = is.numeric(x2) = TRUE 4. which(is.na(x1)) = which(is.na(x2...
2009 Apr 21
6
Sampling in R
[This email is either empty or too large to be displayed at this time]
2009 Jul 07
1
cor vs cor.test
Hi, I am trying to use R for some survey analysis, and need to compute the significance of some correlations. I read the man pages for cor and cor.test, but I am confused about - whether these functions are intended to work the same way - about how these functions handle NA values - whether cor.test supports 'use = complete.obs'. Some example output may explain why I am confused: -----...
2004 Jun 18
2
Barplots and error indicators: Some R-Code
....na(ind.side)){ ind.side<-"up"} #only upper error indicator (default), else: "lo" or "bo" if (is.na(hat)){ hat<-0.01} #fraction of the x axis that defines the size of the error indicator hat if (is.na(col)){col<-"white"} #the default color is white x.cor<-barplot(data, ylim=ylim, xlab=xlab, ylab=ylab, main=main, names.arg=names.arg, col=col, space=space) smidge<-diff(par("usr")[1:2])*hat up.ind<-data+err.ind lo.ind<-data-err.ind segments(0,0,x.cor,0) # draws X-Axis if (ind.side=="up"){ segments(x.cor, data, x.cor,...
2005 Oct 10
1
Documenting newly created generic versions of non-generic base R functions
Hi, Following the Writing R Extensions manual, I created a method for the cor function. As cor is not a generic, I followed the advice of section 6.1 of the same manual and did the following: cor <- function(x, ...) UseMethod("cor") cor.default <- stats::cor cor.symcoca <- function{ some code } I used package.skeleton to create the basic set-up of my pac...
2012 Feb 23
5
cor() on sets of vectors
suppose I have two sets of vectors: x1,x2,...,xN and y1,y2,...,yN. I want N correlations: cor(x1,y1), cor(x2,y2), ..., cor(xN,yN). my sets of vectors are arranged as data frames x & y (vector=column): x <- data.frame(a=rnorm(10),b=rnorm(10),c=rnorm(10)) y <- data.frame(d=rnorm(10),e=rnorm(10),f=rnorm(10)) cor(x,y) returns a _matrix_ of all pairwise correlations:...
2007 Jul 05
1
cor() and cor.test() (PR#9781)
Hello, I am trying to make a correlation matrix in R using cor() and also to get the p-value for each correlation using cor.test(). I can't get these commands to work. I'm getting errors like the following: cor(Pollution, Wet.days) Error in inherits(x, "data.frame") : Object "Wet.days" not found cor(&...
2007 Jul 10
0
Plot dies with memory not mapped (segfault) (PR#9785)
...00z with 12 GB of ram, and R segfaults using only around 360 MB of ram. I can include MySQL output fed to the script on request, but it's usually for failure data around a max of 1,000 data points in the "failureQuery", and less than 30,000 for "usageQuery". I can generate a core if desired too. ------------------------ begin traceback ------------------------------------------ s> source("SysVUserTime.R") Loading required package: DBI *** caught segfault *** address f9, cause 'memory not mapped' Traceback: 1: axis(side = side, at = at, labels = la...
2007 Dec 03
1
cor(data.frame) infelicities
In using cor(data.frame), it is annoying that you have to explicitly filter out non-numeric columns, and when you don't, the error message is misleading: > cor(iris) Error in cor(iris) : missing observations in cov/cor In addition: Warning message: In cor(iris) : NAs introduced by coercion It would b...
2010 Jan 06
0
Unconsistent behaviour of function cor()
Odd behaviour of function cor() in R-2.10.1-64bit-Unix In a dataset with 1366 patients and 244 clinical variables Spearman's Rho was calculated for some fatty acids and BMI and came over something rather odd: R seems to calculate Rho differently on 2.10.1-64bit-Unix and 2.9.0-32bit-Windows when I calculate the complete (...
2008 Oct 10
1
Correlation among correlation matrices cor() - Interpretation
Hello, If I have two correlation matrices (e.g. one for each of two treatments) and then perform cor() on those two correlation matrices is this third correlation matrix interpreted as the correlation between the two treatments? In my sample below I would interpret that the treatments are 0.28 correlated. Is this correct?...
2010 Feb 08
2
Incorrect Kendall's tau for ordered variables (PR#14207)
Full_Name: Marek Ancukiewicz Version: 2.10.1 OS: Linux Submission from: (NULL) (74.0.49.2) Both cor() and cor.test() incorrectly handle ordered variables with method="kendall", cor() incorrectly handles ordered variables for method="spearman" (method="person" always works correctly, while method="spearman" works for cor.test, but not for cor()). In erro...
2004 Aug 30
1
Wrong result with cor(x, y, method="spearman", use="complete.obs") with NA's???
Hallo! Is there an error in cor to calculate Spearman correlation with cor if there are NA's? cor.test gives the correct result. At least there is a difference. Or am I doing something wrong??? Does anybody know something about this? a<-c(2,4,3,NA) b<-c(4,1,2,3) cor(a, b, method="spearman", use="comple...
2004 Mar 03
1
cor(..., method="spearman") or cor(..., method="kendall") (PR#6641)
Dear R maintainers, R is great. Now that I have that out of the way, I believe I have encountered a bug, or at least an inconsistency, in how Spearman and Kendall rank correlations are handled. Specifically, cor() and cor.test() do not produce the same answer when the data contain NAs. cor() treats the NAs as data, while cor.test() eliminates them. The option use="complete.obs" has no effect on cor() with method="s" or "k". An illust...
2005 Oct 09
3
cor doesn't accept na.rm? (PR#8193)
Full_Name: Paul Bailey Version: 2.1.1 OS: OS X 10.3 Submission from: (NULL) (68.252.250.144) ?cor [tells me that it has a na.rm variable] > cor(frame2[1,],frame2[2,],na.rm=T) Error in cor(frame2[1, ], frame2[2, ], na.rm = T) : unused argument(s) (na.rm ...) hmm.
2006 Sep 11
2
Translating R code + library into Fortran?
...#sample from the parameter space sample.size[i]=round(runif(1,min.sample.size,max.sample.size),digits=0) exp.shift[i]=runif(1,min.shift,max.shift) exp.scale[i]=runif(1,min.scale,max.scale) exp.shape[i]=runif(1,min.shape,max.shape) #generate rt data and record summary stats obs.rt=rweibull(sample.size[i],exp.shape[i],exp.scale[i])+exp.shift[i] if(i==1){ obs.stats=summary(obs.rt) }else{ obs.stats=rbind(obs.stats,summary(obs.rt)) } } row.names(obs.stats)=c(1:iterations) obs.stats=as.data...
2009 Nov 06
2
another question: how to delete one of columes in two ones with high correlation(0.95)
my programe is below: a=c(1,2,1,1,1); b=c(1,2,3,4,1); c=c(3,4,3,3,3); d=c(1,2,3,5,1); e=c(1,5,3,5,1) data.f=data.frame(a,b,c,d,e) origin.data<-data.f cor.matrix<-cor(origin.data) origin.cor<-cor.matrix m<-0 for(i in 1:(cor.matrix[1]-1)) { for(j in (i+1):(cor.matrix[2])) { if (cor.matrix[i,j]>=0.95) { data.f<-data.f[,-i]; i<-i+1 } } } origin.cor data.f the result seems to be not righ....
2009 Jan 31
1
display p-values and significance levels
Hi there, I got a piece of code for the Iris data which allows to display correlation coefficients for each Iris species in the lower panel (color coded). I would now like to add e.g. a "*" to show the significance of each correlation next to the correlation coefficient. Furthermore I would like to make a t.test between the species "setosa" and "v...
2005 May 25
2
cor vs cor.test
Using Windows System, R 2.1.0 d is a data frame, 48 rows, 10 columns cor(d) works properly providing all pairwise Pearson correlation coefficients among columns cor.test(d) gives error message "Error in cor.test.default(d) : argument "y" is missing, with no default" Why? Thanks, MCG
2008 May 02
1
cor.test like cor?
Hi, Is there a simple way to do correlation coefficient tests with "cor.test" like I would do with "cor" function? I have a data frame where each column is a list. ================================================ y <- data.frame(a=sample(30, 20), b=sample(30, 20), c=sample(30,20)) cor(y) ==================...