similar to: cor vs cor.test

Displaying 20 results from an estimated 10000 matches similar to: "cor vs cor.test"

2003 Apr 24
3
Missing Value And cor() function
Hi r lovers! I 'd like to apply the cor() function to a matrix which have some missing values As a matter of fact and quite logically indeed it doesn't work Is there a trick to replace the missing value by the mean of each variable or by any other relevant figures ? Or should I apply a special derivate of the cor() function, (I don't have any idea if it exists and have some trouble to
2005 Jul 23
2
cor(X) with P-Value
Friends I am new to R (and statistics) so am struggling a bit. Briefly... I am interested in getting the P-Value from cor(X) where X is a matrix. I have found cor.test. Verbosely... I have 4 vectors and can generate the corellation matrix... > cor(cbind(X1, X2, X3, X4)) X1 X2 X3 X4 X1 1.00000000 -0.06190365 -0.156972795 0.182547517 X2
2008 Jan 02
2
strange behavior of cor() with pairwise.complete.obs
Hi all, I'm not quite sure if this is a feature or a bug or if I just fail to understand the documentation: If I use cor() with pairwise.complete.obs and method=pearson, the result is a scalar: ->cor(c(1,2,3),c(3,4,6),use="pairwise.complete.obs",method="pearson") [1] 0.9819805 The documentation says that " '"pairwise.complete.obs"' only
2005 Oct 24
2
Spearman's Rho Help!
Hi, I have a dataset with four categories of data, the number of samples are not the same in each category. I want to find the Spearaman's Rho. Let me give an example. x=(14.22770439,26.49420624,46.7277932,19.02550707,23.37379361,16.97789862,19.77100085,23.11270162,13.72929843,33.54430621,14.4756979,70.15811106,11.22789833,NA,NA,NA)
2012 Mar 07
2
how to see inbuilt function(cor.test) & how to get p-value from t-value(test of significance) ?
i can see source code of function > cor function (x, y = NULL, use = "everything", method = c("pearson", "kendall", "spearman")) { na.method <- pmatch(use, c("all.obs", "complete.obs", "pairwise.complete.obs", "everything", "na.or.complete"))
2005 Feb 13
1
Bug in cor function (PR#7689)
I can't hardly accept the result of cor function with pairwize.colplete.obs or complete.obs insert print statements in cor function, + if (method != "pearson") { + Rank <- function(u) if (is.matrix(u)) + apply(u, 2, rank, na.last = "keep") + else rank(u, na.last = "keep") + x <- Rank(x) +
2003 Mar 05
1
cor.test in matrices
Hi, For computing correlation among variables in a matrix, I use cor( ), but for computing the p-values I'm using cor.test in the following way: cor.p <- function(X) { res <- matrix(0, ncol(X), ncol(X)) for (i in 1:ncol(X)) for (j in 1:ncol(X)) res[i, j]<- cor.test(X[, i], X[, j])$p.value rownames(res) <- colnames(res) <- colnames(X) res } I'm just wondering if there is a
2004 Oct 22
1
cor, cov, method "pairwise.complete.obs"
Hi UseRs, I don't want to die beeing idiot... I dont understand the different results between: cor() and cov2cov(cov()). See this little example: > x=matrix(c(0.5,0.2,0.3,0.1,0.4,NA,0.7,0.2,0.6,0.1,0.4,0.9),ncol=3) > cov2cor(cov(x,use="pairwise.complete.obs")) [,1] [,2] [,3] [1,] 1.0000000 0.4653400 -0.1159542 [2,] 0.4653400 1.0000000
2010 Jun 09
1
bug? in stats::cor for use=complete.obs with NAs
Arrrrr, I think I've found a bug in the behavior of the stats::cor function when NAs are present, but in case I'm missing something, could you look over this example and let me know what you think: > a = c(1,3,NA,1,2) > b = c(1,2,1,1,4) > cor(a,b,method="spearman", use="complete.obs") [1] 0.8164966 > cor(a,b,method="spearman",
2004 May 24
1
bug in cor (..., use= ...)?
Dear R users, I have not found anything on this in the archives. Does anyone know whehther the parameter use= is not functioning in cor or enlighten me what it is supposed to do? My R version is "R version 1.8.1, 2003-11-21" on Windows 2000. I am hoping to be able to update to 1.9.1 as soon as it has appeared (we are not allowed here to install software on our own and thus I am trying
2007 Jul 20
1
how to determine/assign a numeric vector to "Y" in the cor.test function for spearman's correlations?
Hello to all of you, R-expeRts! I am trying to compute the cor.test for a matrix that i labelled mydata according to mydata=read.csv... then I converted my csv file into a matrix with the mydata=as.matrix(mydata) NOW, I need to get the p-values from the correlations... I can successfully get the spearman's correlation matrix with: cor(mydata, method="s",
2004 Apr 09
6
Incorrect handling of NA's in cor() (PR#6750)
Full_Name: Marek Ancukiewicz Version: 1.8.1 OS: Linux Submission from: (NULL) (132.183.12.87) Function cor() incorrectly handles missing observation with method="spearman": > x <- c(1,2,3,NA,5,6) > y <- c(4,NA,2,5,1,3) > cor(x,y,use="complete.obs",method="s") [1] -0.1428571 >
2003 Nov 07
2
Bug in cor.test - Spearman
Greetings. There seems to be a problem with the P-value computation in the cor.test with method="spearman". In R1.8.0 (MS Windows) I seem to be getting intermittently nonsense P-values, but the rho's are OK. I can get this reproducibly with the toy example attached where the first use is OK and subsequent calls with the same data give nonsense. (I have also seen the problem
2011 Mar 29
7
Error en cor, too many elements specified
Hola, tengo una serie de datos datExpr, al usar cor() : cor(datExpr ,method = "pearson", use ="pairwise.complete.obs") me da el siguiente error allocMatrix: too many elements specified Trate con "complete.obs", "na.or.complete", y el resto de las opciones para "use", pero siempre me da algun error.  ¿Alguna idea de como puedo hacer que cor() lea
2003 Apr 01
2
cor.test observations limit
Hi, Is there a limit on the number of observations for using cor.test. For example, > library(ctest) > cor.test(rnorm(3000), rnorm(3000), method="spearman") Error in if (q > (n^3 - n)/6) pspearman(q - 1, n, lower.tail = FALSE) else pspearman(q, : missing value where logical needed In addition: Warning message: NAs introduced by coercion I mainly want to calculate
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)) = integer(0) {the same goes for is.nan()} 5. I also try
2011 Jan 12
3
Problems creating a PNG file for a dendrogram: "Error in plot.window(...) : need finite 'xlim' values"
Has anyone successfully created a PNG file for a dendrogram? I am able to successfully launch and view a dendrogram in Quartz. However, the dendrogram is quite large (too large to read on a computer screen), so I am trying to save it to a file (1000x4000 pixels) for viewing in other apps. However, whenever I try to initiate a PNG device, I get a "need finitite 'xlim' values"
2013 Mar 29
1
pairs(X,Y) analog of cor(X,Y)?
With a data frame containing some X & Y variables I can get the between set correlations with cor(X,Y): > cor(NLSY[,1:2], NLSY[3:6]) antisoc hyperact income educ math 0.043381307 -0.07581733 0.25487753 0.2876875 read -0.003735785 -0.07555683 0.09114299 0.1884101 Is there somewhere an analog of pairs(X,Y) that will produce the pairwise plots of each X against each
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: cor(x,y)
2002 May 06
3
Spearman rank-order correlation matrix
I"ve got a data frame with a selection of columns I want to compute a rank-order correlation matrix from without disturbing the original data frame. foo[,c("a","b","d","f","g")] What I wanted to do, intuitively, was: > cor(rank(foo[,c("a","b","d","f","g")])) but rank in that context