Displaying 20 results from an estimated 7000 matches similar to: "Correlations by subgroups"
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
2004 Sep 14
1
pairs correlations colors
I have the following problem.
I want to use pairs function and get a matrix of scatterplots with the
correlations in the upper panel and the ordinary scatterplots in the
lower panel.
Moreover, I want to have points colored in five differet ways in the
lower panel, because I have five subgroups.
In order to do that I tried to combine examples on pairs function help.
I got a colored matrix
2004 Dec 21
3
R code for var-cov matrix given variances and correlations
Dear list members,
Where can I find code for computing the p*p variance-covariance
matrix given a vector of p variances (ordered varA, varB, ...,
varp) and a vector of all possible correlations (ordered corAB,
corAC, ..., corp-1,p)?
I know that the covariance between 2 variables is equal to the
product of their correlation and their standard deviations:
corAB * varA^.5 * varB^.5
and so:
2007 Oct 11
1
constraining correlations
Hello,
I've searched for an answer to no avail. I am wondering if anyone
knows how to constrain certain correlations to be equal. I have family
data with 2 twins per family plus up to 2 siblings. I would like to
somehow constrain all the sibling correlations (twin-sib and sib-sib)
to be the same while allowing the twin-twin correlation to be
different. Here is some simulated code:
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
2006 Jul 24
2
Correlations by group
I'm aware that S N Krishna asked the same
question. However, I have failed to implement the
posted solution for running rank order
correlations on multiple subsets of data using the by() function.
Here is my problem:
Take a set of data from two subjects, who
provided numerical infant mortality (IM) estimates for five countries:
sub <- c(1, 1, 1, 1, 1, 2, 2, 2, 2, 2)
2006 Aug 24
2
Why are lagged correlations typically negative?
Recently, I was working with some lagged designs where a vector of
observations at one time was used to predict a vector of observations at
another time using a lag 1 design. In the work, I noticed a lot of
negative correlations, so I ran a simple simulation with 2 matched
points. The crude simulation example below shows that the correlation
can be -1 or +1, but interestingly if you do this
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:
2007 Nov 08
6
Extract correlations from a matrix
Dear R users,
suppose I have a matrix of observations for which I calculate all
pair-wise correlations:
m=matrix(sample(1:100,replace=T),10,10)
w=cor(m,use="pairwise.complete.obs")
How do I extract only those correlations that are >0.6?
w[w>0.6] #obviously doesn?t work,
and I can?t find a way around it.
I would very much appreciate any help!
Best wishes
Christoph
(using R
2008 Sep 06
1
Test for equality of complicatedly related average correlations
Dear R-Users,
I am currently looking for a way to test the equality of two correlations
that are related in a very special way. Let me describe the situation with
an example.
- There are 100 respondents, and there are 2 points in time, t=1 and t=2.
- For each of the respondents and at each of the time points, I have
information on 10 X-variables and on 10 Y-variables.
- Based on this
2011 Oct 10
1
Multiple imputation on subgroups
Dear R-users,
I want to multiple impute missing scores, but only for a few subgroups in my
data (variable 'subgroups': only impute for subgroups 2 and 3).
Does anyone knows how to do this in MICE?
This is my script for the multiple imputation:
imp <- mice(data, m=20, predictorMatrix=pred, post=post,
method=c("", "", "", "",
2009 Mar 31
1
Efficient calculation of partial correlations in R
Hello,
I'm looking for an efficient function for calculating partial correlations.
I'm currently using the pcor.test () function, which is equivalent to the
cor.test() function, and can receive only single vectors as input. I'm
looking for something which is equivalent to the cor() function, and can
receive matrixes as input (which should make the calculations much more
efficient).
2006 Nov 15
1
Correlations not in sync with r2 from regression
I have two variables, minutereturnsa which can be thought of as my
independent variable and minutereturnsb which can be thought of as my
dependent variable. When I run correlations on the two variables,
depending on which of the three methods I use, I get values of between
-.15 through -.19.
Then, when I do a regression, I get an rsquared of .004 which is more in
line with my intuition. In other
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 Mar 10
2
perform subgroup meta-analysis and create forest plot displaying subgroups
Hello,
I'm using the rmeta package to perform a meta analysis using summary statistics rather than raw data, and would like to analyze the effects in three different subgroups of my data. Furthermore, I'd like to plot this on one forest plot, with corresponding summary weighted averages of the effects displayed beneath each subgroup.
I am able to generate the subgroup analyses by simply
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",
2011 Apr 09
3
In need of help with correlations
I am in need of someone's help in correlating gene expression. I'm somewhat
new to R, and can't seem to find anyone local to help me with what I think
is a simple problem.
I need to obtain pearson and spearman correlation coefficients, and
corresponding p-values for all of the genes in my dataset that correlate to
one specific gene of interest. I'm working with mouse Affymetrix
2001 Aug 01
3
partial correlations
Howdy!
I need to calculate partial correlations and I just can't find out how to
do that with R. Can anybody help?
Ragnar
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)
2011 May 16
3
Simulating correlations with varying sample sizes
Hi there,
I would like to draw 10 correlations from a bivariate population - but every
draw should be done with a different sample size. I thought I could to this
with a loop:
r=numeric(10) #Goal vector
N = c(1000,100,80,250,125,375,90,211,160,540) #Sample size vector
for(i in 1:10) {
data <- mvrnorm(n=N,mu=c(0,0),Sigma=matrix(c(1,.3,.3,1),2))
r[i] <- cor(data[,1],data[,2])
}
2013 Feb 28
1
PCA with spearman and kendall correlations
Hello,
I would like to do a PCA with dudi.pca or PCA, but also with the use of Spearman or Kendall correlations
Is it possible ?
Otherwise, how can I do, according to you ?
Thanking you in advance
Eric Bourgade
RTE
France
[[alternative HTML version deleted]]