by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • May 23 00:52
    raphaelvallat labeled #97
  • May 23 00:52
    raphaelvallat assigned #97
  • May 23 00:52
    raphaelvallat commented #97
  • May 22 20:49
    adam2392 opened #97
  • May 22 04:49

    raphaelvallat on develop

    Returns NaN in bicor if mad(x) … (compare)

  • May 21 16:20

    raphaelvallat on develop

    flake8 (compare)

  • May 21 16:09

    raphaelvallat on develop

    Update partial_corr to assert t… Merge pull request #96 from jne… Merge branch 'master' into deve… (compare)

  • May 21 16:08

    raphaelvallat on master

    Update partial_corr to assert t… Merge pull request #96 from jne… (compare)

  • May 21 16:08
    raphaelvallat closed #96
  • May 21 16:08
    raphaelvallat commented #96
  • May 21 11:38
    codecov[bot] commented #96
  • May 21 11:38
    codecov[bot] commented #96
  • May 21 11:36
    codecov[bot] commented #96
  • May 21 11:27
    jnecus opened #96
  • May 21 00:36

    raphaelvallat on develop

    Added support for biweight midc… (compare)

  • May 18 19:23

    raphaelvallat on develop

    Use T instead of Z distribution… (compare)

  • May 18 07:35

    raphaelvallat on develop

    Use @ instead of .dot (compare)

  • May 18 07:24
    raphaelvallat commented #95
  • May 18 07:10

    raphaelvallat on develop

    Major: First working version of… (compare)

  • May 16 07:19

    raphaelvallat on develop

    Updated formula for CLES (compare)

Raphael Vallat
@raphaelvallat
Thanks for your sharp eyes @manfredh_twitter ! So indeed I think there are two separate issues here:
1) The y-label is not correct, it should be X - Y
2) For some reasons, the figure on Pingouin's website were not updated when I released the latest version.
I'll try to fix that soon!
manfred hammerl
@manfredh_twitter
i understand. but it was Y - X up to version 0.2.9. so X - Y is new in version 0.3.0?
so it's only another depiction. or is there some deeper meaning?
Raphael Vallat
@raphaelvallat
X - Y is indeed new. I was just trying to get as close as possible, for testing purposes, as the Matlab version of this function by Guillaume Rousselet. The quantiles are also estimated using a robust method (Harrel-Davis) in v0.3.0.
manfred hammerl
@manfredh_twitter
yes, i recognised the estimation of quantiles (in the old version the real quantiles where shown in the figure). this is something i have to get used to...
Linden Parkes
@LindenParkes_twitter
Hi pingouin users! I'm working with the mediation_analysis function and am wondering if there is any way to incorporate repeated measures data? Perhaps via mixed effects?
Currently, I have X_t1, M_t1, and Y_t2 as my variables (where _t1 and _t2 represents the variable assessed at timepoint 1 or timepoint 2, respectively). If I only use these three variables, then the model is fine because no two variables have dependency due to repeated measurement (i.e., I'm only using Y_t2, not Y_t1 and Y_t2 in model; similarly, I only use X_t1, not X_t1 and X_t2). But I would like to include Y_t1 as a covariate, which introduces correlated data into the model.
Raphael Vallat
@raphaelvallat
Hi @LindenParkes_twitter! Unfortunately, this is not possible right now in Pingouin, and I doubt that it will be in the near future. From my understanding, there does not seem to be a gold standard to do mediation analyses with repeated measures, even though some methods have been developed in recent years (e.g. http://afhayes.com/public/aps2015mh.pdf). Alternatively, you can perhaps regress your covariate Y_t2 to all the other variables separately, get the residuals, and then apply a mediation on the residuals...?
Linden Parkes
@LindenParkes_twitter
Hi @raphaelvallat . no problem, thanks for letting me know. Yes, my plan B was just residualize Y_t2 with respect to Y_t1 prior to running the model. I presume you meant to say Y_t1 instead of Y_t2 above?
Raphael Vallat
@raphaelvallat
Indeed!
Raphael Vallat
@raphaelvallat
Hi @manfredh_twitter ! I just pushed a commit on the develop branch to fix the plot_shift function, which now returns the Y - X quantiles (in other words, I did not change the label to X - Y, but instead I changed the code to calculate the Y - X quantile, as it was before v0.3.0, but still keeping the robust estimator implemented in v0.3.0). This will be released in the next stable version of Pingouin, but if by any chance you can try the new function on your own data with the develop version of Pingouin (cloned from GitHub, then switch to the develop branch then python setup.py develop), that would be fantastic! Thank you! Commit: raphaelvallat/pingouin@774a5c4
manfred hammerl
@manfredh_twitter
grafik.png
it works! btw: thats my own implementation of shift plot (for personal use), so that i can add labels and change colors...
np.random.seed(42)
x = np.random.normal(5.5, 2, 50)
y = np.random.normal(6, 1.5, 50)
fig = sp.shift_plot(x, y, n_boot=5000, percentiles=[25, 50, 75],
ci=0.95, show_median=True, show_mean=False, violin=True,
xlab="Item X", ylab="Item Y", score="Preferenceranking",
size=2)
Raphael Vallat
@raphaelvallat
Amazing, thanks @manfredh_twitter ! Could you share your custom script with me? Or even, if you think these are valuable changes, please feel free to make a PR to Pingouin!
manfred hammerl
@manfredh_twitter
i'll email you the script
manfred hammerl
@manfredh_twitter
done
garincle
@garincle
Hi, using the last version of pingouin I have a problem with plot_rm_corr. if I use y='23b' i get 23 b
^
SyntaxError: invalid syntax
23 b
   ^
SyntaxError: invalid syntax
this name worked perfectly in rm_corr
I get also this error for other strings. I don't understand why some are ok and other not?
tks for your help!
garincle
@garincle

region = '23b'

pg.plot_rm_corr(data=result, x='age', y=region, subject='ID', legend=True,
kwargs_facetgrid=dict(height=4.5, aspect=1.5,
palette='Spectral'))

garincle
@garincle
Screenshot at 11-01-42.png
Raphael Vallat
@raphaelvallat
Hi @garincle, this is surprising. First, the error is not caused by Pingouin but by an internal call to statsmodels and patsy. I'd therefore recommend you upgrade these two libraries. Second, a "b" before a string means that the string is encoded as bytes. However, in this case the "b" is at the end of the string so I really don't see why you would get an error here. Could you send a list of strings that work and strings that do not work? Anyway, for now I think the quickest fix is to rename your variable (e.g. y="Region"). Thanks
garincle
@garincle
godd idea, thank you

Don't works

8Bm
23c
14r
11l
24a_prime

works

STGr
CA1
Clear
MGad
MGmc
MGz
MGpd
OT
Iapl
Ri

it seems that starting with a number cause the problem
all packages are already up to date
Raphael Vallat
@raphaelvallat
Ok I'll add a warning in future releases of Pingouin then! I'm guessing that Patsy or Statsmodels are trying to convert the string to a number when this latter starts with a number, hence the error. Thanks for pointing this out
garincle
@garincle
np, thanks for answering!
ASHIS NANDY
@pharm.ashis_gitlab
How can I install penguin with NumPy, SciPy, Pandas, Pandas-flavor, Matplotlib, Seaborn
Outdate etc?
Raphael Vallat
@raphaelvallat
Hi @pharm.ashis_gitlab , you can install Pingouin and all required dependencies with pip, for that just type pip install pingouin -U in your terminal or Anaconda prompt.
Nathalia Torres Jimenez
@NathaTJ
Hi Raphael, thank you so much for creating Pigouin - I've found it extremely useful! I have one question regarding the mixed_anova function, could it work for N-ways mixed-ANOVA (i.e., 3-way mix ANOVA)? The documentation for the mixed_anova, doesn't state that it's intended for N-ways, so I'm guessing it is only intended to perform 2-ways, is that correct? Thanks!
Raphael Vallat
@raphaelvallat
Hi @NathaTJ ! Thanks so much for the feedback, I appreciate it! The mixed_anova function only accepts 2-way mixed design (e.g. one within and one between factor). I want at some point to have more than 2-ways but I doubt this will be implemented in the near future. For now, I'd recommend using R (e.g.ezANOVA package), or the JASP or JAMOVI free softwares. Thank you!
Nathalia Torres Jimenez
@NathaTJ
Hi @raphaelvallat, thank you for the prompt response - I very much appreciate the time. Thank you for clarifying that the mixed_anova function only accepts 2 factors (BW), and informing me that it may not be implemented in the near future. I will take your advice and implement the 3-way mix Anova with ezANOVA package in R. Thank you!
R M
@RM_04_gitlab
@manfredh_twitter Hi. I am also interested in this. Would love to change the colour of plot_shift to black and white - do you know how to do this?
manfred hammerl
@manfredh_twitter
hi @RM_04_gitlab i adapted the code of the shift plot module a little bit last year so that i can design the figure. i also emailed @raphaelvallat my version. if it's ok from raphaels point i can email you the code. or maybe he plans to implement some design features himself and then everybody has it. i'll wait for his reply on that before i send out changed versions of his work.
R M
@RM_04_gitlab
Wonderful. Thank you so much. Take your time, and let me know when you know.
Ava Brueggeman
@abrueggeman
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!
Raphael Vallat
@raphaelvallat
Thanks for your consideration @manfredh_twitter ! No problem in sharing your code!
Hi @abrueggeman ! 2 within subject factors are supported by this function so it would work. Can you check that your variable df is a Pandas DataFrame? Can you also share a screenshot of the full error message? Thanks
Ava Brueggeman
@abrueggeman
Hi Raphael, here is the error screenshot
image.png
The data variable is a Pandas DataFrame. Using the exact same parameters with rm_anova works fine.
Ava Brueggeman
@abrueggeman
When I try it with your example dataset "data = pg.read_dataset('rm_anova')", it works fine. Perhaps there is something wrong with my particular DataFrame?
Raphael Vallat
@raphaelvallat
Hmmm, that's surprising @abrueggeman . If it's not private, could you perhaps send me a copy of your pandas DataFrame via direct message so that I can have a more in-depth look? Thanks
Ava Brueggeman
@abrueggeman
Sure, I've just sent it to you now. Thanks a lot for your help.
TiTo101
@TiTo101
Hi, I'd like to perform a mediation analysis on panel data. From the instructions I'm unsure whether that is possible using pingouin.mediation_analysis. I'm able to perform the mediation analysis on my data but the results are slightly different to what I'd get calculating everything "manually"
TiTo101
@TiTo101
And the panel data should be analyzed with a fixed effects OLS regression