Back to PLS Help

PLS on data of EEG activity
Isa.Tejelo
Posted on 10/20/10 08:16:49
Number of posts: 7
Isa
Isa.Tejelo posts:

Hello... I would like to apply PLS on data of EEG activity... In my case, I have two groups (g1 and g2), both with 5 subject (s1,s2,s3,s4,s5) and two conditions (c1, c2). Then I built my datamat_1st has the shape {1x2 cell} . The rows for a group1, cell {1,1} are; (g1c1s1, g1c1s2,....g1c1s5,g1c2s1,...g1c2s5), and the same for group2. When I run the PLScmd, I have an error :" ??? Undefined function or variable 'datamat_lst'", but in the Workspace of Matlab is my datamat_1st defined. How can I find out if datamat_1st is well built?...Why have I an error? Thank you very much in advance. Best regards, Isa

Replies:

Untitled Post

I'm Online
jshen
Posted on 10/20/10 11:09:30
Number of posts: 291
jshen replies:

I just tested, but could not duplicate your problem. Here's what I did:

datamat_lst = {rand(10,1000),rand(10,1000)}
num_subj_lst = [5 5]
num_cond = 2
plsresult = pls_analysis(datamat_lst, num_subj_lst, num_cond)

Please let me know whether you have problem to run the above scripts.



PLS on data of EEG activity
Isa.Tejelo
Posted on 10/20/10 11:59:50
Number of posts: 7
Isa
Isa.Tejelo replies:

quote:
I just tested, but could not duplicate your problem. Here's what I did:

datamat_lst = {rand(10,1000),rand(10,1000)}
num_subj_lst = [5 5]
num_cond = 2
plsresult = pls_analysis(datamat_lst, num_subj_lst, num_cond)

Please let me know whether you have problem to run the above scripts.

No,  I haven´t  problem to run the above scripts.

 

If I run the PLS with other datamat_1st (with my data), I have problems. My data are exported to Matlab from BrainVision Analyzer in format ASCII,multiplexed (with *.txt). When I run the PLScmd, I have one of these two errors:1-" ??? Undefined function or variable 'datamat_lst'", but in the Workspace of Matlab is my datamat_1st defined.....Or... 2- "??? Error using ==> single.... Conversion to single from cell is not possible.... Error in ==> pls_analysis at 202.... datamat_lst{grp} = single(datamat_lst{grp});". And I don´t  know because they occur... Thanks for helping me. . Best regards, Isa



Untitled Post

I'm Online
jshen
Posted on 10/20/10 12:07:34
Number of posts: 291
jshen replies:

If you want, I can help you to take a look at your data. If that's the case, you need to save your data into a .mat file. Then upload it onto whereever that I can access, and send me the link (please do not send via email).



Untitled Post

I'm Online
nlobaugh
Posted on 10/20/10 12:11:26
Number of posts: 229
nlobaugh replies:

Isa..
we do have the capability to run the EEG analysis in the GUI. If your txt files are channels by timepoints or timepoints by channels, you can read them in after setting up an 'electrode' file.  I can help you set that up if the instructions in the online help are not clear.

I'm wondering if your datamat is in the right format  -

You should have a  2 x 1 cell array for datamat_lst, where each cell is a 'double' array of size Ncondition*Ssubjects x Ttimepoint*Cchannel, where subjects are nested within conditions, one for each group.   If your text files are being loaded as cell arrays, you would need to convert them as you reshape them into a vector to build the datamat for each group..

nancy




PLS on data of EEG activity
Isa.Tejelo
Posted on 10/20/10 13:28:37
Number of posts: 7
Isa
Isa.Tejelo replies:

quote:
If you want, I can help you to take a look at your data. If that's the case, you need to save your data into a .mat file. Then upload it onto whereever that I can access, and send me the link (please do not send via email).

Thanks for helping me...The Link is:   Plscmd@gmail.com.....Password:  isabel11.....


PLS on data of EEG activity
Isa.Tejelo
Posted on 10/20/10 13:44:08
Number of posts: 7
Isa
Isa.Tejelo replies:

quote:
Isa..
we do have the capability to run the EEG analysis in the GUI. If your txt files are channels by timepoints or timepoints by channels, you can read them in after setting up an 'electrode' file.  I can help you set that up if the instructions in the online help are not clear.

I'm wondering if your datamat is in the right format  -

You should have a  2 x 1 cell array for datamat_lst, where each cell is a 'double' array of size Ncondition*Ssubjects x Ttimepoint*Cchannel, where subjects are nested within conditions, one for each group.   If your text files are being loaded as cell arrays, you would need to convert them as you reshape them into a vector to build the datamat for each group..

nancy


Thanks for helping me...I send a Link with my datamat_1st, because I don´t know if I am doing something wrong... 


Untitled Post

I'm Online
jshen
Posted on 10/20/10 13:50:15
Number of posts: 291
jshen replies:

I carefully checked your data, and found 2 problems:

1. datamat_1st should be datamat_lst.mat. This is just a typo, and that's why you have error message "??? Undefined function or variable 'datamat_lst"

2. You have 2 cell arrays to input, that seems right; however, within each cell array, you have another 10 cell arrays:
datamat_lst{1}
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
This is incorrect.

It should look like:
datamat_lst:
    {[10x16000 double]    [10x16000 double]}
When I type datamat_lst{1}, it should give me a 10 by 16000 matrix, which is the datamat for group 1. When I type datamat_lst{2}, it should give me a 10 by 16000 matrix, which is the datamat for group 2.

Please let me know if you have further questions.



Untitled Post
Isa.Tejelo
Posted on 10/20/10 14:43:27
Number of posts: 7
Isa
Isa.Tejelo replies:

quote:
I carefully checked your data, and found 2 problems:

1. datamat_1st should be datamat_lst.mat. This is just a typo, and that's why you have error message "??? Undefined function or variable 'datamat_lst"

2. You have 2 cell arrays to input, that seems right; however, within each cell array, you have another 10 cell arrays:
datamat_lst{1}
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
    [500x32 double]
This is incorrect.

It should look like:
datamat_lst:
    {[10x16000 double]    [10x16000 double]}
When I type datamat_lst{1}, it should give me a 10 by 16000 matrix, which is the datamat for group 1. When I type datamat_lst{2}, it should give me a 10 by 16000 matrix, which is the datamat for group 2.

Please let me know if you have further questions.

Thanks... Please, can you  tell me exactly the order of the columns?.... How can I built it?


Untitled Post

I'm Online
nlobaugh
Posted on 10/20/10 14:52:53
Number of posts: 229
nlobaugh replies:

I would suggest you reshape each matrix to be timepoints within channel (t1c1..t500c1,t1c2...t500c2)..

However, you will have some challenges to visualize the results if you do not use the ERP module in the PLS_GUI

If your 32 channels match the list provided with the 'Edit Channel order' window in the PLSGUI, I would suggest you generate your datamats and run the analysis there
See section  5.3. Creating ERP session file
in the online help

nancy


Untitled Post

I'm Online
jshen
Posted on 10/20/10 14:58:47
Number of posts: 291
jshen replies:

TimePoint within Channel (Electrode). i.e.:
Ch1Tp1 Ch1Tp2 ... Ch2Tp1 Ch2Tp2 ...



Untitled Post

I'm Online
jshen
Posted on 10/20/10 15:07:04
Number of posts: 291
jshen replies:

Nancy is absolute right. I also suggest that you had better use PLSgui to make your life easy.

In case that the limited ERP channels listed in the GUI (BESAThetaPhi, ERP128, ERP256) does not match your situation, it is not a big deal. The main purpose is to provide a better spatial allocation of the channels. In other words, as long as you remember which channel in the GUI matches which channel in your situation, you can choose any of the channel configuration.

Please let me know if you need further help.




Login to reply to this topic.

  • Keep in touch

Enter your email above to receive electronic messages from Baycrest, including invitations to programs and events, newsletters, updates and other communications.
You can unsubscribe at any time.
Please refer to our Privacy Policy or contact us for more details.

  • Follow us on social
  • Facebook
  • Instagram
  • Linkedin
  • Pinterest
  • Twitter
  • YouTube

Contact Us:

3560 Bathurst Street
Toronto, Ontario
Canada M6A 2E1
Phone: (416) 785-2500

Baycrest is an academic health sciences centre fully affiliated with the University of Toronto