jasp-stats / jasp-issues

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

[Bug]: The Likert scale (answer options) is not fully enumerated. #2669

Open romanogino opened 6 months ago

romanogino commented 6 months ago

JASP Version

0.18.3

Commit ID

No response

JASP Module

Unrelated, Descriptives, Other

What analysis are you seeing the problem on?

No response

What OS are you seeing the problem on?

Windows 11

Bug Description

In my scale of choices, there were from 1 to 6, but no one answered that, they only answered from 2 to 5. So they don't appear in the choices to code, but I need to show that those choices of 1 and 6 were present for the choice. Perhaps there is som activation button that I have checked before...

Expected Behaviour

I expect the entire scale from 1 to 6 to appear, even if some options have not been checked. Imagen de WhatsApp 2024-04-17 a las 15 50 25_86377d1c

Steps to Reproduce

1. 2. 3. ...

Log (if any)

No response

Final Checklist

tomtomme commented 6 months ago

@romanogino At the moment JASP can not know which numbers or strings comprise the full scale of a variable. There is no button to tell JASP "this should be likert scale from 1-6" and no button that could add missing numbers of a scale. This is also a problem for "automatically" reverse coding of variables. I pointed this out here: https://github.com/jasp-stats/jasp-issues/issues/2325

I would not consider this a bug, but a missing feature that probably would need following fields to be set by the user for each variable:

This could make sense for ordinal and scale data. Joris Goosen already explained in #2325 that this might be implemented in the long run. Not in the short run, because it would require quite some work within the GUI.

JorisGoosen commented 6 months ago

I was thinking more along the lines of an R-field where you write a function that converts x -> level you want by applying it in order to the labels as they are. (So the default formula would just be X (maybe better i or level)

This would also allow for non-linear scales etc

JorisGoosen commented 5 months ago

I expect the entire scale from 1 to 6 to appear, even if some options have not been checked.

One thing with this though, is this scale defined somewhere? Was this for instance read from a data file with that information? Because otherwise JASP cant make it up...

romanogino commented 5 months ago

In practice, the Likert scale is predefined and is the most commonly used approach to rank-ordering (ordinal) survey responses; it can also be referred to as a "rating scale". The scale is predefined in the instrument, the data are loaded in xls and transferred to JASP. In SPSS the whole scale can be loaded together with the variable. In JASP, there is no option to indicate an ordinal level if the data is not loaded in the database, because it is considered missing data.

The data were obtained from an xls file, which was created specifically for the analysis.

2024-05-16_085800.

JorisGoosen commented 5 months ago

The question I posed is because the upcoming release supports reading labels etc much better than 0.18.3. Such as reading the scale defined on a variable ;)

However, it still wont be read into the data R gets for the anlysis in all likelihood...

JorisGoosen commented 5 months ago

One could try a nightly from https://static.jasp-stats.org/Nightlies/ to give it a go

It still wont allow for adding labels manually without entering data.

tomtomme commented 5 months ago

@romanogino I have seen this working in those last nightlies. Importing from SAV now also imports the whole scale like defined in SPSS "Values" - even if not all answers were used / are present in data.

Can you confirm?

romanogino commented 5 months ago

I will do it on these days, I have to install the last beta version in a clean laptop.

romanogino commented 5 months ago

I tried JASP 0.19 night version, with Windows 11, a good computer. Video with the test: https://github.com/jasp-stats/jasp-issues/assets/1270242/fee2b4b1-8778-4248-9450-b37e6aca3d81 I tried four files, one with one Likert-scale variable, one with many Likert-scale variables, and two without any Likert variables. Only the files without Likert-scale variables opened.

JorisGoosen commented 5 months ago

Ah, but this is in fact an error ive seen befoire, and thought was solved. Maybe we need to check which version is getting built into JASP.

This indicates that byte encoding error can be because of the file itself: https://github.com/tidyverse/haven/issues/615 Or it could be because we do not have the fix for: https://github.com/WizardMac/ReadStat/issues/263

@RensDofferhoff which versions of readstat are on those buildmachines? Maybe we should make them use the git repo and auto update. Cant we make the buildbot script depend on it ?

Also @romanogino it would help us lot if you could share these files with us. Then we can iron these bugs out before the 0.19 release ^^

romanogino commented 5 months ago

The files used for the test (sav) are not supported here, can not share. Maybe in another way.

shun2wang commented 5 months ago

Hi @JorisGoosen I think it's a different error, do you mean from video: image ,I cannot understand that language... it's looks like a sqlite statement execute error but not related to ReadStat.

RensDofferhoff commented 5 months ago

@JorisGoosen it should be v1.1.9 As @shun2wang said in the video we can see an SQL error. We need to get our hands on SPSS to make similar files I'm afraid :(

shun2wang commented 5 months ago

Hi @romanogino Could you make a "fake data" with your .sav file to reproduce this error in JASP? such as remove sensitive information, obfuscate numbers, insert some random numbers..... and zip that file to attach it here or send to issues@jasp-stats.org

JorisGoosen commented 5 months ago

Hi @JorisGoosen I think it's a different error, do you mean from video: image ,I cannot understand that language... it's looks like a sqlite statement execute error but not related to ReadStat.

This one is a different error, but maybe @romanogino can share the debug log for this sqlite error? Because the actual error is not on the video.

The readstat error is the first one. (byte encoding bla bla)

JorisGoosen commented 5 months ago

@JorisGoosen it should be v1.1.9 As @shun2wang said in the video we can see an SQL error. We need to get our hands on SPSS to make similar files I'm afraid :(

I think @JohnnyDoorn has a license now anyway for the field book. In any case, that might not be enough because the encoding error is caused by the system being in a locale and or the user entering certain values. But we do not know which...

romanogino commented 5 months ago

DATA_SPSS.zip Sorry, I forget that should do zip file with sav. Please, explain me how to find the debug log, to share it. Thanks.

JorisGoosen commented 5 months ago

See: https://github.com/jasp-stats/jasp-desktop/blob/development/Docs/user-guide/logging-howto.md

romanogino commented 5 months ago

Log saved from the files refered: JASP 2024-06-07 14_09_24 Engine 0.zip

shun2wang commented 5 months ago

ah Yes, for first issue which related to ReadStat, in the .sav file self-report it's UTF-8

>readstat Actitud_residente_Cozumel.sav

Format: SPSS binary file (SAV)
Columns: 19
Rows: 196
Format version: 2
Text encoding: UTF-8
Compression: rows
Byte order: little-endian
Timestamp: 04 Dec 2021 11:33

but it encoded as code page 1252 ......so it can be read in R:

library(haven)

dt <- haven::read_sav(file = "Actitud_residente_Cozumel.sav", encoding = "CP1252")