cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
tlsimons
Level I

Combining two Data files

Hello Everyone, 

 

I have two separate data files (one for eye movements and one for performance on a task). I want to combine these two data files into one file so that I can analyze them with one another, but am running into troubles on how to get started. 

 

The two data files have nothing but the participant file name in common and have varying amounts of responses per participants (ie. The eye movement data has more responses per participants compared to the task performance file). 

 

I have uploaded the files to this post. 

Guidance would be very helpful!! 

34 REPLIES 34
dale_lehman
Level VII

Re: Combining two Data files

I'm still having trouble understanding what you want to do.  So, I pulled out a single subject's data from both files (Session label ecem_10c).  One file has 337 rows and the other has 2,286 rows.  If you join these without dropping multiples you wil get 337x2286 rows - and for the full dataset that is probably too much informaton.  But without any other field to join on, what columns would you want to view together in order to do your analysis.  If you can tell what those columns are, I think I might be able to help.  But I don't understand your data and experimental conditions enough to know which of these columns (30 in one dataset and 27 in the other) make sense to look at together and which do not.

tlsimons
Level I

Re: Combining two Data files

a bare minimum of saccade length, fixation duration, deviation from screen center, condition type, cognitive load, video, participant, average nback performance, and time would be needed. None of these variables besides condition and participant are within the both data sets.

There are such stark differences in the data for each participant between the two files because of the data being collected. In the Eye movement file (2,286 rows) I am recording every single eye movement that they have. Int the nback file (337 rows) I am only getting a response every ~2 seconds because that is how often a letter is presented to them in an auditory manor. I will also have data on 4 of the 8 videos presented to each subject within the nback file, because participants watched half the videos with and half without the nback task to compare performance across the two conditions.

I am looking at eye movement changes based on the manipulations of condition and cognitive load. (fixed effects in my model)
I use participant and video as random effects, so they are still needed to run the analyses.

If I can combine the two files successfully I want to also look at these same variables with the addition of their performance on the nback task (the cognitive load).

Does this help at all?
dale_lehman
Level VII

Re: Combining two Data files

I would suggest subsetting a single participant from both files in order to determine exactly how you want to join the two files - if you can get what you want for a single participant, then you can easily do it for all of them.  It sounds like you may be able to join on one of those other common columns.  When joining, you can always click on Select columns and only select the ones you want - and it sounds like it may be easier to generate the data for a particular question you wish to analyze rather than trying to create the data set for any and all questions you want to analyze (you can always join them a bit differently for a different analysis).  But the idea is can you put the data together for one participant?  You may have to summarize the data a bit before trying to join them since you may not need all of those rows for the analysis you wish to conduct, so you may want to Tabulate the data from each dataset first, and then try to join the tabulated files.

tlsimons
Level I

Re: Combining two Data files

I talked to my collaborators and they have agreed that averaging the data together by participant would be fine to do some initial analyses.

Is there a way that I can have a resulting 8 rows for each participant? This would be one row for each of my film clips that were shown.
dale_lehman
Level VII

Re: Combining two Data files

In your larger file, create a new column using a formula such as ColMean(whatever measure you want to average by Session Label, by video).  In other words, get the average (or sum or standard deviation or whatever measure you want across the videos) by including two By conditions in that Col function - the first identifies the participant and the second identifies the video.  Then tabulate the data by participant using the newly created column as the data you want.  You can take whatever other columns you want - and you can do something like this in the other data set if you want to join some of the data from there.  From Tabulate, make it into a data table (and do the same if you want data from the other table to join to it).

tlsimons
Level I

Re: Combining two Data files

So i have made my two smaller tabulated files. I am having trouble joining them now into one file though. 

 

I basically just need to get the average /video into the fixrep file and I will be good, but I have tried it multiple ways and am not getting the desired output. 

dale_lehman
Level VII

Re: Combining two Data files

See if this is what you want.  I joined by matching 2 columns:  session id and video.

tlsimons
Level I

Re: Combining two Data files

I am not sure what is happening with some of the columns here, the naming is quite confusing. I should still have 400 rows though and that number is down to 200. This is one the things I tried because I got something very similar.
dale_lehman
Level VII

Re: Combining two Data files

Then click the "include nonmatches" box - you will get the 400 rows. Apparently 200 did not match, but you can look at them to see why there was no match from the other data set. If that is an error, you may need to try tabulating again to make sure all the videos and subjects appear in both tabulated files.
tlsimons
Level I

Re: Combining two Data files

The issue is that the performance file will not have as many observations, there is not data for all 8 videos like there is in the fixrep file.