Losing labels in import from Stata

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)
tkemeny
Posts: 23
Joined: Mon Sep 07, 2020 2:57 pm

Losing labels in import from Stata

Post by tkemeny »

Hello,

I would like to import a dataset from Stata in which many variables are numerical but represent categorical variables, and with labels attached to give them meaning (see the screenshot example). When I open the data into Jamovi, all the labels are stripped away.

Is there a way to bring the labels in as well somehow?

Thanks,
Tom
Attachments
Stata screenshot of an example variable
Stata screenshot of an example variable
Screen Shot 2020-09-07 at 16.16.10.png (50.23 KiB) Viewed 3204 times
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Losing labels in import from Stata

Post by jonathon »

hi,

can you either attach here the stata file, or send it to contact <at> jamovi.org?

the importing spss file pathway has been thoroughly tested, but stata is less common, and so i won't be surprised if there's the odd issue there. if you can provide me with a file, i can try and figure out what's going on.

with thanks

jonathon
tkemeny
Posts: 23
Joined: Mon Sep 07, 2020 2:57 pm

Re: Losing labels in import from Stata

Post by tkemeny »

Many thanks Jonathon,

I will send a file by email - when I tried to attach the file, the forum gave me an error ("The extension dta is not allowed. The upload was rejected because the uploaded file was identified as a possible attack vector.").

Best,
Tom
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Losing labels in import from Stata

Post by jonathon »

yup, you could probably zip it up and attach, but email works too.

cheers

jonathon
tkemeny
Posts: 23
Joined: Mon Sep 07, 2020 2:57 pm

Re: Losing labels in import from Stata

Post by tkemeny »

Ok - see attached - thanks.
Attachments
USociety_1pct.dta.zip
(75.49 KiB) Downloaded 174 times
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Losing labels in import from Stata

Post by jonathon »

ah, so it looks like stata files have the level labels encoded *after* the data in the file ... spss files have them before, and our importer assumes that they come before ... i'll have to think of a way to handle both scenarios.

thanks for sharing this file with us

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

Re: Losing labels in import from Stata

Post by jonathon »

hi,

thanks for reporting this, and for providing that file. i've made changes to our import procedure, and this will handle labels in stata files. i've taken a conservative approach, so there may still be situations where it doesn't import as expected, but i guess we'll see.

with thanks

jonathon
tkemeny
Posts: 23
Joined: Mon Sep 07, 2020 2:57 pm

Re: Losing labels in import from Stata

Post by tkemeny »

Hi Jonathon,

Just following up on this - for this to work, which version should I have? I'm running Version 1.2.27.0 right now.

Many thanks
Tom
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: Losing labels in import from Stata

Post by jonathon »

hey, you'll need the 1.6.4 ... which i don't think we've released yet. we should push it out in the next couple of days. i think the cloud version is running 1.6.4, so you could try it there:

https://cloud.jamovi.org

cheers

jonathon
tkemeny
Posts: 23
Joined: Mon Sep 07, 2020 2:57 pm

Re: Losing labels in import from Stata

Post by tkemeny »

Many thanks for the quick response. I tried the cloud version and it worked perfectly!

Best,
Tom
Post Reply