Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement Request: Allow JASP to run SPSS Syntax #119

Closed
whimsydiddles opened this issue Nov 17, 2017 · 14 comments
Closed

Enhancement Request: Allow JASP to run SPSS Syntax #119

whimsydiddles opened this issue Nov 17, 2017 · 14 comments
Assignees
Labels
Component: R Syntax Related to Syntax Feature Request Stale Issues and pull requests that have not had recent interaction Stale-closed Closed due to inactivity Waiting for requester If waiting for a long time it is reasonable to close an issue

Comments

@whimsydiddles
Copy link

Allow JASP to run SPSS Syntax

  • Enhancement: Enable JASP to run SPSS sytnax.
  • Purpose: This will allow users who have received syntax for replication of a study to properly analyze the data as the researchers did.
@EJWagenmakers
Copy link
Collaborator

Now that is an interesting suggestion! We have some bigger syntax-fish to fry first, and this is a non-trivial idea, but let's see where we stand after frying said fish.

@akashrajkn akashrajkn changed the title Enhancement Request Enhancement Request: Allow JASP to run SPSS Syntax Nov 22, 2017
@haevalencia
Copy link

This project does this work (converts the SPSS syntax to R code), however, it complies with the task of being able to replicate analysis.

@JorisGoosen JorisGoosen transferred this issue from jasp-stats/jasp-desktop Nov 13, 2018
@Stephan-N
Copy link

Related to this, it would be great if jasp could produce syntax (at least R, or also spss, or both) by klicking on a "paste" button in the menues like in SPSS. Moreover, in SPSS, it is possible to display syntax directly in the output.

(Reason: This is the pivotal feature that it would need to be able to replace SPSS in our courses. And one has to store some kind of syntax together with the results to make analyses reproducible. )

@EJWagenmakers
Copy link
Collaborator

The construction of R syntax mode is now our top priority. SPSS syntax is something we may consider when that's done.

@tomtomme
Copy link
Member

tomtomme commented Jan 4, 2024

@whimsydiddles @Stephan-N
R-Syntax mode is now available since 0.17 :)

@tomtomme tomtomme added the Component: R Syntax Related to Syntax label Feb 10, 2024
@tomtomme
Copy link
Member

tomtomme commented Mar 6, 2024

@whimsydiddles @Stephan-N @haevalencia @EJWagenmakers
Currently some of my colleagues also face the challenge converting huge SPSS Syntax codebases to JASP workflows. We solve this via CoPilot. One example via bing.con CoPilot in creative mode :

I have a very important task. For my PhD I need to convert SPSS Syntax into a JASP point and click workflow / guide. At the end comes the SPSS Syntax that needs to be translated. Please make sure to be precise in translating it and to not include options that are not available in JASP. Also please state, if you do not know how to convert a certain piece of Syntax. Thx! Here the Syntax:

GLM tru_enc_exp_hi_xn_cor_all tru_enc_exp_lo_xn_cor_all BY load
/WSFACTOR=trustworthiness 2 Polynomial
/METHOD=SSTYPE(3)
/POSTHOC=load(LSD BONFERRONI)
/EMMEANS=TABLES(OVERALL)
/EMMEANS=TABLES(load) COMPARE ADJ(LSD)
/EMMEANS=TABLES(trustworthiness) COMPARE ADJ(LSD)
/EMMEANS=TABLES(loadtrustworthiness) COMPARE(load) ADJ(LSD)
/EMMEANS=TABLES(load
trustworthiness) COMPARE(trustworthiness) ADJ(LSD)
/PRINT=DESCRIPTIVE ETASQ HOMOGENEITY
/CRITERIA=ALPHA(.05)
/WSDESIGN=trustworthiness
/DESIGN=load.

CoPilots answer

Hello, this is Copilot. I can try to help you with converting SPSS Syntax into a JASP point and click workflow / guide. However, I cannot guarantee that the conversion will be accurate or complete, as JASP and SPSS have different features and options. You should always check the results and the assumptions of the analysis before drawing any conclusions. Here is my attempt to convert your SPSS Syntax into a JASP point and click workflow / guide:

  1. Open JASP and load your data file.
  2. Go to the ANOVA tab and select Repeated Measures ANOVA.
  3. In the Repeated Measures Factors box, enter the name of your within-subjects factor (trustworthiness) and the number of levels (2). Click Add.
  4. In the Repeated Measures Cells box, drag and drop your dependent variables (tru_enc_exp_hi_xn_cor_all and tru_enc_exp_lo_xn_cor_all) into the corresponding cells.
  5. In the Between-Subject Factors box, drag and drop your between-subjects factor (load) from the left panel.
  6. In the Model box, select Custom and check the main effects and the interaction of your factors.
  7. In the Post Hoc Tests box, check the box for your between-subjects factor (load) and select the LSD and Bonferroni methods for adjusting p-values.
  8. In the Marginal Means box, check the boxes for your factors and their interaction. Select the LSD method for adjusting p-values and check the box for plotting the interaction with error bars.
  9. In the Additional Options box, check the boxes for Descriptive statistics, Effect size, and Homogeneity tests.
  10. In the Bayesian Analysis box, check the box for Bayesian Repeated Measures ANOVA if you want to perform a Bayesian analysis. You can adjust the prior model probabilities and the prior distribution for the fixed effects.
  11. Click the green arrow at the top right corner to run the analysis. You should see the output in the right panel, which includes tables and plots of your results. You can also export or copy the output to your report..

Quelle: Unterhaltung mit Bing, 6.3.2024
(1) JASP - A Fresh Way to Do Statistics. https://jasp-stats.org/.
(2) JASP vs. SPSS - JASP - Free and User-Friendly Statistical Software. https://jasp-stats.org/2017/11/01/jasp-vs-spss/.
(3) SPSS Converter — SPSS Converter 0.1.1 documentation. https://spss-converter.readthedocs.io/en/latest/index.html.
(4) Enhancement Request: Allow JASP to run SPSS Syntax #119 - GitHub. https://github.com/jasp-stats/jasp-desktop/issues/2173.
(5) de.wikipedia.org. https://de.wikipedia.org/wiki/SPSS.

We can see, that the AI got a little too creative in step 11 and halucinates about the LSD method, which JASP does not offer. The rest is pretty accurate and does only need minor improvements. Thus the AI gives a nice starting point.

I also tried translating the SPSS Syntax into the JASP specific R-Code, but CoPilot was not yet trained on that and refused. JASPs R Syntax feature is to new.

So this is certainly not an efficient way to convert a big SPSS codebase, but it is one that works mostly. Thus for smaller student projects and thesis, this could be good enough. Larger science projects would need to stay with SPSS or convert via the more precise: translateSPSS2R or SPSStoR.

Sooo....
Are these hints helpful enough to satisfy this feature request?

Related
#71

@tomtomme tomtomme added Waiting for requester If waiting for a long time it is reasonable to close an issue Stale Issues and pull requests that have not had recent interaction and removed Waiting for requester If waiting for a long time it is reasonable to close an issue labels Mar 6, 2024
@tomtomme tomtomme added Waiting for requester If waiting for a long time it is reasonable to close an issue and removed Stale Issues and pull requests that have not had recent interaction labels May 25, 2024
@tomtomme
Copy link
Member

@whimsydiddles @Stephan-N @haevalencia @EJWagenmakers
Anyone with an opinion on this one?
Should we still try to import and run SPSS syntax? See my points above.

@haevalencia
Copy link

Sooo....
Are these hints helpful enough to satisfy this feature request?

In my case no. At my University (and I also know several others) the use of AI is not allowed and basically they try to use other types of more traditional software tools. The importance of importing SPSS systaxis is that it is still the de facto standard and replicability is important, added to the fact that there are already a large number of public databases with research with SPSS syntax and data.

Basically we are still trying to replace SPSS with Jasp, but having reading and interoperability elements covered are essential.

@EJWagenmakers
Copy link
Collaborator

It would be nice to have, but it would be a huge endeavor. Also, it would not convince teachers to switch -- if they say that this is a deal-breaker, they are just looking for any excuse, and after we offer SPSS syntax they will find something else that is supposedly a deal-breaker. Just having the unbelievers actually open JASP is more compelling than providing SPSS code. At the moment all our attention is on the R code, which we are putting a lot of effort in.

@haevalencia
Copy link

haevalencia commented May 27, 2024

@EJWagenmakers I agree with you, but simply making so many assumptions is too much. I simply gave my opinion regarding the use of AI and a specific (and verifiable) use case, which is the databases available in SPSS and the replicability that allows the use of sharing the syntax of the procedures carried out in one or more investigations. I never said that it is a decisive factor to change, since we are currently using Jasp for undergraduate, graduate and diploma courses in psychology and social sciences in general. We simply still have to keep SPSS available and teach it because the replacement is not complete (And it doesn't have to be).

My point was to answer if it is still useful to consider this functionality request and it is yes, of course. I also think R is the way to go, but interoperability and ease of use - at least for me - is important.

Cheers

@EJWagenmakers
Copy link
Collaborator

OK. I did not mean to imply that you held a particular opinion on this issue.
It is just that this is a huge effort, and we have to make a cost-benefits analysis.

@tomtomme
Copy link
Member

tomtomme commented May 27, 2024

@whimsydiddles

In my case no. At my University (and I also know several others) the use of AI is not allowed and basically they try to use other types of more traditional software tools.

I understand, but this answers only part of my post above. I try again. To convert SPSS syntax there are 2 options I see:

a) for teaching / smaller code snippets: Use AI assisted translation. Currently forbidden at you university, but in the long term not avoidable. E.g. I did not hear of any university that forbids DeepL for translation and this use case is nothing else but translation. But yes, currently this option is unavailable for you, I understand that.

b) for research / larger code bases: something like translateSPSS2R or SPSStoR - but probably more up to data. Have you tried those packages or are there any newer ones? I could not find one. If those are outdated and if there are no alternatives, then it certainly would be a huge undertaking for us.

The importance of importing SPSS systaxis is that it is still the de facto standard and replicability is important, added to the fact that there are already a large number of public databases with research with SPSS syntax and data.

c) This is a new topic I think. So many projects rely on SPSS syntax and give accesss to it, sure. Thats good. But I cannot see how this is important for replicability outside of SPSS. If you need to replicate SPSS results, you would need to rely on SPSS, except for basic stuff like t-Tests. Because no translation layer (if AI based or not) could exactly translate SPSS to R - because SPSS is not open source. Nobody outside of IBM knows exactly what SPSS syntax does compute and how - except for the basic stuff that might already be covered by SPSStoR and translateSPSStoR.
Sure, often you can reverse engineer results from complex projects because there is some documentation, but also often there will be no exact match / path from SPSS to R because of missing documentation or because the best matching R-package still computes something in a slightly different way.

Basically we are still trying to replace SPSS with Jasp, but having reading and interoperability elements covered are essential.

d) Some parts of SPSS will be replaced by JASP or jamovi. Some parts will be replaced by RStudio especially syntax driven research. Many reading and interoperability elements are already covered by one or the other (like importing SAV files). But porting most current research - at least for more complex analyses which heavily relie on SPSS syntax - to R seems impossible if there is not yet a good R package that can translate current versions of SPSS syntax. Thus such projects would need to stick to SPSS. And new research projects then would need to be set up with R from the start.

e) I know this is a huge ask: But if you have an idea, how we could proceed / how we could make such a thing possible - in a realistic way - that would not need many developers and years - then I am all ears! Only then "it is still useful to consider this functionality request" as you argue. If nobody has such an idea, then the cost-vs-benefit calculation does not look good, I am afraid.

Copy link

github-actions bot commented Jul 9, 2024

This issue will be automatically closed in 42 days due to inactivity. Feel free to leave a comment if you believe this is still relevant.

@github-actions github-actions bot added the Stale Issues and pull requests that have not had recent interaction label Jul 9, 2024
Copy link

Automatically closed due to inactivity.

@github-actions github-actions bot added the Stale-closed Closed due to inactivity label Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: R Syntax Related to Syntax Feature Request Stale Issues and pull requests that have not had recent interaction Stale-closed Closed due to inactivity Waiting for requester If waiting for a long time it is reasonable to close an issue
Projects
None yet
Development

No branches or pull requests

8 participants