similar to: correlation among variables in the same subset

Displaying 20 results from an estimated 40000 matches similar to: "correlation among variables in the same subset"

2012 Mar 08
4
Correlation between 2 matrices but with subset of variables
Dear All, I have two matrices A (40 x 732) and B (40 x 1230) and would like to calculate correlation between them.  I can use: cor(A,B, method="pearson") to calculate correlation between all possible pairs. But the issue is that there is one-many specific mappings between A and B and I just need to calculate correlations for those pairs (not all). Some variables in A (proteins, say p1)
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? > var1<- c(.000000000008, .09, .1234, .5670008, .00110011002200,
2012 May 14
3
select data
Dear all, I am sure it won't be difficult for you!! I need to calculate the average among variables for the single units of my dataset. But, while doing it, I need to do not consider some values. To better explain, think like there are two units and three variables: V1 V2 V3 [1] 3 -2 4 [2] -1 4 1 and you want to calculate the average by row, without
2012 May 15
1
Regression Analysis or Anova?
Dear all, I hope to be the clearest I can. Let's say I have a dataset with 10 variables, where 4 of them represent for me a certain phenomenon that I call Y. The other 6 represent for me another phenomenon that I call X. Each one of those variables (10) contains 37 units. Those units are just the respondents of my analysis (a survey). Since all the questions are based on a Likert scale, they
2011 Mar 01
3
Is there any Command showing correlation of all variables in a dataset?
Thanks in advance. I want to derive correlations of variables in a dataset Specifically library(Ecdat) data(Housing) attach(Housing) cor(lotsize, bathrooms) this code results only the correlationship between two variables. But I want to examine all the combinations of variables in this dataset. And I will finally make a table in Latex. How can I test correlations for all combinations of
2008 Nov 26
2
Very slow: using double apply and cor.test to compute correlation p.values for 2 matrices
My two matrices are roughly the sizes of m1 and m2. I tried using two apply and cor.test to compute the correlation p.values. More than an hour, and the codes are still running. Please help to make it more efficient. m1 <- matrix(rnorm(100000), ncol=100) m2 <- matrix(rnorm(10000000), ncol=100) cor.pvalues <- apply(m1, 1, function(x) { apply(m2, 1, function(y) { cor.test(x,y)$p.value
2005 Oct 20
1
Cross-correlation function
Hello All, I'm having trouble with the ccf() function. I am trying to do cross-correlation between two time-series, but I keep getting an error message I don't know what to do with. This what I type and the error message I get: > ccf(ts(mod[,1]),ts(mod[,2]),na.action='na.exclude',type='cor') Error in "colnames<-"(`*tmp*`, value = c("ts(mod[,
2012 Mar 15
6
Generation of correlated variables
Hi everyone. Based on a dependent variable (y), I'm trying to generate some independent variables with a specified correlation. For this there's no problems. However, I would like that have all my "regressors" to be orthogonal (i.e. no correlation among them. For example, y = x1 + x2 + x3 where the correlation between y x1 = 0.7, x2 = 0.4 and x3 = 0.8. However, x1, x2 and x3
2009 Feb 12
3
get top 50 correlated item from a correlation matrix for each item
Hi, I have a correlation matrix of about 3000 items, i.e., a 3000*3000 matrix. For each of the 3000 items, I want to get the top 50 items that have the highest correlation with it (excluding itself) and generate a data frame with 3 columns like ("ID", "ID2", "cor"), where ID is those 3000 items each repeat 50 times, and ID2 is the top 50 correlated items with ID,
2008 Apr 05
2
pearson's correlation
Hello, I used the function cor to calculate the pearson correlation coefficient between variables. However, the resulting values do not correspond to the outcome of my excel-calculations, for which I used the formula Cor(x,y)=Cov(x,y)/(SD(x)*SD(y)) So my question is: How does the function "cor" compute the pearson correlation coefficient? Thank you in advance, Ake Nauta
2010 Feb 25
1
How to do: Correlation with "blocks" (or - "repeated measures" ?!) ?
Hello dear R help group, I have the following setup to analyse: We have about 150 subjects, and for each subject we performed a pair of tests (under different conditions) 18 times. The 18 different conditions of the test are complementary, in such a way so that if we where to average over the tests (for each subject), we would get no correlation between the tests (between subjects). What we wish
2012 Aug 29
3
Help on calculating spearman rank correlation for a data frame with conditions
Dear all, Suppose my data frame is as follows: id price distance 1 2 4 1 3 5 ... 2 4 8 2 5 9 ... n 3 7 n 8 9 I would like to calculate the rank-order correlation between price and distance for each id. cor(price,distance,method = "spearman") calculate a correlation for all. Then I tried to use apply(data,list='id',cor(price , distance , method =
2007 Jul 30
3
Constructing correlation matrices
Greetings, I have a seemingly simple task which I have not been able to solve today and I checked all of the help archives on this and have been unable to find anything useful. I want to construct a symmetric matrix of arbtriray size w/o using loops. The following I thought would do it: p <- 6 Rmat <- diag(p) dat.cor <- rnorm(p*(p-1)/2) Rmat[outer(1:p, 1:p, "<")] <-
2011 Mar 21
2
Correlation for no of variables
Dear R helpers, Suppose I have stock returns data of say 1500 companies each for say last 4 years. Thus I have a matrix of dimension say 1000 * 1500 i.e. 1500 columns representing companies and 1000 rows of their returns. I need to find the correlation matrix of these 1500 companies. So I can find out the correlation as cor(returns) and expect to get 1500 * 1500 matrix. However, the process
2011 Oct 10
4
correlation matrix
Hello Gurus I have two correlation matrices 'xa' and 'xb' set.seed(100) d=cbind(x=rnorm(20)+1, x1=rnorm(20)+1, x2=rnorm(20)+1) d1=cbind(x=rnorm(20)+2, x1=rnorm(20)+2, x2=rnorm(20)+2) xa=cor(d,use='complete') xb=cor(d1,use='complete') I want to combine these two to get a third matrix which should have half values from 'xa' and half
2008 Mar 08
1
how to compute uncentered (pearson correlation) correlation efficiently
Hi, Seeking suggestions to compute uncentered (pearson correlation) correlation efficiently. corr from stats library works on x and y columns. dist from amap library works on x and y rows. My data layout is slightly different such that row(i) of matrix x is compared to row(i) of matrix y. Thanks [[alternative HTML version deleted]]
2011 Jun 02
1
an efficient way to calculate correlation matrix
Dear all, I have a problem. I have m variables each of which has n observations. I want to calculate pairwise correlation among the m variables and store the values in a m x m matrix. It is extremely slow to use nested 'for' loops if m and n are large. Is there any efficient alternative to do this? Many thanks for your suggestions!! Bill
2007 Jul 13
2
nearest correlation to polychoric
Dear all, Has someone implemented in R (or any other language) Knol DL, ten Berge JMF. Least-squares approximation of an improper correlation matrix by a proper one. Psychometrika, 1989, 54, 53-61. or any other similar algorithm? Best regards Jens Oehlschl?gel Background: I want to factanal() matrices of polychoric correlations which have negative eigenvalue. I coded Highham 2002
2011 Jun 18
1
Conditional Correlation
Hi, How can I accomplish this in R. Example: I have the following data.frame: data <- data.frame(x=c(1,2,3,4,5,6,5,3,7,1,0,4,8),y=c(1,2,1,2,2,2,1,1,1,2,2,2,2),z=c(5,8,4,3,4,1,6,3,3,6,3,5,7)) Supposing that data$y is a factor, I would like to find the Spearman correlation between data$x and data$z indexing it by data$y. To be more specific, I want to find two correlations: between x and z
2012 Mar 28
1
resampling for correlation and testing
Hello all R-er, I'm trying to run a resampling method on some data. The current method I have takes 2+ days or a lot of memory . I was wondering if anyone has a better suggestion. Currently I take a matrix and get the correlation matrix from it. This will be called rho.A. Each element in this will be tested against the distribution from the resampled correlation B matrix. Some example