Restructing longitudinal data in SPSS from wide to long format (July, 2019)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello in this video I'm going to provide a demonstration of how to restructure your data in SPSS from wide format to long format this particular approach to managing your data is oftentimes done in those cases where you are working with panel data we have repeated measurements from a set of cases over time and in particular this may be a necessary step if you're planning on performing some type of panel regression or HLM involving repeated measurements such as in the case of growth curve modeling so the data set that you see in front of you has several variables included we have subject identifiers basically we have a treatment group so individuals are either falling into Group 1 or group 2 and then we have repeated measurements on one variable which is depression so that's time 1 2 and time 3 depression and also anxiety at time 1 2 & 3 and so what we want to do is to restructure this data set such that the repeated measurements appear in vertical format so the way that we're going to do this is to go to data restructure and we're going to click on restructure selected variables in two cases that's the first thing so next we'll click on the next button and you have a couple of options the first is how many variable groups do you want to restructure so if you only have one you'll just leave that default clicked and if you go to next you'll notice that what we'll be doing is we would be moving the one set of repeated-measures variables over to this box right here and then you would give the target variable a name so we might call this depression hit enter and there you go and so if you run this on through then you would just get a vertical data set with depression only we don't really want to do that what actually what I want to do is since we have two variables that we're working with both depression and anxiety I'm actually going to click on this button right here to designate that we're going to be working with more than one set of repeated-measures variables so we're says how many we have it set at two because that's how many we're working with two sets so we're going to click on next and actually by doing that it's just sticking with the original variable transformation that we've already done at least for the depression variable so next what we'll do is we'll click on trance - right here and we'll move the anxiety variables over and we'll just go ahead and give this a name we'll call this anxiety and hit enter so now we can also go back and if we want certain variables to remain constant within individual then what we can do is we can move those variables to the fixed variables box so for instance we have treatment group if we want the subject identifier to remain the same which we would we can move these down to the fixed variables box and click on next and then then it asks how many index variables do you want to create so we're just going to stick with one and that one is actually going to designate time so we're gonna click on next and we can that we can edit the name if we want right now it would show up when we restructure it as index one I'm just gonna go and call it time even though that's just kind of that's my name that I'm giving it's nothing special about the naming we'll click on next next and then we'll say restructure the data now click on finish this box will pop up just basically you can ignore it and click on OK and so now our data has been restructured so now you can see that basically a new ID variable was created there's our subject identifier in both of these cases it just turns out that you can see there's person 1 and that person 1 was in treatment group 1 and they're measured at times 1 2 & 3 on depression & anxiety then we have person 2 right here that person was in treatment group 1 measure at times 1 2 & 3 on depression & anxiety and so forth so that's basically the restructuring process in a nutshell so just keeping in mind that by including this variable and this variable under the fixed factors you can see that we have essentially made sure that the values remain constant with in person so that concludes this demonstration and I appreciate you watching
Info
Channel: Mike Crowson
Views: 18,798
Rating: 5 out of 5
Keywords:
Id: hOQ4tti5MrE
Channel Id: undefined
Length: 4min 36sec (276 seconds)
Published: Tue Jul 16 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.