jasp-stats / jasp-issues

This repository is solely meant for reporting of bugs, feature requests and other issues in JASP.
58 stars 29 forks source link

[Feature Request]: Biplot in PCA #2501

Open Lourdesmdk opened 8 months ago

Lourdesmdk commented 8 months ago

Description

I didin't find the way of find the sample and variable scores or the biplot

Purpose

The biplot represents the points in the dimension reduced space (principal components)

Use-case

The biplot represents the points in the dimension reduced space (principal components)

Is your feature request related to a problem?

I couldn't find it, some statistical (biostatistical) software performs it.

Is your feature request related to a JASP module?

Factor

Describe the solution you would like

I would love to find the posibility of graph principal components 1, 2, 3 vs 2, 3, etc, adding labels, groups, and vectors for original variables.

Describe alternatives that you have considered

To use another program.

Additional context

No response

TarandeepKang commented 8 months ago

Hi Julius, I'd like to second this request.

biplot.princomp in base R enables producing this kind of plot, but in my opinion, they aren't the best looking. Ggfortify (https://cran.r-project.org/web/packages/ggfortify/vignettes/plot_pca.html) is much nicer.

Gabriel, K. R. (1971). The biplot graphical display of matrices with applications to principal component analysis. Biometrika, 58, 453–467. (https://doi.org/10.2307/2334381). Gabriel, K. R. and Odoroff, C. L. (1990). Biplots in biomedical research. Statistics in Medicine, 9, 469–485. doi:10.1002/sim.4780090502. Tang Y, Horikoshi M, Li W (2016). “ggfortify: Unified Interface to Visualize Statistical Result of Popular R Packages.” The R Journal, 8(2), 474–485. https://doi.org/10.32614/RJ-2016-060.

juliuspfadt commented 7 months ago

Thanks for creating the issue. To clarify, you want to plot the scores for one component against another?

Lourdesmdk commented 7 months ago

Thanks for creating the issue. To clarify, you want to plot the scores for one component against another?

Hello!!!!

Yes, that would help, not only the cases' scores but also the variables' scores too. It would be great to build a "biplot", which is something like this: a graph where the variables are placed as vectors, indicating the increasing direction (head of the vector), the average value (center of the graph), and decreasing direction (bottom of the vector) of each variable, and the cases marked as points. In this example, there are three groups, the red one is different from the green and blue ones, but blue has more extreme higher values compared to the green one. In this ink, there is a free book that easily explains about how to get the biplot (page 20): https://www.fbbva.es/wp-content/uploads/2017/05/dat/DE_2010_biplots_in_practice.pdf

[image: image.png] Best wishes and thank you very much for paying attention to this suggestion.

Lourdes.

-- Dra. Lourdes Suárez Villasmil Biostatistician | Researcher | Data Analyst Reserva de Turnos para Consultas https://calendar.app.google/24YMk8KjUwpDNgFj8 Web | Portafolio https://datafixer.carrd.co/#about

Perfil en LinkedIn https://www.linkedin.com/in/datafixer/ Instagram @zona.datos (Español) https://www.instagram.com/zona.datos/ Instagram @data.fixer (English) https://www.instagram.com/data.fixer/

wpsilvestre commented 4 months ago

@juliuspfadt , is there any development regarding this issue/feature?

Such feature could be implemented to any kind of component analysis, if possible.

As @Lourdesmdk commented, it would be very nice to have the possibility of making biplots of the variables against the factors (such as the example here: PCA variables graph.pdf) and even the cases (pca cases plot.pdf), separately, if possible.

Many thanks for your attention.

juliuspfadt commented 4 months ago

Unfortunately, there is very little development regarding this feature. I dont have much time for it at the moment. Maybe we can find a student to take this over.

wpsilvestre commented 4 months ago

@JohnnyDoorn , @tomtomme , is there any way to help with this issue? Or someone who could help? Many thanks

tomtomme commented 4 months ago

@wpsilvestre sure, if you can code R and Qt, the team is most certainly happy to assist. If you are asking if I could code this... my coding skills are less than stellar...

Lourdesmdk commented 4 months ago

@wpsilvestre What exactly do you need to perform? If you want, write me directly at contact.mdk@gmail.com Best wishes,

Lourdes.

wpsilvestre commented 4 months ago

Dear @tomtomme and @Lourdesmdk , I commented with the hope of finding someone who could handle/see to this issue. Unfortunately, I do not know anything about programming language, especially R. But I appreciate the quick replies and hope for this feature to be added to Jasp in the future.

JohnnyDoorn commented 4 months ago

@wpsilvestre it's definitely noted, and these reminders also help us get an idea of what our users find most useful. While our todo list is getting shorter with each release, I think this particular feature will not be in the upcoming release (scheduled for this month). Maybe in the next release (in fall), depending on the availability of our R-programmers, who are all academics doing this on the side. We are trying to implement a more sustainable model though, so that we can actually hire people who will be fully dedicated to feature requests.

PeterKlaren commented 2 months ago

I do support the option of producing biplots in JASP! The Factor module uses the psych R package which contains functions to actually produce these.