Questions tagged [pairwise]

273 questions
2
votes
2 answers

Obtain the subset of dots with maximal average distance

I have N dots. I know all pairwise distances for them. I need to select K dots from them, such that average pairwise distance will be maximal. I have only dummy idea to iterate trough each dot. Do you have more smart idea how to obtain such a…
zlon
  • 812
  • 8
  • 24
2
votes
2 answers

Pairwise comparisons on lmer using lsmeans or difflsmeans

I am doing a reading experiment, comparing reading times in 2 groups across 4 conditions. I ran a lmer model with reading condition (factor w 4 levels) and group (factor w 2 levels) as the predictors and fixation duration as the dependent variable…
Anna Tsiola
  • 21
  • 1
  • 2
2
votes
4 answers

two numpy arrays into an array of pairwise arrays

I would like to create a matrix of pairwise arrays from two arrays of different length, a and b: a = np.array([1,2,3]) b = np.array([4,5,6,7]) So, c matrix should look like: [[1,4], [1,5], [1,6], ..., [3,7]]
1
vote
4 answers

Get each word with its next word from a space-delimited string

I want to extract two consecutive words starting from each word in a string. $string = "This is my test case for an example." If I explode on each space, I get every word individually, but I don't want that. [ 'This', 'is', 'my', …
azzy81
  • 2,261
  • 2
  • 26
  • 37
1
vote
1 answer

How to efficiently calculate pairwise *differences* between values in a list (tensor) in pythorch?

Given an 1D tensor: tensor([1, 2, 3, 4, 5, 6.]) the expected result is: tensor([-1., -2., -3., -4., -5., -1., -2., -3., -4., -1., -2., -3., -1., -2., -1.]) The 'nearest' solution using the tensor library is to calculate the 1-norm distance.…
dawid
  • 663
  • 6
  • 12
1
vote
1 answer

lmer pairwise comparisons for 3 variables interactions, holm correcting for few planned comparisons instead of 28

I have 3 IVs: Within --> Hand(left,right), Time(pre,post); Between --> Training (treatment, sham) and a continuous DV: RT. I have run a linear mixed effect model to see if there are significant interactions using this line: model1 = lmer(RT ~…
toni
  • 11
  • 1
1
vote
1 answer

Unable to access individual alignment strings in biopython pairwise align

I'm trying to access individual strings in the alignment object which is produced by the pairwise aligner in biopython but not getting anywhere. I'm talking about the already aligned sequences showing gaps, as given by the print(alignment), but…
MaxSense
  • 43
  • 7
1
vote
2 answers

All possible pairs of each list within a list

I have the following code as an example (this is based on pairwise similarity of textual definitions): import pandas as pd df = pd.read_csv("pairings.csv") sample_list = df['fruit'].tolist() And the output of sample_list looks like: ['Apple,…
1
vote
2 answers

Group comparisons path-analysis lavaan

I am currently running a serial medaition where my IV is multicategorical with 3 levels, while my moderators and DV are continuous. I created 2 dummy variables for my IV. Therefore in my output I see hwo they compare for different variabels to their…
1
vote
1 answer

non-parametric manova in R

I created a small example data set: value <- rnorm(100, mean = 100, sd = 36) group <- c(rep(c("A", "B", "C"), 33), "C") gender <- c(rep(c("M", "F"), 50)) test <- cbind(value, group, gender) test <- as.data.table(test) I want to see if the mean…
Nneka
  • 1,764
  • 2
  • 15
  • 39
1
vote
1 answer

How to sum up conditionally columns pairwise on an asymmetric dataset?

Here is a simplified version of my problem: import pandas as pd v1 = [1, 5, 0] v2, v2_tocomb = [2, 4, 9], [0, 1, 0] v3, v3_tocomb = [3, 3, 8], [2, 0, 1] v4, v4_tocomb = [0, 7, 6], [1, 1, 1] v5 = [2, 2, 6] v1_1 = [3, 4, 1] v2_1, v2_tocomb_1 = [4, 2,…
1
vote
2 answers

Match users in pair array but avoid previous matches

I shuffle and pair the user ids as you can see below. /** * @see https://stackoverflow.com/a/12646864 * @param {string[]} array */ const shuffleArray = (array) => { for (let i = array.length - 1; i > 0; i--) { const j =…
alagon
  • 13
  • 2
1
vote
2 answers

Pairwise count of common values in rows of a data.frame

I have a data frame with many rows (>9000) and columns (148). The first column has a unique code for experiments, the other columns are populated with the name of the clones tested in the experiment. I want a matrix that has the number of common…
Ilaria
  • 11
  • 2
1
vote
1 answer

group_by row wise distance between multiple columns

Posting an updated question from my last post as I think my requested output was a bit too complicated group_by edit distance between rows over multiple columns. Here, I have simplified the desired output. I have the following data…
Sandy
  • 1,100
  • 10
  • 18
1
vote
2 answers

Combine lists alternating elements one by one or two by two

I have 4 lists: a = ["a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8"] b = ["b1", "b2", "b3", "b4", "b5", "b6"] c = ["c1", "c2", "c3", "c4", "c5"] d = ["d1", "d2", "d3", "d4", "d5", "d6", "d7"] I need to create a list alternating the elements one…
Giacomo F
  • 74
  • 8