Page 1 of 1

'invalid stoi argument' - pasting data into MLwiN

Posted: Mon Feb 01, 2021 3:37 pm
by js222211
I get this message every time I click 'Paste' after copying and pasting my dataset from Excel into MLwiN. Can anyone explain why this is happening or how I can stop it? The data consists only of three columns, two categorical and two numerical with no missing values.

Many thanks.

Re: 'invalid stoi argument' - pasting data into MLwiN

Posted: Tue Feb 02, 2021 3:09 pm
by ChrisCharlton
Are you pasting via the Edit->Paste menu, or the Paste button in the Names window?

Do you have column names in Excel, and if so what are they set to?

What are the possible category values that you data can take?

Re: 'invalid stoi argument' - pasting data into MLwiN

Posted: Wed Feb 03, 2021 10:35 am
by js222211
Hi Chris, thank you for your reply.

The issue appears to have been that it didn't like the categorical data, which was a handful of different country codes (e.g. FRA, GBR). I changed them to numbers and it worked, do you know why this is?

Re: 'invalid stoi argument' - pasting data into MLwiN

Posted: Wed Feb 03, 2021 11:44 am
by ChrisCharlton
It's hard to say the exact cause without seeing the data however from the error message it may be that it is interpreting some of the lines of data as MLwiN commands. If this was the case then it might be seeing the first column as the command with subsequent columns as command arguments and the falling over when these do not match the expected format. If re-ordering the columns makes a difference to whether it works for you then this would support the hypothesis.