Displaying 20 results from an estimated 10000 matches similar to: "Correlation between 2 matrices but with subset of variables"
2011 Jun 02
4
generating random covariance matrices (with a uniform distribution of correlations)
List members,
Via searches I've seen similar discussion of this topic but have not seen
resolution of the particular issue I am experiencing. If my search on this
topic failed, I apologize for the redundancy. I am attempting to generate
random covariance matrices but would like the corresponding correlations to
be uniformly distributed between -1 and 1.
The approach I have been using is:
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
2011 May 31
2
correlatation matrix
Hi there,
I wonder if there is a way of efficiently generating a correlation matrix of two expression matrices. I want to correlate miRNA and mRNA expression and used the following code:
##dat.mi miRNA expression matrix, dat.m mRNA expression matrix
nc <- nrow(dat.mi)
cor.mat <- data.frame(rep(NA,nrow(dat.m)))
pval.mat <- data.frame(rep(NA,nrow(dat.m)))
for(i in 1:nc)
{
cr <- vector()
2007 Sep 26
2
generate fourth vector based on known correlations
I am trying to generate a fourth vector,z, given three known and fixed
vectors, x1,x2,x3 with corresponding known and fixed correlations with
themeselves and with z. That is, all correlations are known and
prespecified. How can I do this?
Thank you,
ben
2008 Nov 21
2
Calculating correlation for a big matrix
Dear All,
I have a matrix of size 10000 x 50. I would like to calculate all possible pair-wise correlation coefficient (5x10^7 combinations) using cor(). How can I efficiently calcualte and save the result in a matrix?
Thanks in advance.
Kind regards,
Ezhil
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,
2008 Aug 04
1
simulate data based on partial correlation matrix
Given four known and fixed vectors, x1,x2,x3,x4, I am trying to
generate a fifth vector,z, with specified known and fixed partial
correlations.
How can I do this?
In the past I have used the following (thanks to Greg Snow) to
generate a fifth vector based on zero order correlations---however I'd
like to modify it so that it can generate a fifth vector with specific
partial
2017 Jun 04
2
read.table
Hi All,
I wonder if there should be one character for quote= in read.table, i.e.,
> args(read.table)
function (file, header = FALSE, sep = "", quote = "\"'", dec = ".",
...
I have a file containing the following lines,
08248-GOTERM 3'-phosphoadenosine 5'-phosphosulfate biosynthetic process
08279-GOTERM 3'-phosphoadenosine
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)
2008 Sep 09
1
write dataframes
Hi,
After manipulate my data I have ended up with 5 different data frames
with different number of observations but the same
number of variables (columns)
An example, if I write str(object1), I see this,
data.frame': 47 obs. of 3 variables:
$ ORF : Factor w/ 245 levels "YAL038W","YAL054C",..: 10 19 38 39 44
45 50 51 59 60 ...
$ mRNA : num 0.891 1.148 1.202
2008 Aug 15
2
cor() btwn columns in two matrices - no complete element pairs
Hi everyone,
I'm trying to calculate correlation coefficients between corresponding
columns in two matrices with identical dimensions but different data. The
problem is that the matrices contain NAs in different locations. I am using
the following code to try to calculate correlations between complete sets of
data:
#Code start
maxcol<-ncol(mat1)
for (i in 1:maxcol)
{
2013 Oct 04
2
Tab Separated File Reading Error
Hello,
I have a seemingly simple problem that a tab-delimited file can't be read in.
> annoTranscripts <- read.table("matched.txt", sep = '\t', stringsAsFactors = FALSE)
Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings, :
line 5933 did not have 12 elements
However, all lines do have 12 columns.
> lines <-
2008 Mar 13
1
Compare two correlations matrices
Hi there,
When I make two correlations matrices of the same size from
a <- cor(el[1:20])
b <- cor(fl[1:20])
how can I compare if this matrices are equal?
Thanks,
Martin
--
Ihr Partner f?r Webdesign, Webapplikationen und Webspace.
http://www.roomandspace.com/
Martin Kaffanke +43 650 4514224
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
2009 Sep 30
1
How to calculate KMO?
Hi All,
How do i calculate KMO for a dataset?
*Dataset:---------------------*
m1 m2 m3 m4 m5 m6 m7 m8
1 2 20 20 2 1 4 14 12
2 9 16 3 5 2 5 5 15
3 18 18 18 13 17 9 2 4
4 7 7 2 12 2 11 11 11
5 7 8 5 19 5 2 20 18
6 7 4 7 4 7 9 3 3
7 5 5 5 12 5 13 13 12
8 6 6 4 3 5 17 17 16
9 12 12 4 2 4 4 14 14
10 5 14
2006 Dec 25
1
Higher Dimensional Matrices
Hi all.
I want to calculate partial correlations while controlling for one or more
variables. That works already fine when I control for example just for x[,1]
and x[,2] that gives me one single correlation matrix and i have to to it
for
x [,1]...x[,10]. That would give me out 10 matrices. Controlling for 2
Variables 100 matrices. how
can I run a loop to get f.e the 10 or 100 matrices at once?
2012 Jan 30
1
about changing line type and line width in Taylor Diagram
Dear all,
I am new to plotting Taylor Diagram using plotrix package within R, hence
this post. I have written a script which plots Taylor Diagram with one
reference and 7 model values. However the font size, line width and line
type are not clear when saving the diagram as a jpeg file. I tried the
functions lty, lwd and font but no apparent change. I am attaching the
script here. Any help would
2008 Dec 26
3
Simulating dataset using Parallel Latent CTT model?
I am trying to simulate a dataset using Parallel Latent CTT model and this is what i have done so far:
(START)
#Importing psych library for all the simulation related functions
library(psych)
# Settting the working directory path to C:/NCME
path="C:/NCME"
setwd(path)
#Using the function to generate the data
GenData <- congeneric.sim(N=500, loads =
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
2009 Jul 15
1
Simulation code error
Dear List,
I have some problem with my simulation code. Here is output from R:
> sim.sp <- function(data,CM,n,N)
+ {
+ C <- matrix(rep(NA,N),ncol=1)
+ for(i in 1:N)
+ {
+ j <- n
+ xx <- which(colSums(CM[j,])==1)
+ V <- names(xx)
+ V <- paste(V, collapse="+")
+ V <- paste("SBA~", V)
+ rd <- round(nrow(data)*(2/3))
+ d <-
2009 Sep 07
2
Averaging rows if a condition is true.
Dear All,
I have matrix (50000 X 60) of subjects and their responses to a set of questions. All responses are classified into categories (500). I would like to average all subject's responses for each category. I wrote a code using a for loop but is not working. Could please tell me what's wrong with the code? I guess, there is a elegant R way of doing the same thing.
Thanks in advance.