raphaelvallat on develop
Removed AppVeyor badges (compare)
raphaelvallat on develop
Add --cov to GH Actions (compare)
@raphaelvallat ,Thanks for your solution. this is my code still im getting same error .this is my code-:pip install pandas
pip install pingouin
pip install xlrd
import pandas as pd
from pandas import DataFrame, read_csv
import matplotlib.pyplot as plt
import pandas as pd
file = r'C:\Users\rock\Desktop\lance\Initial Data.xls'
df = pd.read_excel(file)
print(df)
import numpy as np
import pingouin as pg
data = pdata = pg.read_dataset('df')
icc= pg.intraclass_corr(data=data, targets='Question', raters='test_rater_1',
ratings='correct_rating')
print(icc)
note : In my dataset i have questions, ratesrs, ratings and correct_ratings.
Hello everyone. I am really happy to find such a great and straight-forward package for statistics, if you contributed to it then I'd like to thank you.
I have a question regarding the post-hoc tests. I am performing an analysis using a mixed anova (between: treatment/placebo, within: first_day/second_day....). I wish to conduct a pairwise comparison, with bonferroni correction, but I fail to do so in pingouin. Since I am using a strict adjustment, I would like to minimize the number of posthocs, so for five days, I want to perform 5 comparisons:
placebo, first day VS experimental first day
placebo, second day VS experimental second day
....
placebo, fifth day VS experimental fifth day
When I use defaults in .pairwise_ttests, It performs all possible combination of comparisons, and most likely adjust the p value, for their number...
within_first=False
. Importantly, the p-values are corrected separately for each of these three effects: within, between and interaction. Now, if you want to apply the p-values correction only on a subset of comparisons, I'd suggest you get the uncorrected p-values from the output dataframe, select only the ones that you want, and then use the pingouin.multicomp function to correct for multiple comparisons. Hope that makes sense. Thanks!
Hi everyone, I'm using the pairwise T-test function of the form pg.pairwise_ttests(dv='dv', within=['iv1', 'iv2'], subject='id', data=df), and I get the error: TypeError: 'int' object is not iterable. Are two within-subject factors not supported? Thank you in advance!
I'm facing the same problem. pg.mixed_anova() runs on the same dataframe and arguments so I'd guess the dataframe is fine. I was wondering if there was a solution to this, and if so, could you share it with me?
Hi @merjekrepo , can you please try without any p-values correction and send the screenshot again? The difference here is that SPSS calculates all the permutation of pairwise T-tests (ttest(a, b) is considered different than ttest(b, a)), while Pingouin only calculates the combinations (only ttest(a, b) is calculated). I do think that Pingouin's behavior is more adequate, especially when calculating corrected p-values because the p-value does not change when you do ttest(a, b) or test(b, a) so you end up with a lot of duplicate p-values in SPSS.
@raphaelvallat I think what you mean without p-values correction is the LSD (Least Significant Difference) in SPSS. I am sending the .htm file which includes those results along with other output.
Hi. I am getting issues with the ICC function. It works nicely with the example dataset data = pg.read_dataset('icc')
but when I use my data I get the error: AssertionError: Data must have at least 5 non-missing values.
I cannot see though any difference in the input data type. What am I doing wrong?
Code example:
n_val = 100
val_a = np.random.rand(1, n_val)
val_b = val_a + 0.6*np.random.rand(1, n_val)
data_icc = pd.DataFrame({'test_run': ['test_a']*n_val + ['test_b']*n_val,
'efr_value': np.concatenate((val_a[0], val_b[0]), axis=0),
'rater': ['A']*2*n_val})
icc = pg.intraclass_corr(data=data_icc, targets='test_run', raters='rater', ratings='efr_value').round(3)
You can see an example of the data next:
val_a
) and another one for day 2 (retest, or val_b
). So, in reality, there are no raters, but just two sets of measurements. Is there any workaround in your function for raters k = 1? Or do you have any idea how to run your ICC for just 2 arrays?
n_val = 100
val_a = np.random.rand(1, n_val)
val_b = val_a + 0.6*np.random.rand(1, n_val)
data_icc = pd.DataFrame({'targets': np.concatenate((np.arange(1, n_val+1, 1), np.arange(1, n_val+1, 1)), axis=0),
'efr_value': np.concatenate((val_a[0], val_b[0]), axis=0),
'test_session': ['test_a']*n_val + ['test_b']*n_val})
#Pearson
print('Pearson')
print(pg.corr(x=val_a[0], y=val_b[0], method='pearson'))
#ICC
print('\n\nICC')
print(pg.intraclass_corr(data=data_icc, targets='targets', raters='test_session', ratings='efr_value').round(3))