mixed labels in spss file

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
gasper
Posts: 10
Joined: Tue Oct 13, 2020 8:27 am
Location: Slovenia

mixed labels in spss file

Post by gasper »

I use jamovi a lot to import spss files and it works like a charm every time. It's really great and that's why I was surprised to see that it created a mismatch between labels and their variables.

It's not a complete mismatch - some variables get labels right and others don't and I couldn't figure the pattern. Also some missing value codes didn't import as well but this could be connected.

I have here the example file and I first noted mismatch at variable MTSUP (where missing values weren't imported). But then I noted that mismatch was all over the place.

I tried 1.2.27, 1.6.3 and 1.6.8 - it's consistent (at least) :smirk: .

Is it a bug or did we find somethng odd on SPSS side?

Regards,

Gasper
Attachments
spss_view.png
spss_view.png (91.35 KiB) Viewed 2826 times
pisa_small_pia5.zip
(205.03 KiB) Downloaded 184 times
User avatar
jonathon
Posts: 2620
Joined: Fri Jan 27, 2017 10:04 am

Re: mixed labels in spss file

Post by jonathon »

hey,

thanks for reporting. can you spell this out a bit clearly for me, which columns aren't quite right? i'm taking a quick look over it, and nothings jumping out at me.

with thanks

jonathon
User avatar
MAgojam
Posts: 421
Joined: Thu Jun 08, 2017 2:33 pm
Location: Parma (Italy)

Re: mixed labels in spss file

Post by MAgojam »

Hi, guys.
I don't know if it can help us understand this import of @gasper's .sav file.

I opened the file in both jamovi v1.6.8 and SPSS v25 and captured the screenshot that I attach.
SPSS_IMPORT_PROBLEM.PNG
SPSS_IMPORT_PROBLEM.PNG (150.69 KiB) Viewed 2818 times
I refer to three variables (CLCUSE301, CLCUSE302, Deffort) where the Missing encoding in SPPS is the same (Missing = '99', Invalid = '98', N/A = '97').
If in jamovi, I try to change the first '97' which was supposed to be '99' for Missing, it won't let me, but if I try to change the second '97' to '99', it allows me, but it automatically changes also the first '97' in '99'.
At this point it recognizes the Missing, but no longer recognizes the N/A.
Jamovi correctly recognized these variables as Measure type (Nominal) and Data type (Text) since in SPSS they are encoded as Measure (Nominal) and Type (String) and imported the data as described.
If in jamovi I change the Data type from Text to Integer, I can replace the three strings with the corresponding values ​​(99, 98, 97) and the variable is usable correctly.

Greetings,
Maurizio
gasper
Posts: 10
Joined: Tue Oct 13, 2020 8:27 am
Location: Slovenia

Re: mixed labels in spss file

Post by gasper »

If I go from start:
1. variable - CNT label=empty
2. variable - SUBNATIO label=label from CNT (Country code 3 character)
..
4. variable - OECD label= correct!

Some of variables have correct labels, others are shifted (usually for one field).
User avatar
jonathon
Posts: 2620
Joined: Fri Jan 27, 2017 10:04 am

Re: mixed labels in spss file

Post by jonathon »

hey,

i made some changes. could you check the following for me. does this all look correct?
pisa_small_pia5(2).omv.zip
(175.39 KiB) Downloaded 188 times
with thanks

jonathon
gasper
Posts: 10
Joined: Tue Oct 13, 2020 8:27 am
Location: Slovenia

Re: mixed labels in spss file

Post by gasper »

Hey!

Great improvement - first 410 variables have correct labels. But then it starts:

411 variable (AGE) has empty label (should be 'Age of Student')
412 is correct (GRADE)
413 is correct (progn)
414 (ANXMAT) has label from AGE ('Age of Student')
415 (ATSCHL) has label from 414
416 same (shifted for 1 column)
417 same
418 same
419 has label from variable 547 (PV2SCIE)!

I hope you're finding out why this is happening.

And thanks to you, every time.

Cheers,
Gasper
User avatar
jonathon
Posts: 2620
Joined: Fri Jan 27, 2017 10:04 am

Re: mixed labels in spss file

Post by jonathon »

thanks gasper, very helpful.

i'll take a look at these in the next couple of days (but don't be shy about chasing me up if it looks like i've forgotten).

cheers

jonathon
gasper
Posts: 10
Joined: Tue Oct 13, 2020 8:27 am
Location: Slovenia

Re: mixed labels in spss file

Post by gasper »

I just installed jamovi 1.6.12 and tried .sav file from the start of this thread (pisa_small_pia5.sav). I noticed that mixup includes also missing values. Somehow labels (and missing values) get mixed more often when missing values are not integers.
Maybe it's something with dot/comma as decimal separator or the fact that some missing values in SPSS have 2 and others 4 decimal places...

Anyway, here are the results (it took a while :tired_face: ):

1 CNT missing
2 SUBNATIO has label from 1 (CNT)
3 STRATUM has label from 2 (SUBNATIO)
4 OECD correct
5 NC has label from 3 (STRATUM)
6 SCHOOLID has label from 7 (StIDStd)
7 StIDStd has label from 379 (HOSTCUL)
8 ST01Q01 correct
9 ST02Q01 correct
10 ST03Q01 correct label but under missing values it's 97 twice, but 99 missing
58 ST26Q15 has label from 5 (NC)
59 ST26Q16 has label from 58 (ST26Q15)
60 ST26Q17 has label from 59 (ST26Q16)
347 AGE has label from 60 (ST26Q17)
348 GRADE correct
349 progn has label from 347 (AGE)
350 ANXMAT has label from 349 (progn)
351 ATSCHL has label from 350 (ANXMAT)
352 ATTLNACT has label from 351 (ATSCHL)
353 BELONG has label from 352 (ATTLNACT)
354 BFMJ2 has label from 353 (BELONG)
355 BMMJ1 has label from 442 (PV2SCIE)
356 CLSMAN has label from 354 (BFMJ2)
357 COBN_F has label from 356 (CLSMAN)
358 COBN_M has label from 357 (COBN_F)
359 COBN_S has label from 358 (COBN_M)
360 COGACT has label from 359 (COBN_S)
361 CULTDIST has label from 410 (PERSEV)
362 CULTPOS has label from 360 (COGACT)
363 DISCLIMA has label from 362 (CULTPOS)
364 ENTUSE has label from 355 (BMMJ1)
365 ESCS has label from 363 (DISCLIMA)
366 EXAPPLM has label from 365 (ESCS)
367 EXPUREM has label from 366 (EXAPPLM)
368 FAILMAT has label from 364 (ENTUSE)
369 FAMCON has label from 367 (EXPUREM)
370 FAMCONC has label from 369 (FAMCON)
371 FAMSTRUC correct
372 fisced correct
373 HEDRES has label from 370 (FAMCONC)
374 HERITCUL has label from 361 (CULTDIST)
375 hisced correct
376 hisei has label from 368 (FAILMAT)
377 HOMEPOS has label from 373 (HEDRES)
378 HOMSCH has label from 436 (ANCSUBNORM)
379 HOSTCUL has label from 374 (HERITCUL)
380 ICTATTNEG has label from 378 (HOMSCH)
381 ICTATTPOS has label from 380 (ICTATTNEG)
382 ICTHOME has label from 377 (HOMEPOS)
383 ICTRES has label from 382 (ICTHOME)
384 ICTSCH has label from 383 (ICTRES)
385 IMMIG correct
386 INFOCAR has label from 381 (ICTATTPOS)
387 INFOJOB1 has label from 386 (INFOCAR)
388 INFOJOB2 has label from 387 (INFOJOB1)
389 INSTMOT has label from 376 (hisei)
390 INTMAT has label from 389 (INSTMOT)
391 iscedd correct
392 iscedl correct
393 iscedo correct
394 LANGCOMM correct
395 LANGN has label from 384 (ICTSCH)
396 LANGRPPD correct
397 LMINS correct
398 MATBEH has label from 390 (INTMAT)
399 MATHEFF has label from 398 (MATBEH)
400 MATINTFC has label from 399 (MATHEFF)
401 MATWKETH has label from 400 (MATINTFC)
402 misced correct
403 MMINS correct
404 MTSUP has label from 395 (LANGN)
405 OCOD1 has label from 404 (MTSUP)
406 OCOD2 has label from 405 (OCOD1)
407 OPENPS has label from 388 (INFOJOB2)
408 OUTHOURS correct
409 PARED correct
410 PERSEV has label from 407 (OPENPS)
411 REPEAT correct
412 SCMAT has label from 406 (OCOD2)
413 SMINS correct
414 STUDREL has label from 412 (SCMAT)
415 SUBNORM has label from 401 (MATWKETH)
416 TCHBEHFA has label from 414 (STUDREL)
417 TCHBEHSO has label from 416 (TCHBEHFA)
418 TCHBEHTD has label from 417 (TCHBEHSO)
419 TEACHSUP has label from 418 (TCHBEHTD)
420 TestLANG has label from 419 (TEACHSUP)
421 TIMEINT correct
422 USEMATH has label from 415 (SUBNORM)
423 USESCH has label from 422 (USEMATH)
424 WEALTH has label from 420 (TestLANG)
425 ANCATSCHL has label from 424 (WEALTH)
426 ANCATTLNACT has label from 425 (ANCATSCHL)
427 ANCBELONG has label from 426 (ANCATTLNACT)
428 ANCCLSMAN has label from 427 (ANCBELONG)
429 ANCCOGACT has label from 428 (ANCCLSMAN)
430 ANCINSTMOT has label from 423 (USESCH)
431 ANCINTMAT has label from 430 (ANCINSTMOT)
432 ANCMATWKETH has label from 431 (ANCINTMAT)
433 ANCMTSUP has label from 429 (ANCCOGACT)
434 ANCSCMAT has label from 433 (ANCMTSUP)
435 ANCSTUDREL has label from 434 (ANCSCMAT)
436 ANCSUBNORM has label from 433 (ANCMATWKETH)
437 PV1MATH has label from 435 (ANCSTUDREL)
438 PV2MATH has label from 437 (PV1MATH)
439 PV1READ has label from 438 (PV2MATH)
440 PV2READ has label from 439 (PV1READ)
441 PV1SCIE has label from 440 (PV2READ)
442 PV2SCIE has label from 441 (PV1SCIE)

I hope we get to the bottom of this.

Gasper
User avatar
jonathon
Posts: 2620
Joined: Fri Jan 27, 2017 10:04 am

Re: mixed labels in spss file

Post by jonathon »

yup, i haven't forgotten gasper ... will take a look soon.

cheers

jonathon
Post Reply