Displaying 20 results from an estimated 4457 matches for "correlating".
2011 Jan 10
2
Calculating Portfolio Standard deviation
Dear R helpers
I have following data
stocks <- c("ABC", "DEF", "GHI", "JKL")
prices_df <- data.frame(ABC = c(17,24,15,22,16,22,17,22,15,19),
DEF = c(22,28,20,20,28,26,29,18,24,21),
GHI = c(32,27,32,36,37,37,34,23,25,32),
2013 Mar 05
3
Simulate binary correlated data
Dear R experts,
I am trying to simulate correlated binary data and have stumbled upon the
following problem:
With the help of "binarySimCLF" or "mvpBinaryEp" I have been able to
simulate correlating binary vectors given certain mean values and a desired
correlation. My problem is that these procedures do not allow you to specify
the exact vector for which you want to generate a correlated vector. Is
there anyway to do this?
Maybe I can clarify my question by explaining what my goal is:
I want...
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
2005 Apr 03
4
Generating a binomial random variable correlated with a normal random variable
Hi All:
I would like to generate a binomial random variable that correlates with a
normal random variables with a specified correlation. Off course, the
correlation coefficient would not be same at each run because of randomness.
I greatly appreciate your input.
Ashraf
2011 Feb 09
2
Generate multivariate normal data with a random correlation matrix
Hi All.
I'd like to generate a sample of n observations from a k dimensional
multivariate normal distribution with a random correlation matrix.
My solution:
The lower (or upper) triangle of the correlation matrix has
n.tri=(d/2)(d+1)-d entries.
Take a uniform sample of n.tri possible correlations (runi(n.tr,-.99,.99)
Populate a triangle of the matrix with the sampled correlations
Mirror the
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 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,
2011 Apr 09
1
How do I make this faster?
I was on vacation the last week and wrote some code to run a 500-day
correlation between the Nasdaq tracking stock (QQQ) and 191 currency pairs
for 500 days. The initial run took 9 hours(!) and I'd like to make it
faster. So, I'm including my code below, in hopes that somebody will be able
to figure out how to make it faster, either through parallelisation, or by
making changes. I've
2011 May 05
3
cross-correlation table with subscript or superscript to indicate significant differences
Hi, I wonder whether the following is possible with R, and whether anyone has done that and can share his/her code with me. I have a correlation matrix, and I want to create a correlation table that I can copy to Microsoft Word with a superscript above each correlation, indicating significant differences in the same row. That is, when correlations in the same row do not share superscript, it means
2007 Nov 07
1
(no subject)
hello,
i am a bit of a statistical neophyte and currently trying to make some sense of confidence intervals for correlation coefficients. i am using the cor.test() function. the documentation is quite terse and i am having trouble tieing up the output from this function with stuff that i have read in the literature. so, for example, i make two sequences and calculate the correlation coefficient:
2012 Oct 26
1
Creating a correlation matrix from a vector
I'm looking to create a correlation matrix, but I have already obtained the
correlations, which are stored in a vector. (Basically, I'm running a
simulation which requires a correlation matrix, but I am simulating the
various correlations.)
My aim is to create a function that can take the vector, and fit the values
into their respective locations in a correlation matrix. (The correlations
2007 Jun 27
3
Correlation ratio
Hi,
I wanted to know how to compute the correlation ratio (eta) between two
variables using R. Is there any function to compute the correlation ratio.
Any help will be very much appreciated.
Thanks,
Suman
[[alternative HTML version deleted]]
2011 Nov 01
1
How to interpret Spearman Correlation
Hi,
I am not really familiar with Correlation foundations, although I read
a lot. So maybe if someone kindly help me to interpret the following
results.
I had the following R commands:
correlation <-cor( vector_CitationProximity , vector_Impact, method =
"spearman", use="na.or.complete")
cor_test<-cor.test(vector_CitationProximity, vector_Impact,
2010 Apr 02
2
tetrachoric correlations
Hi,
Is there any R library/package that calculates tetrachoric correlations from given marginals and Pearson correlations among ordinal variables?
Inputs to polychor function in polycor package are either contingency tables or ordinal data themselves. I am looking for something that takes marginal distributions and Pearson correlation as inputs.
For example, Y1=(1,2,3) with P(Y1=1)=0.3,
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...
2009 May 26
2
(OT) Does pearson correlation assume bivariate normality of the data?
Dear all,
The other day I was reading this post [1] that slightly surprised me:
"To reject the null of no correlation, an hypothsis test based on the
normal distribution. If normality is not the base assumption your
working from then p-values, significance tests and conf. intervals
dont mean much (the value of the coefficient is not reliable) " (BOB
SAMOHYL).
To me this implied that in
2004 Oct 14
1
correlating between two vectors of numbers
Hi, R!
Question1:
I am trying to correlate two vectors of numbers (two columns of microarray
signal values) by using the non-parametric Spearman's rank correlation
coefficient rho:
> cor.test(V2.Signal,V3.Signal,method="spearman")
but I get the error message:
Error in if (q > (n^3 - n)/6) pspearman(q - 1, n, lower.tail = FALSE) else
pspearman(q, :
missing value
2006 Jan 25
2
how to test robustness of correlation
Hi, there:
As you all know, correlation is not a very robust procedure. Sometimes
correlation could be driven by a few outliers. There are a few ways to
improve the robustness of correlation (pearson correlation), either by
outlier removal procedure, or resampling technique.
I am wondering if there is any R package or R code that have incorporated
outlier removal or resampling procedure in
2012 May 29
1
correlation matrix only if enough non-NA values
Hi everybody.
I'm trying to do a correlation matrix in a list of files. Each file contains
2 columns: "capt1" and "capt2". For the example, I merged all in one
data.frame. My data also contains many missing data. The aim is to do a
correlation matrix for the same data for course (one correlation matrix for
capt1 and another for capt2).
For the moment, I have a correlation
2009 Jan 12
3
polychoric correlation: issue with coefficient sign
Hello,
I am running polychoric correlations on a dataset composed of 12 ordinal and
binary variables (N =384), using the polycor package.
One of the association (between 2 dichotomous variables) is very high using
the 2-step estimate (0.933 when polychoric run only between the two
variables; but 0.801 when polychoric run on the 12 variables). The same
correlation run with ML estimate returns a