Questions tagged [pairwise]
273 questions
2
votes
1 answer
Pairwise T-test: Error in complete.cases(x, y) : not all arguments have the same length?
I am trying to run a pairwise T-test:
Dataundershootwithoutmeansminusstopdistance %>%
(Undershootextent ~ Condition, paired = TRUE, p.adjust.method = "bonferroni")
I am getting this result:
Error in complete.cases(x, y) : not all arguments have…

Caledonian26
- 727
- 1
- 10
- 27
2
votes
1 answer
Performing pair-wise comparisons of some pandas dataframe rows as efficiently as possible
For a given pandas dataframe df, I would like to compare every sample (row) with each other.
For bigger datasets this would lead to too many comparisons (n**2). Therefore, it is necessary to perform these comparisons only for smaller groups (i.e.…

xaneon
- 317
- 3
- 9
2
votes
2 answers
Converting list of pairwise comparisons to hierarchical representation (columns) using pandas Python
I have a data set of the following form (around 8000 rows)
Employee ID | Manager ID
a | b
c | b
b | e
d | e
e | f
I will like to convert this into a form, where the entire 'link' between an employee at the lowest hierarchical level and the all…

lala_12
- 131
- 2
- 10
2
votes
0 answers
Pairwise deletion with lm() in R?
I have a dataset with which I am conducting multivariate regressions with missing data, similar to this:
dat <- data.frame(y = c(1, 2, 3, 4, 5, 4, 3, 4, NA, 10),
x = c(6, 5, NA, 3, 9, 2, 6, 1, 7, 10),
z = c(4, 6,…

Marco Pastor Mayo
- 803
- 11
- 25
2
votes
2 answers
Aligning Multiple Files in R by Pairwise Alignment
I have 15 protein sequences as fasta format in one file. I have to pairwise align them globally and locally then generate a distance score matrix 15x15 to construct dendrogram.
But when I do, i.e. A sequence is not aligning with itself and I get NA…
user12374392
2
votes
0 answers
Is there a way to add cld to a combined ggplot?
I'm analysing a set of multivariate data, first comparing it to a control, then comparing the different treatments among themselves. The data can be found here.
For the comparison with the control, I'm using ggpubr :
ggbarplot(s1, x = "media", y =…

Sara Esteves
- 89
- 5
2
votes
1 answer
How do I iterate over the rows in dataframe and swap two adjacent rows and perform some operations on the new dataframe created after the swap?
for i, rows in df.iterrows():
x, y = df.iloc[rows].copy(), df.iloc[rows+1].copy()
df.iloc[rows], df.iloc[rows+1] = y, x
break
I get error on execution:
positional indexers are out-of-bounds`

Abdul Raheem
- 23
- 4
2
votes
3 answers
Generating a pairwise 'distance' matrix
I am trying to generate what I can best describe as a pairwise distance matrix from a data frame containing the distance between two neighboring points. These are not Euclidean distances, they are essentially the distance between points on a…

Aislin809
- 23
- 3
2
votes
1 answer
Wrong product produced in pairwise error estimation in R
I want to produce a pairwise error from a melted matrix which seems like this:
pw.data = data.frame(true_tree = rep(c("maple","oak","pine"),3),
guess_tree = c(rep("maple",3),rep("oak",3),rep("pine",3)),
value =…

DSA
- 655
- 5
- 13
2
votes
1 answer
How to compute on columns pairwise, from two groups with dplyr
I have a dataset of this shape.
group a1 a2 ... a9 b1 b2 ... b7
1 1 0 ... 1 0 1 ... 1
1 1 1 ... 1 0 0 ... 1
1 0 0 ... 0 1 0 ... 1
1 1 1 ... 0 1 1 ... 0
2…

rcorty
- 1,140
- 1
- 10
- 28
2
votes
1 answer
Creating tuples of multiples from pairs of indices
Given a numpy array, which can be subset to indices for array elements meeting given criteria. How do I create tuples of triplets (or quadruplets, quintuplets, ...) from the resulting pairs of indices ?
In the example below, pairs_tuples is equal to…

user7105520
- 43
- 3
2
votes
1 answer
Calculate distance between every point of matrix with each other
I want to calculate the euclidean distance between every element of an n-channeled matrix to every other and then apply the function exp(-dist) to it. My matrix is MxN so the output must be (MxN)x(MxN).
This is my code so far:
MAX=M*N;
A =…

Christina J
- 79
- 2
- 8
2
votes
0 answers
How can I generate a pairwise probabilities matrix with mean and standard deviation fixed in advance?
I need to generate a joint probabilities matrix (80*80) with R such that the mean and the standard deviation of this matrix are fixed in advance. It's a symmetric matrix. The main diagonal elements are interpreted as probabilities p ( A i ) that a…

BS.Mira
- 103
- 8
2
votes
1 answer
Pair wise binary comparison - optimizing code in R
I have a file that represents the gene structure of bacteria models. Each row represents a model. A row is a fixed length binary string of which genes are present (1 for present and 0 for absent). My task is to compare the gene sequence for each…

SriniShine
- 1,089
- 5
- 26
- 46
2
votes
2 answers
Setting ID in a pair-wise panel data
I am working with bank-firm level lending panel data (i.e. loans from a group of banks to a group of firms for a country are recorded at a monthly frequency).
I want to conduct panel data FE regression. However, to conduct FE, it is required that I…

Pranav Garg
- 31
- 3