Questions tagged [correlation]
For questions regarding interdependence of variable quantities.
3,315
questions
0
votes
1
answer
21
views
Testing correlation or something else when comparing test scores? Using R
I am new to statistics in my M.Sc. thesis, and I would be grateful for some help.
I am testing a score (out of 9) to a score (out of 2). The first score is the person's "base knowledge" in a ...
0
votes
0
answers
12
views
How do I find out which variables influence a certain variable [migrated]
This question seems trivial but I want to know how to find which variables have a certain impact on a specific other variable in a R data set.
I used regressions (in my case multilevel regressions) ...
0
votes
0
answers
17
views
Implementing Circular correlation using FFT
For circular convolution I use :
def fft_convolution(a, b):
return np.fft.irfft(np.fft.rfft(a) * np.fft.rfft(b))
now i want to implement circular correlation ... after reading different docs i ...
1
vote
0
answers
16
views
Calculate intraclass correlation by group in R
I need some programming/statistic help.
I have a database with multiple groups (variable "group"). The members of each group rated some items (in our example-dataset the variables "var1&...
0
votes
1
answer
54
views
Creating correlation of multiple non numeric columns in Python
I have a very long data frame, I want to know the correlations of each and every element, the actual data frame is about 40 columns wide, so I am writing this example here.
Identifier
Column1
Column2
...
0
votes
1
answer
14
views
Turning a correlation matrix from a different package into a corrr cor_df object for downstream filtering and analysis
Currently, I'm using the WGCNA package for biweight midcorrelation which yields a symmetrical correlation matrix.
However when trying to use corrr for downstream filtering, it seems incompatible with ...
-1
votes
0
answers
17
views
Changing font size in ggcorrplot2
I am using ggcorrplot2 to visualise a correlation matrix.
ct <- corr.test(df, use = "pairwise", method="kendall", adjust = "none")
corr <- ct$r
p.mat <- ct$p
p &...
0
votes
0
answers
13
views
Concordance correlation coefficient for negative correaltion
A question regarding the Concordance correlation coefficient (CCC).
I would like to implement it in Python. Following the Wikipedia entry, one of the possible implementations would be
import numpy as ...
0
votes
0
answers
20
views
How to calculate the effort a customer type most likely require of an FTE during a year
I know how many customers of each customer-size group each sales representative handles on an annual basis. Is it possible to calculate the likely time/effort required by each customer size based on ...
1
vote
1
answer
21
views
strange behavior of pandas df.corrwith using a pivot table
I'm using Pandas version 1.4.1. Consider the following code, which works correctly, in which I compute the correlation of two dataframes using df.corrwith
# this works
aa = np.arange(6,dtype='float64'...
2
votes
1
answer
35
views
Using the l-apply over a function with multiple factors in R
In the dataframe df, I construct a have a function f that calculates the correlation between x.sample and y.sample. Then, I am trying to run 999 randomizations that calculates the expected correlation ...
0
votes
0
answers
12
views
How can I split plots by colors in chart.Correlation graph in R?
I'm trying to get the colored plots, basing on the column "cluster".
#kmeans (1mln: 8-10clusters)
km.out<-kmeans(kpis_scaled, centers=10,nstart=50)
print(km.out)
# attaching the ...
1
vote
1
answer
23
views
coding corelated random variables in Python
I am trying to code two random variables with a correlation. I have been given $Z_1\tilde N(0,1)$ and $Z_2\tilde N(0,1)$. I is also given $cor(Z_1,Z_2)=\rho$. So I need the formula to get $Z_2$ from $...
0
votes
0
answers
15
views
Spatial Correlation in R with rasters
I would like to create a spatial correlation to see how local precipitation amounts correlate with annual precipitation over a specified yearly period. I would like the result to be a raster layer ...
1
vote
0
answers
12
views
Intra-class correlation coefficients with R [migrated]
I have recorded the heart rate of a number of participants with two methods:
ECG
rPPG
I am trying to demonstrate that the rPPG is a reliable measure and I think I can use an approach similar to this ...
0
votes
2
answers
29
views
Pandas - Correlation .corr() for int64 datatypes in a datatype returns the same correlation. Bug?
I'm trying to find the correlations between a target column with datatype float, and other columns with mixed datatypes.
df.datatypes
returns:
Pos object
Age float64
Year ...
-1
votes
0
answers
25
views
Is there a way to highlight specific correlation with heatmap?
Here's my code:
cmap = colors.ListedColormap(["#682F2F", "#9E726F", "#D6B2B1", "#B9C0C9", "#9F8A78", "#F3AB60"])
corrmat= df2.corr()
plt....
0
votes
0
answers
8
views
Computing a pixel-wise R-squared value between two image collections
I have several image collections: september_CCI (chlorophyll-carotenoid index), SDD (snow disappearance date), cumulative_summer_VPD (vapor pressure deficit), and cumulative_summer_precipitation. Each ...
0
votes
0
answers
13
views
Forecasting with C-Vine Copula
I have a dataset with 4 different variables: x1, x2, x3 and k1. I'd like to use C-Vine copula to model interdependency btw these 4 variables with k1 being root node, then make forecasting of k_{t+1}. ...
0
votes
0
answers
27
views
Deriving data from a multivariate normal distribution according to a specific correlation matrix in r
I derive data from a multivariate normal distribution. I created the correlation structure I wanted by the sigma matrix. Since I take the standard deviation as 1, I expect the Sigma matrix and ...
1
vote
1
answer
49
views
Does bnlearn compute for non-linear correlations?
I've recently started using the bnlearn package in R for detecting Markov Blankets of a target node in the dataset.
Based on my understanding of Bayesian Inference, two nodes are connected if there is ...
0
votes
1
answer
23
views
lower triangular heat-map in r
I'm trying to plot a pearson correlation heat map in R on a certain dataset.
The rows and columns of the heat map shall be the same, thus I'm trying to plot a lower triangular plot for it.
The code I'...
2
votes
1
answer
52
views
Correlation Matrix with over 100 variables
I have 100 Variables and I am trying to plot these variables in a correlation matrix. However as you can see on the picture I have too many variables to have a good visual presentation. Is there a ...
1
vote
1
answer
39
views
creat a new column and add value to it in R
Here's my code:
correlation <- function(dtable){
# create the column
dtable[, "correlation"] <- ""
for (row in 1:nrow(dtable)) {
#get the correlation for each row
...
0
votes
0
answers
15
views
Compare two Audio(.wav) files using cross correlation in python
I need to compare two audio files to check the similarity between them. So that I have used the cross-correlation method using python.Here is my code:
from scipy.io import wavfile
from scipy import ...
0
votes
2
answers
32
views
Adding legend to heatmap in Python / Matplotlib with circles that compare total users, and colors that indicate ratio of abandonment in single graph
I found in SO an explanation to add a legend to this type of graph. However, it does not translate well with my data. I got my graph with circles and shades of colors to work. I do have the legend ...
0
votes
1
answer
36
views
get the correlation for each row in r
Here's the data:
tmp <- tibble::tibble(id = rep(1, 16), wells = 1:16, eur = c(21,23,45,43,23,55,34,44,65,56,66,76,87,67,76,56))
tmp
#> # A tibble: 16 × 3
#> id wells ...
0
votes
1
answer
49
views
Correlation coefficient between two dataframe in R
I have two gene expression DataFrames, one includes the predicted expression values (expr_mat1) and the other includes the actual expression values (expr_mat2) for a list of individuals. I am looking ...
1
vote
2
answers
69
views
How to estimate the correlation between two functions with unknown variables inside?
I need to solve this optimization problem in order to estimate lambda:
Basically, I need to find the correlation between these two functions:
f1 <- function(lambda, tau){slope = (1-exp(-lambda*tau)...
2
votes
1
answer
36
views
Getting correlational type tables from pandas dataframe
I have a data frame of the below format.
variable count
a,x 20
a 100
a,y 40
I would like to get a matrix similar to correlational matrix but not correlational data. Required ...
2
votes
1
answer
27
views
Calculate correlations between two different tables with different structures
I have two tables, on containing a column of one value 'num1' per date, and another containing one value per name 'num2' per date. I'm interested in calculating the correlation between each name's '...
0
votes
0
answers
28
views
R function to compute element-wise significance test of correlation coefficients across two different matrices
I have two different datasets of plant traits across two environmental conditions. I calculated spearman's correlations among the traits within each dataset to evaluate the relationship among these ...
0
votes
0
answers
33
views
What to do if one feature is highly correlated with the label but most of its values are missing?
For a Machine-Learning project I have a dataset with 27 features, one label and 10479 samples.
After creating a correlations map I found that all of the features have low correlation with the lable (...
0
votes
1
answer
26
views
Correlation between timestamps
I hope this isn’t off topic, I am not really sure which forum to use for a question like this:
I have a series of datapoints of about an hour in time from a sensor that retrieves data 20 times per ...
0
votes
2
answers
24
views
Subset correlatio matrix based on value
I have correlation matrix like this
A B C D E F
A 1 0.7 0.9 0.5 0.83 0.88
B 0.7 1 0.8 0.5 0.95 0.96
C 0.9 0.8 1 0.8 0.97 0.9
D 0.5 0.5 0.97 1 ...
-2
votes
0
answers
21
views
regression analysis with two datasets
I have two datasets whose dataset1 is metagenomic data with 95 rows 2 columns and dataset2 is metabolomic data with 458 rows and 2 columns. what type of regression can be performed with this. and how ...
0
votes
0
answers
15
views
Only show significant correlations in heatmap
I used the corr.test function to get the correlation values between to matrices and their p adjusted values.:
test <- corr.test(x, y, method="spearman", adjust="BH")
I have the ...
1
vote
1
answer
39
views
Correlation between the count of combinations
I have a df:
my_data = {'order_id': {('group_1', 'A'): 2,
('group_1', 'B'): 4,
('group_1', 'C'): 6,
('group_1', 'D'): 5,
('group_10', 'A'): 6,
('group_10', 'B'): 4,
('group_10', 'C'): 7,
...
0
votes
0
answers
6
views
Partial correlation with missing values and multiple columns?
I have a large dataset, with many columns. Columns 33 to 54 are miRNA expression. Columns 2 to 11 are confounders. "logMMSE" is the output.
I want to do a correlation analysis of each one of ...
0
votes
0
answers
9
views
Cross-Correlation between 3d fields numerically
I have a two 3D variables for a each time step (so I have N 3d matrix var(Nx,Ny,Nz), for each variables). I want to construct the two point statistics but I guess I'm doing something wrong.
Two-point ...
-1
votes
0
answers
22
views
Rolling correlation function in pandas for differently spaced time series
I am working with two differently spaced time series: one holding precipitation measurements (every 3 hours) and the other the flow in a tank (every 5 minutes). As the data isn't one-to-one, I can't ...
1
vote
1
answer
35
views
Is it possible to make an asymmetric coloured correlation matrix plot in R?
I'd like to make a colored asymmetric correlation matrix in R. Essentially, it'll be a 4 by 6 correlation matrix (that looks something like the plots here). I have simulated some data here as an ...
0
votes
0
answers
9
views
How do I generate scatterplots for abundance and a numerical variable with a phyloseq object?
I have a phyloseq object in R, and I would like to generate scatterplots to show associations between individual taxa and a numeric variable that's in my sample data (i.e. my variable on x axis, ...
0
votes
0
answers
15
views
How to plot correlation coefficients in the same graph
The MATLAB code looks like this, how can I plot these coefficients in a graph? In the same graph.
coefFp1=corrcoef(hFp1,mddFp1);
coefF3=corrcoef(hF3,mddF3);
coefC3=corrcoef(hC3,mddC3);
coefP3=...
0
votes
0
answers
14
views
Correlation coefficient between two signals stored in a timetable in Matlab?
I want to find the correlation coefficients between two signals and to plot the deference in values using matlab.
I have two eeg datasets with 20 electrodes each, of healthy and depressed subjects. I ...
0
votes
1
answer
19
views
How to print the result of pearsonr loop in the graph title for each iteration
I have this code where the loop iterates through PRDCT column then calculates the p and r value, and creates a graph for each unique product code:
for prd in df_final.PRDCT.unique():
df_tmp = ...
0
votes
0
answers
16
views
Correlation for categorical data with respect to reference data
I have data from two sensors. Reading 1 gives me the reference data while reading 2 is categorical data (eg. reading 2 is ideally supposed to be 0 when reference data is less than 0-10; 10 when ...
0
votes
1
answer
28
views
Correlation Syntax for R
Very basic question, it's my first time writing syntax in R. Trying to write basic correlation syntax. Hypothesis is as follows: X1 (Predictor variable) and X2 (latent predictor variable) will be ...
0
votes
0
answers
17
views
How to plot p-values (computed outside R) in a correlogram?
I have two matrices (one with correlations and the other with p-values) computed outside the R environment.
I have successfully plotted the correlation matrix using ggcorrplot and corrplot but I want ...
0
votes
0
answers
40
views
How can I add filter for variables correlation heatmap in Python?
I want to create correlation heat-map with filter to choose the variable you want to correlate. I am using plotly as library for the visualization.
So far my code shows the filters but doesn't plot ...